{
  "schema_version": "1.0",
  "name": "MarketingRouter",
  "description": "Agent-first creative generation, immutable revisions, managed Meta Ads, and exact owner campaign approvals.",
  "api_version": "2026-10-01",
  "base_url": "/",
  "api_base_path": "/api/v1",
  "url_resolution": "Resolve relative references against the origin serving this document.",
  "discovery": {
    "capabilities": "/api/v1/capabilities",
    "openapi": "/openapi.json",
    "llms": "/llms.txt",
    "documentation": "/llms-full.txt"
  },
  "documentation": "/docs-markdown/quickstart",
  "human_documentation": "/docs/quickstart",
  "page_equivalents": {
    "home": "/page-markdown/home",
    "pricing": "/page-markdown/pricing",
    "playground": "/page-markdown/playground",
    "dashboard": "/page-markdown/dashboard",
    "login": "/page-markdown/login"
  },
  "sitemap": "/sitemap.xml",
  "page_documentation": {
    "quickstart": "/docs-markdown/quickstart",
    "authentication": "/docs-markdown/authentication",
    "campaigns": "/docs-markdown/campaigns",
    "assets": "/docs-markdown/assets",
    "approvals": "/docs-markdown/approvals",
    "funding": "/docs-markdown/funding",
    "conversions": "/docs-markdown/conversions",
    "errors": "/docs-markdown/errors",
    "activity": "/docs-markdown/activity",
    "creatives": "/docs-markdown/creatives",
    "meta": "/docs-markdown/meta"
  },
  "console": "/dashboard",
  "activity_endpoint": "/api/v1/activity",
  "mode": "sandbox_and_managed_meta",
  "live_availability": {
    "endpoint": "/api/v1/capabilities",
    "json_pointer": "/data/live_spend_enabled"
  },
  "authentication": {
    "type": "http_bearer",
    "scopes": [
      "campaigns:read",
      "campaigns:write",
      "events:write"
    ],
    "owner_approval": "Authenticated workspace owner only; agent keys cannot approve.",
    "agent_key_prefixes": [
      "mr_test_",
      "mr_live_"
    ]
  },
  "public_operations": [
    {
      "method": "GET",
      "path": "/api/v1/capabilities"
    },
    {
      "method": "POST",
      "path": "/api/v1/quotes"
    }
  ],
  "money": {
    "currency": "USD",
    "unit": "integer_minor_units",
    "exception": {
      "field": "CreativeJob.usage.provider_cost_usd",
      "unit": "USD_major_units",
      "nullable": true,
      "meaning": "Observed provider cost; currently unknown. Not an estimate or settled invoice."
    }
  },
  "idempotency": {
    "campaign_create": "Idempotency-Key header; 8–128 letters, digits, dots, colons, underscores, or hyphens.",
    "events": "Stable event_id unique per workspace.",
    "balance_topup": "Idempotency-Key header. Preserve the same key and amount on retry.",
    "campaign_revise": "Idempotency-Key scoped to source campaign and request; same request replays the new plan.",
    "creative_generate": "Idempotency-Key; identical replay returns the same job with HTTP 202.",
    "creative_revise": "Idempotency-Key; identical replay returns the same child job with HTTP 202.",
    "creative_publish": "Durable internal identity per job and variant; repeat the same publication to reconcile without regenerating."
  },
  "boundaries": [
    "Meta is the only advertising channel.",
    "Creative generation is explicitly paid OpenAI work, independently gated from advertising and billing. A live campaigns:write key can initiate it before advertiser setup.",
    "No website crawl: generation uses only supplied product facts. No automatic paid generation retries after uncertainty.",
    "Private generated previews become public advertising media only through explicit publication; publication never launches a campaign.",
    "Live campaign launch requires advertiser binding, consent, validated tracking, verified funding, available allowance, the launch gate, and exact owner approval.",
    "Campaign revision creates a new plan. The source remains unchanged and continues running if active. No approval or budget reservation is inherited.",
    "Draft preparation does not activate ads. Reconcile to determine actual delivery.",
    "No automatic budget increases, optimization, MCP server, x402 payments, or outbound webhooks.",
    "Submitted conversions are not verified attribution."
  ],
  "modes": [
    "sandbox",
    "live"
  ],
  "channels": [
    {
      "id": "meta",
      "provider": "meta"
    }
  ],
  "funding": {
    "balance": "/api/v1/balance",
    "topups": "/api/v1/balance/topups",
    "guide": "/docs-markdown/funding",
    "checkout": "Owner-authorized secure hosted payment. Live write keys can request links; no automatic charge or refill."
  },
  "creative": {
    "guide": "/docs-markdown/creatives",
    "console": "/dashboard?tab=creatives",
    "availability": {
      "endpoint": "/api/v1/capabilities",
      "json_pointer": "/data/creative/enabled"
    },
    "provider": "openai",
    "models": {
      "copy": "gpt-6.1-sol",
      "image": "gpt-image-2.5-flare"
    },
    "generate": {
      "method": "POST",
      "path": "/api/v1/creatives",
      "scope": "campaigns:write",
      "key_mode": "live",
      "idempotency_required": true
    },
    "list": {
      "method": "GET",
      "path": "/api/v1/creatives",
      "scope": "campaigns:read",
      "limit": 10,
      "pagination": false
    },
    "read": {
      "method": "GET",
      "path": "/api/v1/creatives/{id}",
      "scope": "campaigns:read"
    },
    "revise": {
      "method": "POST",
      "path": "/api/v1/creatives/{id}/revise",
      "scope": "campaigns:write",
      "modes": [
        "copy",
        "image",
        "both"
      ],
      "idempotency_required": true
    },
    "publish": {
      "method": "POST",
      "path": "/api/v1/creatives/{id}/publish",
      "scope": "campaigns:write",
      "body": {
        "variant_index": 0
      },
      "launches_ad": false
    },
    "generation_requires_advertiser": false,
    "publish_requires_advertiser": true,
    "paid_generation": true,
    "ads_balance_debit": false,
    "limits": {
      "workspace_jobs": 10,
      "service_jobs": 100,
      "period": "beta_lifetime",
      "failures_and_revisions_count": true,
      "original_variants": {
        "min": 1,
        "max": 3
      },
      "revision_variants": 1
    },
    "stop_states": [
      "attention_required",
      "creative_generation_limit",
      "creative_generation_capacity",
      "creative_outcome_unknown",
      "generation_outcome_unknown"
    ],
    "preview_ttl_seconds": 900,
    "lineage_field": "revision_of",
    "automatic_generation_retries": false
  },
  "campaign_revision": {
    "method": "POST",
    "path": "/api/v1/campaigns/{id}/revise",
    "scope": "campaigns:write",
    "guide": "/docs-markdown/campaigns",
    "source_unchanged": true,
    "fresh_owner_approval_required": true
  }
}
