Agent quickstart
Discover, prepare, and monitor Meta campaigns through one API.
Discover before acting
MarketingRouter gives agents a scoped API for Meta advertising through MarketingRouter's managed Whop business. Humans approve the exact creative, destination, schedule, and lifetime budget. Read runtime capabilities first: deployment gates and advertiser setup determine whether live operations are available.
export BASE_URL="https://marketingrouter.com"
curl "$BASE_URL/api/v1/capabilities"
Use the origin serving these docs if the domain changes. All amounts are integer USD cents. Sandbox mode is a free application simulation with zero media spend. Live mode uses real provider resources; it is not a synonym for a successful or delivering advertisement.
Get a quote without credentials
curl "$BASE_URL/api/v1/quotes" \
-H 'Content-Type: application/json' \
-d '{"url":"https://example.com","objective":"purchase","budget_cents":50000,"geo":["US"],"mode":"live"}'
Quotes do not charge, crawl the website, or promise results. Live beta quotes have zero platform fee; sandbox quotes illustrate a 10% fee without collecting it. A quote is not evidence of available funds or account readiness.
Start in the sandbox
The owner signs in at /login and issues a scoped sandbox key in the console. Store it as MR_API_KEY in your secret store.
curl "$BASE_URL/api/v1/campaigns" \
-H "Authorization: Bearer $MR_API_KEY" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: example-launch-001' \
-d '{"name":"Example launch","url":"https://example.com","objective":"purchase","budget_cents":50000,"geo":["US"],"mode":"sandbox"}'
Save data.id and the idempotency key. Present data.approval_url to the owner. Agent keys cannot approve. Sandbox approval changes the local status; it does not create ads or charge money.
Move to managed Meta
- The operator assigns a Facebook Page and permitted destination origin to the owner. The owner accepts managed advertising authorization.
- The owner issues a live key with campaigns:read and campaigns:write. Add events:write only if this agent reports conversions.
- Upload an image through /api/v1/assets and complete its verification. See Creative uploads.
- Create a live campaign with the exact Meta plan, then POST /api/v1/campaigns/{id}/prepare to create a non-delivering Whop draft.
- Read /api/v1/balance. If more credit is needed, request /api/v1/balance/topups and give the owner its Whop checkout link. Wait for verified funding. The owner reviews the plan and funding status in the console. Paid launch requires verified funds, sufficient operator allowance, a working pixel/conversion signal, and the deployment launch gate.
- Give the owner approval_url. Approval authorizes only the stored plan_hash and lifetime budget.
- POST /api/v1/campaigns/{id}/reconcile, then GET /api/v1/campaigns/{id}/results. Poll with backoff; inspect delivery_status, not just status.
Read Campaigns, Approvals, and Funding before live work. There is no autonomous budget increase or creative substitution.
Read only what you need
Use /openapi.json for schemas, /llms.txt for the index, /llms-full.txt for all guides, /docs-markdown/{slug} for one guide, and /.well-known/agent.json for discovery. HTML pages advertise their Markdown equivalents. No MCP server, x402 payments, website crawler, creative generator, outbound webhooks, or automatic optimization is implemented.