API Reference
Facebook LoginGETLogin dialog
Creatives and videos

Create an ad creative

POST/v27.0/act_{ad_account_id}/adcreatives
Base URL: https://meta-ads.mimicr.dev · provider: https://graph.facebook.com

Creates a creative from an object_story_spec: the Page post with link_data (image) or video_data and a call to action.

  • Click-to-WhatsApp: link https://api.whatsapp.com/send and call_to_action {"type":"WHATSAPP_MESSAGE","value":{"app_destination":"WHATSAPP"}}; optional page_welcome_message.
  • Lead ads: link http://fb.me/ and call_to_action {type: SIGN_UP|LEARN_MORE|…, value: {lead_gen_form_id}}; the form must belong to page_id.
  • Website: call_to_action {type: LEARN_MORE|ORDER_NOW|…, value: {link}}.

Creatives are immutable except name and status. Requires ads_management and a role on the ad account. Disabled or closed accounts (status 2, 101) answer (#200) The ad account is disabled. page_id must be a Page the user can advertise on.

In Mimicr, [falha-simulada] in the creative text returns a transient 500 and creates nothing.

Authorization

Bearer token in the Authorization: Bearer <token> header. See Authentication.

Path parameters

ad_account_idstringrequired

ID of the ad account (the path is act_{ad_account_id}).

Example: "100539998049706"

Body

application/x-www-form-urlencoded
namestring

Name of the creative.

object_story_specobject

The post: page_id plus link_data or video_data.

Show child attributes
page_idstring

ID of the Page the post is published as. Required; the user must be able to advertise on it.

link_dataobject

A link post (image ad).

Show child attributes
linkstring

Destination URL. https://api.whatsapp.com/send for click-to-WhatsApp; http://fb.me/ for lead ads.

messagestring

Primary text of the ad.

namestring

Headline.

descriptionstring

Link description.

picturestring

URL of the image. Must be http(s). In Mimicr a URL containing nao-baixa can't be downloaded (3858258).

image_hashstring

Hash of an image in the account library. Accepted as an opaque string (the image library is not simulated).

call_to_actionobject

The call-to-action button: {type, value}.

Show child attributes
typestring

Type of the button: WHATSAPP_MESSAGE, LEARN_MORE, ORDER_NOW, SIGN_UP, APPLY_NOW, …

105 values
ADD_TO_CARTAPPLY_NOWASK_ABOUT_SERVICESASK_A_QUESTIONASK_FOR_MORE_INFOASK_USAUDIO_CALLBOOK_A_CONSULTATIONBOOK_NOWBOOK_TRAVELBROWSE_SHOPBUYBUY_ACTIVITY_TICKETSBUY_NOWBUY_TICKETSBUY_VIA_MESSAGECALLCALL_MECALL_NOWCHAT_NOWCHAT_WITH_USCONFIRMCONTACTCONTACT_USDONATEDONATE_NOWDOWNLOADEVENT_RSVPFIND_A_GROUPFIND_OUT_MOREFIND_YOUR_GROUPSFOLLOW_NEWS_STORYLINEFOLLOW_PAGEFOLLOW_USERGET_A_QUOTEGET_DETAILSGET_DIRECTIONSGET_IN_TOUCHGET_OFFERGET_OFFER_VIEWGET_PROMOTIONSGET_QUOTEGET_SHOWTIMESGET_STARTEDINQUIRE_NOWINSTALL_APPINSTALL_MOBILE_APPJOIN_CHANNELJOIN_LIVE_VIDEOLEARN_MORELIKE_PAGELISTEN_MUSICLISTEN_NOWMAKE_AN_APPOINTMENTMESSAGE_PAGEMOBILE_DOWNLOADNO_BUTTONOPEN_INSTANT_APPOPEN_LINKORDER_NOWPAY_TO_ACCESSPLAY_GAMEPLAY_GAME_ON_FACEBOOKPURCHASE_GIFT_CARDSRAISE_MONEYRECORD_NOWREFER_FRIENDSREQUEST_TIMESAY_THANKSSEE_MORESEE_SHOPSELL_NOWSEND_A_GIFTSEND_GIFT_MONEYSEND_UPDATESSHARESHOP_NOWSHOP_WITH_AISIGN_UPSOTTO_SUBSCRIBESTART_A_CHATSTART_ORDERSTREAM_NOWSUBSCRIBESWIPE_UP_PRODUCTSWIPE_UP_SHOPTRY_DEMOTRY_ON_WITH_AIUPDATE_APPUSE_APPUSE_MOBILE_APPVIDEO_ANNOTATIONVIDEO_CALLVIEW_CARTVIEW_CHANNELVIEW_IN_CARTVIEW_PRODUCTVISIT_PAGES_FEEDVISIT_WEBSITEWATCH_LIVE_VIDEOWATCH_MOREWATCH_NOWWATCH_VIDEOWHATSAPP_MESSAGEWOODHENGE_SUPPORT
valueobject

Button target: {app_destination: "WHATSAPP"}, {link} or {lead_gen_form_id}.

Show child attributes
app_destinationstring

WHATSAPP for click-to-WhatsApp ads.

linkstring

Destination URL of the button.

lead_gen_form_idstring

ID of the lead form of a lead ad. The form must belong to the creative's Page.

page_welcome_messagestring

Greeting of click-to-WhatsApp ads (VISUAL_EDITOR JSON). Its text becomes referral.welcome_message.text.

child_attachmentsobject[]

Carousel cards.

video_dataobject

A video post.

Show child attributes
video_idstring

ID of a video of the account in ready state.

messagestring

Primary text of the ad.

titlestring

Headline of the video ad.

image_urlstring

Thumbnail URL. A thumbnail (image_url or image_hash) is required.

image_hashstring

Hash of an image in the account library. Accepted as an opaque string (the image library is not simulated).

call_to_actionobject

The call-to-action button: {type, value}.

Show child attributes
typestring

Type of the button: WHATSAPP_MESSAGE, LEARN_MORE, ORDER_NOW, SIGN_UP, APPLY_NOW, …

105 values
ADD_TO_CARTAPPLY_NOWASK_ABOUT_SERVICESASK_A_QUESTIONASK_FOR_MORE_INFOASK_USAUDIO_CALLBOOK_A_CONSULTATIONBOOK_NOWBOOK_TRAVELBROWSE_SHOPBUYBUY_ACTIVITY_TICKETSBUY_NOWBUY_TICKETSBUY_VIA_MESSAGECALLCALL_MECALL_NOWCHAT_NOWCHAT_WITH_USCONFIRMCONTACTCONTACT_USDONATEDONATE_NOWDOWNLOADEVENT_RSVPFIND_A_GROUPFIND_OUT_MOREFIND_YOUR_GROUPSFOLLOW_NEWS_STORYLINEFOLLOW_PAGEFOLLOW_USERGET_A_QUOTEGET_DETAILSGET_DIRECTIONSGET_IN_TOUCHGET_OFFERGET_OFFER_VIEWGET_PROMOTIONSGET_QUOTEGET_SHOWTIMESGET_STARTEDINQUIRE_NOWINSTALL_APPINSTALL_MOBILE_APPJOIN_CHANNELJOIN_LIVE_VIDEOLEARN_MORELIKE_PAGELISTEN_MUSICLISTEN_NOWMAKE_AN_APPOINTMENTMESSAGE_PAGEMOBILE_DOWNLOADNO_BUTTONOPEN_INSTANT_APPOPEN_LINKORDER_NOWPAY_TO_ACCESSPLAY_GAMEPLAY_GAME_ON_FACEBOOKPURCHASE_GIFT_CARDSRAISE_MONEYRECORD_NOWREFER_FRIENDSREQUEST_TIMESAY_THANKSSEE_MORESEE_SHOPSELL_NOWSEND_A_GIFTSEND_GIFT_MONEYSEND_UPDATESSHARESHOP_NOWSHOP_WITH_AISIGN_UPSOTTO_SUBSCRIBESTART_A_CHATSTART_ORDERSTREAM_NOWSUBSCRIBESWIPE_UP_PRODUCTSWIPE_UP_SHOPTRY_DEMOTRY_ON_WITH_AIUPDATE_APPUSE_APPUSE_MOBILE_APPVIDEO_ANNOTATIONVIDEO_CALLVIEW_CARTVIEW_CHANNELVIEW_IN_CARTVIEW_PRODUCTVISIT_PAGES_FEEDVISIT_WEBSITEWATCH_LIVE_VIDEOWATCH_MOREWATCH_NOWWATCH_VIDEOWHATSAPP_MESSAGEWOODHENGE_SUPPORT
valueobject

Button target: {app_destination: "WHATSAPP"}, {link} or {lead_gen_form_id}.

Show child attributes
app_destinationstring

WHATSAPP for click-to-WhatsApp ads.

linkstring

Destination URL of the button.

lead_gen_form_idstring

ID of the lead form of a lead ad. The form must belong to the creative's Page.

photo_dataobject

A photo post.

text_dataobject

A text post.

instagram_user_idstring

Instagram account the ad runs as.

object_story_idstring

An existing post, {page_id}_{post_id}, instead of object_story_spec.

url_tagsstring

Query string appended to the link.

degrees_of_freedom_specobject

Creative enhancements (stored only).

authorization_categorystring

Stored.

NONEPOLITICALPOLITICAL_WITH_DIGITALLY_CREATED_MEDIA
execution_optionsstring[]

["validate_only"] runs every validation and returns {"success":true} without writing.

validate_only

Responses

200The creative.
idstringrequired

ID of the new object.

400Error in the Graph envelope: 100/1373054 unparseable call to action, 100/3858258 image couldn't be downloaded, 100/1885252 video not ready, 200 no access to the Page.
errorobjectrequired
Show child attributes
messagestringrequired

Description of the error.

Example: "(#100) The parameter special_ad_categories is required"
typestringrequired

OAuthException for most codes (the Marketing API uses it for validation too), GraphMethodException for unknown objects, FacebookApiException for transient errors. In Mimicr, routes outside the integration core answer MimicrNotSimulated with HTTP 501.

Example: "OAuthException"
codeintegerrequired

Error code (100 invalid parameter, 190 invalid token, 200 permission, 2635 deprecated version, 613/17/80004 rate limits, …).

Example: 100
error_subcodeinteger

Error subcode with more detail (1885272 budget too low, 463 token expired, …).

Example: 1885272
is_transientboolean

Whether retrying the same request may succeed. Present on every Marketing API error; true for codes 1 and 2.

error_user_titlestring

Title of the error, to show to people.

error_user_msgstring

Message of the error, to show to people.

error_dataobject

Extra data. blame_field_specs lists the params that caused a validation error.

Show child attributes
blame_field_specsstring[][]
fbtrace_idstringrequired

Internal support identifier of the request.

Example: "AbCdEf12345"
500Transient error: code 2 with is_transient: true. Retry later.
errorobjectrequired
Show child attributes
messagestringrequired

Description of the error.

Example: "(#100) The parameter special_ad_categories is required"
typestringrequired

OAuthException for most codes (the Marketing API uses it for validation too), GraphMethodException for unknown objects, FacebookApiException for transient errors. In Mimicr, routes outside the integration core answer MimicrNotSimulated with HTTP 501.

Example: "OAuthException"
codeintegerrequired

Error code (100 invalid parameter, 190 invalid token, 200 permission, 2635 deprecated version, 613/17/80004 rate limits, …).

Example: 100
error_subcodeinteger

Error subcode with more detail (1885272 budget too low, 463 token expired, …).

Example: 1885272
is_transientboolean

Whether retrying the same request may succeed. Present on every Marketing API error; true for codes 1 and 2.

error_user_titlestring

Title of the error, to show to people.

error_user_msgstring

Message of the error, to show to people.

error_dataobject

Extra data. blame_field_specs lists the params that caused a validation error.

Show child attributes
blame_field_specsstring[][]
fbtrace_idstringrequired

Internal support identifier of the request.

Example: "AbCdEf12345"