Skip to content
Book a callStart free
Reference

ads_draft_launch

Draft an ad launch

View as Markdown

POST /api/v2/ads/launches

Makes a DRAFT only. Nothing launches or spends until a person opens review_url and presses Launch. Needs the ads:write scope.

Request body (JSON)

NameTypeRequiredDescription
ad_account_idstringyesAn id from ads_list_accounts. Its platform (Meta or TikTok) and currency come with it.
namestringnoThe campaign’s name. Leave out for ” · ”.
goal“traffic” | “sales”yes“traffic” = visits to a site; “sales” = purchases, needs pixel_id.
pixel_idstringnoSales only: the Meta pixel / TikTok pixel code to count purchases with.
daily_budgetnumberyesWhat the whole launch may spend a day, in the account’s currency as people say it: 20 = $20 a day.
start_atstringnoLeave out to start as soon as it’s approved.
end_atstringnoLeave out to run until paused.
countriesstring[]yesTwo-letter country codes, like [“US”, “CA”].
age_minintegernoDefault 18.
age_maxintegernoDefault 65.
gender“all” | “female” | “male”noDefault “all”.
adsobject[]yesOne ad per video or picture, each with its own words.
ads[].creative_idstringyesAn id from ads_list_creatives.
ads[].textstringyesThe ad’s words over the video. TikTok allows 100 characters, Meta far more (first ~125 show).
ads[].headlinestringnoMeta only, optional: the bold line under the video.
ads[].cta“learn_more” | “shop_now” | “sign_up” | “download” | “contact_us” | “book_now”yesThe button.
ads[].urlstringyesWhere the button goes. Must start with https://.

Example

curl -X POST "https://app.diffusr.ai/api/v2/ads/launches" \
-H "Authorization: Bearer $DIFFUSR_KEY" \
-H "Content-Type: application/json" \
-d '{
"ad_account_id": "ACCOUNT_ID",
"goal": "traffic",
"daily_budget": 20,
"countries": [
"US"
],
"ads": [
{
"creative_id": "asset:CREATIVE_ID",
"text": "Fresh and fizzy.",
"cta": "shop_now",
"url": "https://example.com"
}
]
}'

Response

201 ApiAdsLaunch

A DRAFT with a review_url.

NameTypeRequiredDescription
idstringyes
statusstringyes
stepstring | nullyes
errorstring | nullyes
platformstringyes
accountstringyes
namestringyes
daily_budgetnumberyes
currencystringyes
review_urlstring | nullyes
open_urlstring | nullyes
live_atstring | nullyes
nextstringyes

Errors

Every error body is { error, code, request_id, ... }. All codes and what to do.

  • 401: Missing, wrong, revoked or expired API key (code UNAUTHORIZED, KEY_REVOKED, KEY_EXPIRED).
  • 403: The key may not do this (SCOPE_DENIED, MODEL_NOT_ALLOWED, TEST_MODE_UNSUPPORTED, ACCOUNT_BLOCKED, allowance_exceeded).
  • 404: No such id, or it is not yours, or it belongs to the other key mode (NOT_FOUND).
  • 422: The request is not valid (VALIDATION_FAILED, INVALID_JSON, PREFLIGHT_FAILED, CALLBACK_URL_INVALID, REFERENCE_*). `issues` lists each problem. Nothing was charged.
  • 429: Too many requests or jobs (RATE_LIMITED, CONCURRENCY_LIMIT, UPLOAD_QUOTA, …). Wait Retry-After seconds, then retry.
  • 500: Our fault (INTERNAL_ERROR). Quote request_id to support.
  • 503: Paused or busy (API_PAUSED, MODEL_PAUSED, PROVIDER_PAUSED, PROVIDER_BUSY, UNAVAILABLE). Wait Retry-After seconds, then retry.

Charges

Free. Makes a draft only; nothing launches or spends until a person presses Launch in the app.