Skip to main content
POST
Typescript (SDK)

Authorizations

Authorization
string
header
required

API key in the format: Bearer {api_token}

Headers

Idempotency-Key
string

Makes this write safe to retry: a repeat with the same key replays the first response instead of creating a second resource. Scoped to the account, remembered for 24 hours; reusing a key with a different payload is an error.

Maximum string length: 255

Body

application/json

Ad to create.

account_id
string
ad_account_id
string
name
string
goal
string
budget_amount
number

Budget for the new ad set (or campaign, with budget_level=campaign). Whole currency units, NOT cents: 20 = $20.00. Meta's own Marketing API takes this number in minor units, so it is an easy and expensive mix-up — 2000 here buys $2000.00 of ads, not $20.00.

budget_type
string

daily or lifetime. A lifetime budget also needs end_date.

headline
string
body
string
call_to_action
string
image_url
string

Response

Created ad.

Created ad.