API Reference
Facebook LoginGETLogin dialog
Ads

Create an ad

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

Creates an ad from an ad set and a creative. New ads are reviewed before they run, whatever their status: effective_status goes IN_PROCESS → PENDING_REVIEW → the outcome (ACTIVE/PAUSED, DISAPPROVED with ad_review_feedback, or WITH_ISSUES). Requires ads_management and a role on the ad account. Disabled or closed accounts (status 2, 101) answer (#200) The ad account is disabled.

In Mimicr, IN_PROCESS lasts about 5 s and the decision comes reviewDelayMinutes (default 10) sandbox minutes later; triggers in the ad name or creative text change it ([reprovar], [com-problemas], [revisao-manual]), and the control actions ad.approve/ad.reject decide at once.

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
namestringrequired

Name of the ad. Review triggers in Mimicr: [reprovar], [com-problemas], [revisao-manual], [falha-simulada].

adset_idstringrequired

ID of the ad set; it can't change later.

creativeobjectrequired

{"creative_id":"<id>"}. An inline {object_story_spec} is accepted too. A new creative puts the ad back into review.

Show child attributes
creative_idstring

ID of a creative of this account.

statusstring

ACTIVE or PAUSED. The ad is reviewed either way.

ACTIVEPAUSED
tracking_specsobject

Tracking specs (stored).

conversion_domainstring

Conversion domain (stored).

execution_optionsstring[]

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

validate_only

Responses

200The ad.
idstringrequired

ID of the new object.

400Error in the Graph envelope: 100/33 unknown ad set, 100/1885128 invalid creative, 200, 613, 2635.
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"