POST /v1/projects/:projectId/ads/:platform/campaigns
Simplified create-campaign endpoint. Customer picks budget + outcome + management mode + creative mode; Layers handles the rest.
/v1/projects/:projectId/ads/{platform}/campaigns- Auth
- Bearer
- Scope
- ads:write:campaigns
Headline create-campaign endpoint per LOCK 6 — minimal required surface so the customer's "Create Campaigns on {platform}" button doesn't require ads expertise.
This is the simplified create-campaign surface. It accepts the four required config entities for the customer's intent (budget, outcome, management mode, creative mode) and defaults every tactical detail per platform best practice. Sophisticated partners can use the granular CRUD endpoints (per-budget, per-targeting, etc.) for explicit overrides.
Supported {platform}: meta, tiktok, apple. Apple campaign-create lifted in this release — see the LOCK 10 investigation.
Path parameters
projectIdstring (uuid)requiredProject the new campaign belongs to.platformstringrequiredPlatform.One of:meta,tiktok,apple
Body
adAccountIdstring (uuid)requiredLayers ad-account id from [`GET …/ad-accounts`](/docs/api/reference/ads/list-ad-accounts).namestringrequired1-128 chars. Shows up in the platform's ad manager.outcomestringrequiredPlatform-normalized outcome.One of:conversions,traffic,app_installs,engagement,lead_generationdailyBudgetCentsintegeroptionalDaily budget in cents. Required if `lifetimeBudgetCents` is not set.lifetimeBudgetCentsintegeroptionalLifetime budget in cents. Required if `dailyBudgetCents` is not set.campaignManagementModestringrequiredSets the new campaign's tactical + structural authority.One of:manual,draft,autopilotcreativeModestringrequiredSets the new campaign's creative authority.One of:manual,draft,autopilotstartTimestring (ISO 8601, UTC Z)optionalOptional start time. Defaults to now.endTimestring (ISO 8601, UTC Z)optionalOptional end time. Required for some platform/outcome combos (TikTok lifetime-budget).bidStrategyobjectoptionalOptional override of the platform default. See platform-specific notes.targetingobjectoptionalOptional override of the platform default targeting.metadataobjectoptionalFree-form, ≤ 8KB. Round-tripped on read.
Mode → axis mapping:
| Mode | tactical | structural | creative |
|---|---|---|---|
manual | off | off | off |
draft | draft | draft | draft |
autopilot | auto | auto | auto |
The two mode params let you mix-and-match. Example: campaignManagementMode: "draft" + creativeMode: "autopilot" produces {tactical: "draft", structural: "draft", creative: "auto"}.
Request
curl -X POST https://api.layers.com/v1/projects/$PROJECT_ID/ads/meta/campaigns \
-H "Authorization: Bearer $LAYERS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"adAccountId": "aa_01HXF1...",
"name": "Q3 prospecting",
"outcome": "conversions",
"dailyBudgetCents": 5000,
"campaignManagementMode": "draft",
"creativeMode": "autopilot"
}'5000 cents = $50.00 daily.
Response
{
"jobId": "job_01HZX9...",
"campaignId": "cmp_01HZX9...",
"verdictId": "ver_01HZX9...",
"kind": "ads_create_campaign",
"status": "running",
"platform": "meta",
"authority": {
"creative": "auto",
"tactical": "draft",
"structural": "draft"
},
"locationUrl": "/v1/jobs/job_01HZX9..."
}The Layers campaignId is allocated immediately. Poll the job for the platform-side mutation; the platform-side id appears on subsequent GET …/campaigns/:campaignId calls.
verdictId is the audit-row UUID — quote it to Layers support.
{
"error": {
"code": "AUTHORITY_DENIED",
"message": "Layer's structural axis is set to 'off'; campaign-create denied.",
"requestId": "req_...",
"details": {
"verdictId": "ver_01HZX9...",
"axis": "structural",
"currentMode": "off"
}
}
}Errors
| Code | When |
|---|---|
VALIDATION | Body shape error; both daily and lifetime budget set; missing required field. |
AUTHORITY_DENIED | Bucket-mode axis denies the create — see ads write model. |
FORBIDDEN_SCOPE | Key lacks ads:write:campaigns. |
NOT_FOUND | Project / ad account not in this org, or platform OAuth not connected. |
IDEMPOTENCY_CONFLICT | Same Idempotency-Key replayed with a different body. |
See also
- Run ads as partner — end-to-end guide
- Ads write model — bucket-mode authority + simplified-create surface contract
PATCH …/campaigns/:id/budgetPATCH …/campaigns/:id/authority- Apple campaign-create investigation