Campaign lifecycle
Immutable plans, bounded budgets, and explicit provider reconciliation.
Choose lifetime or daily pacing
budget_cents always means total spending authority, in USD cents. It never becomes a per-day amount. Omit budget_type for the existing lifetime behavior, or set budget_type: "daily" with daily_budget_cents. The daily amount must not exceed total authority. Both types keep a bounded start/end schedule of 24 hours–30 days.
{
"url": "https://example.com",
"objective": "traffic",
"budget_type": "daily",
"daily_budget_cents": 1000,
"budget_cents": 10000,
"geo": ["US"],
"mode": "live"
}
This quote requests $10/day pacing and $100 total authority. It does not authorize $100/day. Daily plans can be saved and prepared as non-delivering Meta drafts. Native daily pacing can vary, and a scheduled end is not a total-spend cap. Live daily activation and campaign checkout currently return daily_spend_cap_unavailable: the advertising connection does not expose a verified independent total cap. A polling pause is insufficient to guarantee a hard ceiling. Read capabilities.budgets and launch_blocker; do not try to bypass this condition. Use lifetime mode for bounded live delivery.
Change a daily plan using POST /api/v1/campaigns/{id}/revise with daily_budget_cents; the result is a new plan requiring fresh approval. The existing action: "budget" control only changes lifetime allocation and rejects daily campaigns. Switching a revision back to lifetime removes daily fields. Reporting returns budget_type beside the budget; daily rows display per-day amounts while approved_ceiling_cents remains total authority. Performance keeps total authority separate from daily pacing.
Create a plan
POST /api/v1/campaigns requires campaigns:write and Idempotency-Key. The key contains 8–128 letters, digits, dots, colons, underscores, or hyphens. Reusing it with identical normalized input returns the existing campaign; different input returns idempotency_conflict. Keep the key across timeouts.
A live plan requires a ready creative assigned to this owner, the assigned Facebook Page, and a destination within the approved HTTPS origin.
{
"name": "Bookkeeping launch",
"url": "https://example.com/pricing",
"objective": "purchase",
"budget_cents": 50000,
"currency": "USD",
"geo": ["US"],
"target_cac_cents": 4000,
"mode": "live",
"meta": {
"starts_at": "2030-01-02T12:00:00Z",
"ends_at": "2030-01-09T12:00:00Z",
"headline": "Bookkeeping that keeps up",
"primary_text": "See how it works for your business.",
"creative_file_id": "file_REPLACE",
"facebook_social_account_id": "sacc_REPLACE"
}
}
Replace the example dates and resource IDs. Start at least five minutes in the future; duration must be 24 hours to 30 days. Budget bounds are 100–10000000 cents. Geography uses 1–20 uppercase ISO country codes. A supplied conversion_event must match the objective: purchase→purchase, signup→signup, traffic→page_view. target_cac_cents is a planning target, not an enforced acquisition guarantee.
Plans are immutable. A changed destination, creative, copy, schedule, geography, or budget requires a new campaign and approval. The response contains plan_hash, approval_url, mode, status, and provider resource IDs once prepared.
Prepare, approve, observe
| Local state | Meaning / next action |
|---|---|
| awaiting_approval | Stored locally. Live: call prepare. Sandbox: request owner approval. |
| preparing | Provider draft submission in progress or outcome uncertain. Retry the same prepare operation within its retry window. |
| draft | Non-delivering Meta hierarchy exists; owner can inspect the exact plan. |
| launching | Owner approved and budget reserved; activation is in progress or uncertain. Reconcile. |
| active | Configured active or in review. Check delivery_status for actual network delivery. |
| pausing | Pause request in progress or uncertain. Reconcile. |
| paused | the advertising provider confirmed pause. Accrued costs remain payable. |
| attention_required | Provider rejection, mismatch, or another issue requires review. |
| completed | Provider reports completed delivery. |
POST /api/v1/campaigns/{id}/prepare creates one Meta draft, ad group, and ad. It does not enable spending. Owner approval uses a separate endpoint. POST /api/v1/campaigns/{id}/reconcile retrieves current provider state and metrics. GET endpoints return persisted snapshots and do not poll the advertising provider implicitly. Prepared live campaigns also receive background checks; read performance.synchronization and Automatic reporting for cadence, health and recovery.
Pause and retry
POST /api/v1/campaigns/{id}/pause requires campaigns:write. It waits for provider confirmation. A timeout is not a successful pause. Reconcile and retain the original campaign; do not make a duplicate launch. Provider mutations use durable operation keys and no automatic network retries. After 23 hours an ambiguous POST needs operator reconciliation rather than a new idempotency key.
There is no resume or in-place edit operation in this release. Use the revision endpoint below to create a new plan with fresh owner approval. Reserved budget is not automatically released on pause: provider spend can arrive late.
Read and paginate
GET /api/v1/campaigns?limit=20 returns data.items and data.next_cursor. Pass the returned cursor with the same limit for the next page. Limits are 1–100; order is descending campaign UUID, not chronological. GET /api/v1/campaigns/{id} returns one owner-scoped record; foreign IDs return 404.
Configure an existing campaign safely
POST /api/v1/campaigns/{id}/revise accepts changes only and requires campaigns:write plus Idempotency-Key. It copies the owned source plan, applies your fields, and validates the complete result. The source stays unchanged. A currently running source keeps running until separately paused.
curl "$BASE_URL/api/v1/campaigns/$CAMPAIGN_ID/revise" \
-H "Authorization: Bearer $MR_API_KEY" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: campaign-copy-v2' \
-d '{"meta":{"headline":"Keep your research together","primary_text":"Organize shared research notes in one workspace. Explore Field Notes."}}'
Allowed changes: name, url, objective, budget_cents, geo, target_cac_cents, and partial meta fields (headline, primary_text, creative_file_id, facebook_social_account_id, starts_at, ends_at). Send at least one change. Do not send mode, currency, conversion_event, status, provider IDs, or approval fields. Mode remains the source mode; the conversion event is derived again from the objective. The generated name adds “· revision” unless supplied explicitly.
A live revision must still match the assigned destination and Facebook identity, use a ready owned image, and have a valid future schedule. Update starts_at and ends_at together if the source schedule has already started. To use a generated revision, publish it first, then pass its ready creative_file_id and exact concept copy in meta.
{
"budget_cents": 15000,
"meta": {
"creative_file_id": "file_REPLACE",
"headline": "Keep your research together",
"primary_text": "Organize shared research notes in one workspace. Explore Field Notes.",
"starts_at": "2030-01-05T12:00:00Z",
"ends_at": "2030-01-08T12:00:00Z"
}
}
Replace the example schedule and file ID. New requests return 201 and an independent campaign; identical retries return 200. The X-Revises-Campaign response header identifies the source. Idempotency is scoped to source campaign and key: retain both after a timeout. No approvals, charges, reservations, or provider resources are copied. Prepare the new live plan, inspect it, and return its new approval_url to the owner. Never infer approval from the source campaign.
Ongoing delivery controls
Read Media buying controls for pause/resume, lifetime budget adjustments within the approved ceiling, performance diagnostics and command recovery.
Run several ads under one budget
A campaign supports up to five separate image ads in one ad group. The primary ad uses meta.headline, meta.primary_text and meta.creative_file_id. Add up to four alternatives in meta.additional_ads, each with those same three fields. All ads use the same Page, destination, audience, schedule and one shared media budget. The budget is never multiplied by the number of ads. Allocation among the ads is controlled by Meta; this is not a controlled equal-spend experiment.
Generate several variants, publish each chosen variant, then include the ready owned file IDs with their exact copy. Preparation saves each ad independently. If preparation is interrupted, repeat the same prepare call; completed ads are reused. Do not create a replacement campaign to recover an uncertain request.
The campaign response exposes provider_ad_ids in the same order as the primary ad followed by additional_ads. provider_ad_id remains the first ad for compatibility. The owner reviews all ads together. Every image, copy field and ad identity is verified before launch or increased delivery. Unknown, removed or changed provider ads block activation. To change ads, create a new reviewed revision; use additional_ads: [] to remove all alternatives in that new plan.
{
"additional_ads": [
{
"headline": "Bring your research together",
"primary_text": "One workspace for shared notes and source material. Explore Field Notes.",
"creative_file_id": "file_REPLACE_WITH_SECOND_PUBLISHED_VARIANT"
}
]
}
Place this additional_ads array inside meta, alongside the primary ad, Page and schedule. The owner console offers Add another ad and an expandable preview for every ad.
Minimum media budget
New live plans require at least $5 per started 24-hour period of their schedule. A one-day lifetime plan needs 500 cents; two days need 1000 cents. Daily plans require daily_budget_cents >= 500, but their live activation remains unavailable until a provider-enforced total cap is supported. The network may impose a higher minimum for an account or objective. budget_below_minimum provides minimum_budget_cents before a provider draft or charge is created. Never raise the owner's spending authority automatically to satisfy a minimum.
Service fees and balance accounting
New campaigns store a 5% service fee in immutable pricing terms. budget_cents is media spending authority. pricing.maximum_total_cents includes the maximum service fee. The owner must approve both approved_budget_cents and approved_total_cents, plus the exact approved_plan_hash. For $100 of media, reserve $105 from prepaid credit. Existing zero-fee campaigns keep their original terms.
Read GET /api/v1/campaigns/{id}/billing with campaigns:read for reconciled media spend, service fees, remaining reservations and the latest twenty balanced accrual entries. Refresh delivery through the existing reconcile endpoint. The fee is rounded up to a cent once on cumulative verified USD spend; it is not multiplied by ads or refresh calls. Duplicate observations do not charge again. Downward corrections reverse prior accruals. Provider spend above approved authority places funding on hold and requests a pause rather than charging the overage to the customer.
GET /api/v1/balance reports available_cents = funded_cents - reserved_cents - spent_cents (zero when held). Media and fee accruals transfer from reserved to spent, leaving available unchanged. Unspent reservations remain held after pause pending final reconciliation. These are observed costs, not a final invoice.
Service fees and deposit payment costs are reconciled automatically as verified media spend is recorded. Credit from the oldest funded deposit is consumed first, including the campaign service fee. Each campaign receives only the proportional payment cost of the credit it consumes; cent rounding is conserved across campaigns. These costs were already deducted at deposit and are never charged again. Downward corrections return that campaign’s allocation without changing another campaign’s costs. Unspent credit keeps its remaining payment-cost allocation. Historical fixed-credit receipts carry zero customer payment cost because MarketingRouter covered processing. Funding taxes and the advertised product’s checkout fees are excluded.
Read GET /api/v1/campaigns/{id}/billing for payment_cost_status, payment_cost_cents, payment_cost_allocated_credit_cents, payment_cost_observed_at and payment_cost_method: fifo_credit_slices_v1. Read /economics for media + service fees + allocated payment costs and cost per paying customer. service_reconciled requires matching verified billing and payment-cost allocation. Missing cost sources return null with payment_cost_allocation_pending; reconcile campaign delivery and retry. A reversed or changed funding receipt produces payment_cost_review_required and requires operator resolution. Never interpret null as zero or pay again to clear a review.