{
  "openapi": "3.0.3",
  "info": {
    "title": "app2email WhatsApp API",
    "version": "1.4.0",
    "description": "Send WhatsApp **template messages** from your own systems (n8n, Zapier, Make, Power Automate, scripts, AI agents) through your app2email WhatsApp number.\n\n**Address:** every request includes the full WhatsApp number you send *from*, digits only: `https://api.app2email.com/v1/{number}/...`\n\n**Authentication:** the API key from https://www.app2email.com/dashboard/apikey, as `X-API-KEY: a2e_...` or `Authorization: Bearer a2e_...`. Keep the key on a server - do not put it in a web page. A key has **scopes**: `messages:send` (send, media upload, cancel a broadcast, conversation owner, approvals), `messages:read` (messages, conversations, broadcasts, usage, stats, templates, request log, contacts, stored media), `dnc:manage` (Do Not Call list, compliance export), `webhooks:manage`, `templates:manage` (templates and flows: create, edit, delete, archive, insights; each change applies to every number of the WhatsApp Business Account), `settings:manage` (auto reply, email forwarding, opt-ins, the number's settings), `contacts:manage` (contacts, segments, consent records), `calls:manage` (WhatsApp Calling), `bookings:manage` (appointment bookings, the booking settings, sending a Flow; the booking reads also work with `messages:read`), or `*` for full access. The Default key (the key made before keys with permissions existed) has `messages:send`, `messages:read`, `dnc:manage` and `webhooks:manage` only - creating templates and changing settings need a key created with Full access. A call the key may not make answers 403 `insufficient_scope`. A key can also be limited to some IP addresses, or expire. `GET /v1/{number}/me` checks a key and shows its name, scopes and limits.\n\n**Rate limit:** every call counts against its key (calls without a key: against the IP address). Each answer has the headers `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset` (seconds until full again) and `X-RateLimit-Policy`. Over the limit: 429 `rate_limited` with a `Retry-After` header and `error.retry_after_seconds`. Wait, then send again (`limits.rate_limit_mode` in GET /me is `enforce`).\n\n**Empty fields:** a field with no value is left out of the answer rather than sent as `null`, in API answers and in webhook events alike.\n\n**Errors:** every error is `{\"success\": false, \"request_id\", \"error\": {\"code\", \"message\", \"how_to_fix\", \"documentation_url\", \"is_retriable\", \"retry_after_seconds\"?, \"details\"?, \"example_request\"?, \"whatsapp_error\"?}}`. Decide by `code`. `is_retriable` is true when the same request can work later unchanged (limits, caps, trouble on our side or WhatsApp's); `retry_after_seconds` says how long to wait when it is known.\n\n**Request ID:** every answer, success or error, has a `request_id`. Quote it to support. `GET /v1/{number}/requests/{request_id}` shows what was logged for it (errors and requests that change something, kept 30 days).\n\n**Plans:** every call, reading as well as sending, needs a paid plan (Standard, Professional, Team, Agency or Agent/Developer; 403 `plan_not_allowed`) and a LIVE service (403 `service_not_live`).\n\n**For AI agents:** MCP server `https://api.app2email.com/mcp` (Streamable HTTP, the same `Authorization: Bearer` key, 111 tools that map to the calls below: https://www.app2email.com/docs/api/mcp). No account yet: an agent can create one for a person with the Management MCP server `https://api.app2email.com/mcp/manage` (`create_account`, no key; the person then confirms the e-mail, connects WhatsApp and chooses a plan): https://www.app2email.com/docs/api/agents. A2A agent: `GET https://api.app2email.com/.well-known/agent-card.json`, `POST /a2a/v1`. `GET https://api.app2email.com/health` (no key) reports the service status.\n\n**Request format:** the same as WhatsApp Cloud API template messages (`to`, `type: \"template\"`, `template.name`, `template.language.code`, `template.components`). Give one value per placeholder (`{{1}}`, `{{2}}`, ... or named placeholders with `parameter_name`).\n\n**Free-form replies:** `\"type\": \"text\" | \"image\" | \"video\" | \"document\"` sends a normal message (not a template) to one number, but only within 24 hours of that contact's last message to your number (app2email stops 15 minutes early; `window_closes_at` in the answer is the exact time, and `window_open` in `GET /v1/{number}/conversations` says whether it is open now). `text`: `{\"body\": \"...\", \"preview_url\": false}`. `image`, `video`, `document`: `link`, base64 `data` (with `filename`) or a media `id`, plus an optional `caption`. Optional `reply_to` quotes one of the contact's messages (a `wamid.` id). Outside the window: 422 `outside_24h_window`; send an approved template instead. The Do Not Call list does not apply, because the contact wrote to you, except when their last message was the opt-out itself (403 `recipient_opted_out` until they write again). Counts as one message of the plan.\n\n**Scheduled sends:** add `\"send_at\": \"2026-11-02T09:00:00+11:00\"` (ISO 8601 with a time zone, 1 minute to 29 days ahead) to a template send (one number or a list). The answer is HTTP 202 with `status: \"scheduled\"` and the broadcast code. Everything is checked at once; the Do Not Call list and the monthly limit are checked again when the time comes. Cancel with `POST /v1/{number}/broadcasts/{code}/cancel`.\n\n**Several recipients:** put a list of numbers in `to`, separated by commas (`\"61412345678,61498765432\"`), or as a JSON array. Each number gets its own message with the same values; duplicates are sent once. The answer then has one entry per number in `results`, and the HTTP status is 200 when all were accepted, 207 when some were. The most numbers per request is the number's broadcast limit (as on the Broadcast page, up to 1000). A list is recorded as a broadcast in the Activity Log under Broadcasts, with its delivered, read and reply counts; name it with the optional `campaign_name` (default \"API: <template name>\"). `broadcast.report_url` in the answer is its report page.\n\n**Different values for each number:** send `recipients` instead of `to`: `[{\"to\": \"61412345678\", \"components\": [...]}, ...]`. Each entry's components replace the shared `template.components` of the same type (a button: the same `index`), so a shared image header can go with each person's own body values. Every number is checked before anything is sent. Recorded as a broadcast, like a list in `to`.\n\n**Media headers:** image, video or document as `link` (app2email downloads it), base64 `data` in the request, or a WhatsApp media `id`. Leave the header component out to send the template's own sample image, video or document. WhatsApp limits: images (JPG/PNG) 5 MB, videos (MP4/3GP) 16 MB, documents 100 MB. Requests can be up to 140 MB (a 100 MB file as base64).\n\n**Test without sending:** add `\"dry_run\": true`. Everything is checked as for a real send (template values, numbers, Do Not Call list, monthly limit, media links and files downloaded and checked); the answer shows the exact WhatsApp message per number. Nothing is sent, logged or counted.\n\n**Big lists in the background:** add `\"background\": true`. After the checks (and any media upload) the call answers HTTP 202 with `broadcast.status_url`, and the messages are sent after. Follow the progress with `GET /v1/{number}/broadcasts/{code}` or the `broadcast.completed` webhook event.\n\n**Buttons and lists:** `\"type\": \"interactive\"` sends reply buttons (up to 3), a list (up to 10 rows) or a URL button, within the 24 hour window like a text. The contact's tap arrives as a `message.received` event with `button.payload`.\n\n**Contacts without a phone number:** WhatsApp is moving to usernames with business-scoped user ids (BSUIDs, like `61.AbC123`): a `message.received` event or `GET /messages` may carry `from_user_id` and no number. Put the id in `to` (or `recipient`); everything that takes a contact (conversations, contacts, owner) takes a BSUID too. One-tap and copy-code authentication templates still need a phone number.\n\n**Segments:** `\"segment\": \"<id or name>\"` instead of `to` sends a template to the contacts of a saved segment (`/contacts`, `/segments`). A named template parameter without a value is filled from each contact's `custom_fields` (`name` from the contact's name).\n\n**Conversation owner (handoff):** `PUT /v1/{number}/conversations/{contact}/owner` with `human`, `agent`, `paused` or `\"\"` says who handles a contact. With `human` or `paused`, app2email's auto reply and the A2A / OpenClaw agent leave the contact alone; the `conversation.owner_changed` event tells everyone else. `GET /conversations/{contact}` has `window_state`, `window_closes_at` and the owner.\n\n**Sandbox keys:** a key with the sandbox flag (API key page) does every check for real and sends nothing: the answer has `\"sandbox\": true` and ids starting `wamid.SANDBOX.`, and `message.status` events sent, delivered and read follow within seconds, so an automation can be tested end to end.\n\n**Caps and approvals:** a key can have a daily cap (429 `daily_cap_reached`) and an approval gate: a send to more contacts than `approval_above` is held (202 `pending_approval` with `approval.url`) until a person approves it on the dashboard or another key calls `POST /approvals/{id}/approve`; `message.held_for_approval` and `approval.resolved` events report it. The number's own monthly cap is a setting (`caps.monthly_messages`, 429 `monthly_cap_reached`).\n\n**What WhatsApp charges:** `meta_pricing` in `GET /usage` (and `GET /usage/meta` per day) counts the billing month's messages by Meta's pricing category - the 1,000 free service messages per month, billable service, utility, marketing, authentication - with an indicative cost estimate. Meta bills you directly.\n\n**Stored inbound media:** WhatsApp's media ids for received files expire after 7 days, so app2email keeps a copy: `GET /v1/{number}/media/{message_id}` serves it (also `media_url` in `GET /messages`).\n\n**Safe retries:** send an `Idempotency-Key` header (a unique value per message or list, eg a UUID or your order number). The same request with the same key within 24 hours is not sent again: it gets the first answer, with the header `Idempotent-Replayed: true`. Same key, different body: 422 `idempotency_key_reused`. First request still sending: 409 `idempotency_request_in_progress`. First request did not finish within 15 minutes: 409 `idempotency_request_interrupted`; some messages may have gone out, so check before sending with a new key. A request refused before anything was sent leaves the key free. Dry runs ignore the key.\n\n**Status:** `GET /v1/{number}/messages/{message_id}` (any message sent from the number: status, times, error, reply), `GET /v1/{number}/broadcasts` and `GET /v1/{number}/broadcasts/{code}` (counts and the result per number, live while sending), `GET /v1/{number}/broadcasts/{code}/results.csv` (the result per message as CSV), `GET /v1/{number}/usage` (plan, messages used and left this month, the most numbers per request), `GET /v1/{number}/usage/history` (per month), `GET /v1/{number}/stats?from=&to=` (sent, delivered, read, failed and replied counts and rates for a period).\n\n**Reading messages:** `GET /v1/{number}/messages` lists messages sent and received, newest first, filtered by `since`, `until`, `direction` (in/out), `status`, `to`, `broadcast`; `GET /v1/{number}/conversations` lists the contacts, and `GET /v1/{number}/conversations/{phone}/messages` one contact's messages. Times are ISO 8601. Pages: pass the `next_cursor` of the answer as `cursor`.\n\n**Do Not Call list:** `GET /v1/{number}/donotcall` (or `?number=` to check one), `POST` to add, `DELETE /v1/{number}/donotcall/{phone}` to remove. The same list as in the dashboard; marketing templates are not sent to these numbers.\n\n**Webhooks:** `POST /v1/{number}/webhooks` with a public https `url`. Every webhook gets every event; the event's `type` (also in the `X-App2email-Event` header) says which it is, so handle the types you need and answer 2xx to the rest. Every event with its payload: https://www.app2email.com/docs/api/webhooks. Each event is a POST of JSON `{id, type, created, number, data}` (see the WebhookEvent schema) with the headers `X-App2email-Event`, `X-App2email-Delivery`, `X-App2email-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the webhook's secret>` (two `v1=` while an old secret is still kept: accept either) and `X-Hub-Signature-256: sha256=<hex HMAC-SHA256 of the raw body with the webhook's secret>` (the way Meta signs WhatsApp webhooks; no time in it, current secret only). Answer 2xx within 10 seconds; otherwise it is sent again after 10 s, 1 min, 5 min, 30 min, 1, 2, 4, 8 and 16 hours (the planned tries survive a restart). Events can arrive out of order. Up to 5 webhooks per number. After many failed deliveries in a row the webhook is switched off (`active: false`) until you turn it on again with `PATCH`. Change a webhook with `PATCH /v1/{number}/webhooks/{id}` (url, active, headers, format), replace its signing secret with `POST .../webhooks/{id}/rotate-secret` (`{\"keep_old_for_hours\": 24}` keeps the old one signing too until `previous_secret_until`), and look at the last 7 days of deliveries with `GET .../webhooks/{id}/deliveries` (`?status=failed`); `POST .../deliveries/{event_id}/redeliver` sends one again. `POST .../webhooks/{id}/test` sends a test event: no body for a `ping`, `{\"type\": \"message.received\"}` for that event's sample, or `{\"event\": {...}}` for your own (sent once, with `\"test\": true` and the header `X-App2email-Test: true`; 30 an hour). `GET .../webhooks/samples` has a sample of every event. `POST .../webhooks/test-url` tests any https URL; `POST .../webhooks/catchers` gives a temporary URL that keeps what it receives. A webhook can have custom `headers` and a `format` (`app2email` or `meta`: WhatsApp's events as Meta's own body). Webhooks can also be added, tested and checked without code on https://www.app2email.com/dashboard/apikey (Webhooks).\n\n**Templates and media:** `GET /v1/{number}/templates/{name}` shows every language of one template with its status and rejection reason. `POST /v1/{number}/templates` creates a template and submits it to WhatsApp for review (201, status PENDING; the `template.status_changed` event tells the result). `DELETE /v1/{number}/templates/{name}` deletes it. `POST /v1/{number}/media` uploads a file once and returns a `media_id` to use in many sends (kept by WhatsApp 30 days).\n\n**Settings and opt-ins:** `GET` and `PUT /v1/{number}/settings/autoreply` (the Default first reply a new contact gets), `GET` and `PUT /v1/{number}/settings/forwarding` (the Default addresses that get the messages by email; Auto Reply cards and Email Rules set on the dashboard by date, day, time or keyword are checked before Default), `GET` and `PUT /v1/{number}/settings/optin` (when on, marketing templates go only to numbers with an opt-in record). Opt-ins are your own proof of consent: `POST /v1/{number}/optins`, `GET /v1/{number}/optins`, `DELETE /v1/{number}/optins/{phone}`.\n\n**Appointment bookings:** customers book appointments inside WhatsApp (a WhatsApp Flow the dashboard's Bookings section designs and publishes); the business's calendar (Google, Microsoft, iCloud / CalDAV, an ICS link, or app2email's built-in one), or a booking service (Cal.com, Calendly, Acuity Scheduling, Square Appointments, Microsoft Bookings, SimplyBook.me, Setmore, Zoho Bookings) decides what is free. `GET /v1/{number}/bookings` lists the appointments (filter by day, status, contact), `GET /v1/{number}/bookings/availability?service_id=` the free slots per day, `POST /v1/{number}/bookings` books one for a customer (they get the confirmation on WhatsApp), `POST .../bookings/{id}/cancel` cancels, `POST .../bookings/{id}/status` marks it completed or a no-show, `GET .../bookings/reports?days=30` gives the numbers. `GET` and `PUT /v1/{number}/settings/booking` read and change the settings (services, hours, messages, calendar, staff; a partial PUT merges by section). `GET /v1/{number}/flows` marks the number's Bookings Flows with their `key` and `can_send`, and `POST /v1/{number}/flows/{key}/send` sends one to a contact inside their 24 hour window. Scope `bookings:manage` (the reads also with `messages:read`); the events `booking.created`, `booking.cancelled`, `booking.rescheduled`, `booking.rated` and `flow.completed` report what customers do.\n\n**Account:** `GET /v1/{number}/me` (the key, its scopes and the limits that apply).\n\n**Tip:** `GET /v1/{number}/templates` returns every template with a complete `example_request` you can send as-is after changing the values.\n\n**Errors** are JSON with a stable `error.code`, a `message`, `how_to_fix`, and where useful `details` and a correct `example_request`. Quote `request_id` when contacting support@app2email.com.\n\nSent messages appear in the app2email Activity Log (WhatsApp sent) with delivered/read status, and in the conversation history; a list of numbers also under Broadcasts. They count towards the plan's monthly message limit, which covers outgoing WhatsApp messages and outgoing emails added together (incoming messages do not count). Marketing templates are not sent to numbers on the account's Do Not Call list.",
    "contact": {
      "name": "app2email support",
      "email": "support@app2email.com",
      "url": "https://www.app2email.com"
    }
  },
  "servers": [
    {
      "url": "https://api.app2email.com"
    }
  ],
  "tags": [
    {
      "name": "Messages",
      "description": "Send WhatsApp messages (templates and free-form replies), read them and look up their status."
    },
    {
      "name": "Media",
      "description": "Upload files for sends; download the files contacts sent."
    },
    {
      "name": "Conversations",
      "description": "One thread per contact: the 24 hour window, its messages and its owner (handoff)."
    },
    {
      "name": "Templates",
      "description": "Your WhatsApp templates: list, create, look up, delete."
    },
    {
      "name": "Flows",
      "description": "WhatsApp Flows: forms and screens inside WhatsApp. Shared by every number of the WhatsApp Business Account."
    },
    {
      "name": "Bookings",
      "description": "Appointment bookings made on WhatsApp Flows: the appointments, the free slots, the booking settings, and sending the number's Flows."
    },
    {
      "name": "Broadcasts",
      "description": "Lists of numbers (API or Broadcast page): status, the result per number, scheduling and cancelling."
    },
    {
      "name": "Contacts",
      "description": "Contacts with tags, custom fields and consent records, and segments (saved filters) to send to."
    },
    {
      "name": "Opt-ins",
      "description": "Records that people agreed to your messages, and the rule that requires them for marketing."
    },
    {
      "name": "Do Not Call",
      "description": "Numbers marketing templates are not sent to."
    },
    {
      "name": "Approvals",
      "description": "Sends held by a key's approval gate, waiting for a person."
    },
    {
      "name": "Number",
      "description": "The number at WhatsApp: health, business profile, display name, username, QR codes, conversation starters, commerce."
    },
    {
      "name": "Settings",
      "description": "Auto reply, email forwarding, and the number's settings (email behaviour, caps, compliance)."
    },
    {
      "name": "Webhooks",
      "description": "Events sent to your URL: https://www.app2email.com/docs/api/webhooks"
    },
    {
      "name": "Analytics",
      "description": "WhatsApp's own figures: cost and volume, sent and delivered, the account's activity log, conversion events."
    },
    {
      "name": "Calling",
      "description": "WhatsApp voice calls through your own WebRTC or SIP stack: settings, call actions, call permissions."
    },
    {
      "name": "Account",
      "description": "The key, plan, usage, statistics and the request log."
    },
    {
      "name": "Account management",
      "description": "All numbers of an account: agent sign-up, status, number keys, plans, payment links, usage, account keys. Account key (a2e_acct_...) or the management_key of create_account."
    },
    {
      "name": "Partner",
      "description": "Resellers: the partner account, clients, their numbers and number keys, onboarding links, usage, payments, partner webhooks. Partner key (a2e_ptnr_...) from /reseller/api-keys."
    },
    {
      "name": "Calendar",
      "description": "The business calendar: appointments, blocked time, internal notes, links to the online booking page and held times. Services, staff and the next free times for agents."
    },
    {
      "name": "Payments",
      "description": "Payments for appointments through the business's own Stripe or PayPal account, one-off payment requests, refunds, prepaid packages, the customer profile (with GDPR-style erase) and meeting polls."
    }
  ],
  "security": [
    {
      "ApiKeyHeader": []
    },
    {
      "BearerAuth": []
    }
  ],
  "paths": {
    "/v1/{number}/messages": {
      "get": {
        "tags": [
          "Messages"
        ],
        "operationId": "listMessages",
        "summary": "Messages sent and received, newest first",
        "description": "Messages sent from the number (`direction` out, with their status and times) and received from contacts (`direction` in). Filters: a time window, the direction, the status of sent messages, one contact, or one broadcast. Page with `next_cursor`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "Only messages at or after this time. ISO 8601, eg 2026-10-25T10:00:00Z.",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-10-25T10:00:00Z"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "description": "Only messages before this time. ISO 8601.",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-10-26T00:00:00Z"
            }
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "description": "in: received. out: sent. Left out: both.",
            "schema": {
              "type": "string",
              "enum": [
                "in",
                "out"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Sent messages only: queued, accepted, sent, delivered, read or failed. Not with direction=in.",
            "schema": {
              "type": "string",
              "enum": [
                "queued",
                "accepted",
                "sent",
                "delivered",
                "read",
                "failed"
              ]
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "Only with this contact (full number, digits, with country code).",
            "schema": {
              "type": "string",
              "example": "61412345678"
            }
          },
          {
            "name": "broadcast",
            "in": "query",
            "required": false,
            "description": "Only the messages of this broadcast (its code).",
            "schema": {
              "type": "string",
              "example": "k3XbQ9rTzP2mWv7a1c9e"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many (1 to 200, default 50).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The next_cursor of the previous answer, unchanged. Leave out for the first page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The messages.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessagesListResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "h5vnq",
                  "messages": [
                    {
                      "direction": "in",
                      "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA=",
                      "from": "61412345678",
                      "name": "John",
                      "text": "Yes, Friday works",
                      "media": null,
                      "time": "2026-10-26T01:20:44Z",
                      "conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_..."
                    },
                    {
                      "direction": "out",
                      "message_id": "wamid.HBgLNjE0OTg3NjU0MzIVAgARGBJTQU1QTEVfT1VUQk9VTkQwMgA=",
                      "to": "61498765432",
                      "status": "read",
                      "sent_by": "api",
                      "text": "Hi Mary, your order #1235 has shipped.",
                      "time": "2026-10-26T01:12:09Z",
                      "times": {
                        "submitted": "2026-10-26T01:12:08Z",
                        "accepted": "2026-10-26T01:12:09Z",
                        "sent": "2026-10-26T01:12:10Z",
                        "delivered": "2026-10-26T01:12:11Z",
                        "read": "2026-10-26T01:15:02Z"
                      }
                    }
                  ],
                  "next_cursor": "MjAyNi0xMC0yNlQwMToxMjowOVp8NDI",
                  "count": 2
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "broadcast_not_found",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_direction",
          "invalid_limit",
          "invalid_number_in_url",
          "invalid_phone",
          "invalid_status",
          "invalid_time",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "list_messages",
        "x-a2e-needs": null
      },
      "post": {
        "tags": [
          "Messages"
        ],
        "operationId": "sendTemplateMessage",
        "summary": "Send a WhatsApp message: template, or free-form reply",
        "description": "Sends one approved template to one recipient, or to several when `to` lists several numbers (or `recipients` gives each number its own values). The parameters are checked against the template before sending; on a mismatch the error includes a complete, correct `example_request` for that template. Nothing is sent when the request itself is invalid. `dry_run` checks without sending; `background` answers 202 and sends after; `send_at` schedules it (202, status scheduled). `type` text, image, video, document or interactive sends a free-form message to one contact within 24 hours of the contact's last message (422 outside_24h_window otherwise). `segment` sends a template to a saved segment's contacts. A business-scoped user id works wherever a number does. Also `audio`, `sticker`, `location`, `contacts`, `reaction` and the newer interactive kinds; template carousels, limited-time offers, catalog, MPM, SPM, flow and OTP buttons. `callback_data` comes back in message.status. MARKETING templates follow `marketing_api` / messages.marketing_route (`sent_via` in the answer).",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A unique value for this message or list (eg a UUID). The same request with the same key within 24 hours gets the first answer again, and nothing is sent twice. Ignored by dry runs.",
            "schema": {
              "type": "string",
              "maxLength": 255,
              "example": "order-1234-shipped"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendTemplateRequest"
              },
              "examples": {
                "text_parameters": {
                  "summary": "Body with two text values",
                  "value": {
                    "to": "61412345678",
                    "type": "template",
                    "template": {
                      "name": "order_update",
                      "language": {
                        "code": "en"
                      },
                      "components": [
                        {
                          "type": "body",
                          "parameters": [
                            {
                              "type": "text",
                              "text": "John"
                            },
                            {
                              "type": "text",
                              "text": "#1234"
                            }
                          ]
                        }
                      ]
                    }
                  }
                },
                "image_header_link": {
                  "summary": "Image header from a link, plus a URL button value",
                  "value": {
                    "to": "61412345678",
                    "type": "template",
                    "template": {
                      "name": "new_arrivals",
                      "language": {
                        "code": "en"
                      },
                      "components": [
                        {
                          "type": "header",
                          "parameters": [
                            {
                              "type": "image",
                              "image": {
                                "link": "https://example.com/photo.jpg"
                              }
                            }
                          ]
                        },
                        {
                          "type": "body",
                          "parameters": [
                            {
                              "type": "text",
                              "text": "John"
                            }
                          ]
                        },
                        {
                          "type": "button",
                          "sub_type": "url",
                          "index": "0",
                          "parameters": [
                            {
                              "type": "text",
                              "text": "summer-sale"
                            }
                          ]
                        }
                      ]
                    }
                  }
                },
                "document_header_base64": {
                  "summary": "PDF header sent as base64 in the request",
                  "value": {
                    "to": "61412345678",
                    "type": "template",
                    "template": {
                      "name": "invoice_ready",
                      "language": {
                        "code": "en"
                      },
                      "components": [
                        {
                          "type": "header",
                          "parameters": [
                            {
                              "type": "document",
                              "document": {
                                "data": "JVBERi0xLjQKJ...",
                                "filename": "invoice-1234.pdf"
                              }
                            }
                          ]
                        },
                        {
                          "type": "body",
                          "parameters": [
                            {
                              "type": "text",
                              "text": "#1234"
                            }
                          ]
                        }
                      ]
                    }
                  }
                },
                "named_parameters": {
                  "summary": "Template with named placeholders",
                  "value": {
                    "to": "61412345678",
                    "type": "template",
                    "template": {
                      "name": "welcome",
                      "language": {
                        "code": "en_US"
                      },
                      "components": [
                        {
                          "type": "body",
                          "parameters": [
                            {
                              "type": "text",
                              "parameter_name": "first_name",
                              "text": "John"
                            },
                            {
                              "type": "text",
                              "parameter_name": "code",
                              "text": "X7Q2"
                            }
                          ]
                        }
                      ]
                    }
                  }
                },
                "several_numbers": {
                  "summary": "Same message to several numbers",
                  "value": {
                    "to": "61412345678,61498765432,61400111222",
                    "type": "template",
                    "campaign_name": "Order updates 21 Oct",
                    "template": {
                      "name": "order_update",
                      "language": {
                        "code": "en"
                      },
                      "components": [
                        {
                          "type": "body",
                          "parameters": [
                            {
                              "type": "text",
                              "text": "John"
                            },
                            {
                              "type": "text",
                              "text": "#1234"
                            }
                          ]
                        }
                      ]
                    }
                  }
                },
                "values_per_number": {
                  "summary": "Each number with its own values (recipients)",
                  "value": {
                    "type": "template",
                    "campaign_name": "Order updates",
                    "template": {
                      "name": "order_update",
                      "language": {
                        "code": "en"
                      },
                      "components": [
                        {
                          "type": "header",
                          "parameters": [
                            {
                              "type": "image",
                              "image": {
                                "link": "https://example.com/photo.jpg"
                              }
                            }
                          ]
                        }
                      ]
                    },
                    "recipients": [
                      {
                        "to": "61412345678",
                        "components": [
                          {
                            "type": "body",
                            "parameters": [
                              {
                                "type": "text",
                                "text": "John"
                              },
                              {
                                "type": "text",
                                "text": "#1234"
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "to": "61498765432",
                        "components": [
                          {
                            "type": "body",
                            "parameters": [
                              {
                                "type": "text",
                                "text": "Mary"
                              },
                              {
                                "type": "text",
                                "text": "#1235"
                              }
                            ]
                          }
                        ]
                      }
                    ]
                  }
                },
                "dry_run": {
                  "summary": "Check everything without sending",
                  "value": {
                    "to": "61412345678",
                    "type": "template",
                    "template": {
                      "name": "order_update",
                      "language": {
                        "code": "en"
                      },
                      "components": [
                        {
                          "type": "body",
                          "parameters": [
                            {
                              "type": "text",
                              "text": "John"
                            },
                            {
                              "type": "text",
                              "text": "#1234"
                            }
                          ]
                        }
                      ]
                    },
                    "dry_run": true
                  }
                },
                "background": {
                  "summary": "Big list: answer now, send after",
                  "value": {
                    "to": "61412345678,61498765432,61400111222",
                    "type": "template",
                    "campaign_name": "October newsletter",
                    "background": true,
                    "template": {
                      "name": "october_newsletter",
                      "language": {
                        "code": "en"
                      }
                    }
                  }
                },
                "free_text_reply": {
                  "summary": "Free-form text reply (within 24 hours)",
                  "value": {
                    "to": "61412345678",
                    "type": "text",
                    "text": {
                      "body": "Thanks, it arrives on Friday.",
                      "preview_url": false
                    }
                  }
                },
                "free_image_reply": {
                  "summary": "Free-form image from a link, with a caption",
                  "value": {
                    "to": "61412345678",
                    "type": "image",
                    "image": {
                      "link": "https://example.com/photo.jpg",
                      "caption": "Your parcel"
                    }
                  }
                },
                "free_document_reply": {
                  "summary": "Free-form PDF as base64, quoting a message",
                  "value": {
                    "to": "61412345678",
                    "type": "document",
                    "reply_to": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA=",
                    "document": {
                      "data": "JVBERi0xLjQKJ...",
                      "filename": "invoice-1234.pdf",
                      "caption": "Invoice #1234"
                    }
                  }
                },
                "scheduled": {
                  "summary": "Several numbers, sent at a set time",
                  "value": {
                    "to": "61412345678,61498765432,61400111222",
                    "type": "template",
                    "campaign_name": "Order updates 2 Nov",
                    "template": {
                      "name": "order_update",
                      "language": {
                        "code": "en"
                      },
                      "components": [
                        {
                          "type": "body",
                          "parameters": [
                            {
                              "type": "text",
                              "text": "John"
                            },
                            {
                              "type": "text",
                              "text": "#1234"
                            }
                          ]
                        }
                      ]
                    },
                    "send_at": "2026-11-02T09:00:00+11:00"
                  }
                },
                "interactive_buttons": {
                  "summary": "Reply buttons (within 24 hours)",
                  "value": {
                    "to": "61412345678",
                    "type": "interactive",
                    "interactive": {
                      "type": "button",
                      "body": {
                        "text": "Confirm your booking for Friday 10:00?"
                      },
                      "action": {
                        "buttons": [
                          {
                            "type": "reply",
                            "reply": {
                              "id": "yes",
                              "title": "Confirm"
                            }
                          },
                          {
                            "type": "reply",
                            "reply": {
                              "id": "no",
                              "title": "Change"
                            }
                          }
                        ]
                      }
                    }
                  }
                },
                "interactive_list": {
                  "summary": "A list to pick from (within 24 hours)",
                  "value": {
                    "to": "61412345678",
                    "type": "interactive",
                    "interactive": {
                      "type": "list",
                      "body": {
                        "text": "Which time suits you?"
                      },
                      "action": {
                        "button": "Pick a time",
                        "sections": [
                          {
                            "title": "Friday",
                            "rows": [
                              {
                                "id": "fri10",
                                "title": "10:00"
                              },
                              {
                                "id": "fri14",
                                "title": "14:00",
                                "description": "afternoon"
                              }
                            ]
                          }
                        ]
                      }
                    }
                  }
                },
                "business_scoped_user_id": {
                  "summary": "A contact known by a business-scoped user id",
                  "value": {
                    "recipient": "61.AbC123xyz",
                    "type": "text",
                    "text": {
                      "body": "Thanks, it arrives on Friday."
                    }
                  }
                },
                "segment": {
                  "summary": "A template to a saved segment, values from each contact",
                  "value": {
                    "segment": "VIP, consented",
                    "type": "template",
                    "campaign_name": "November offer",
                    "template": {
                      "name": "november_offer",
                      "language": {
                        "code": "en"
                      },
                      "components": [
                        {
                          "type": "body",
                          "parameters": [
                            {
                              "type": "text",
                              "parameter_name": "first_name"
                            }
                          ]
                        }
                      ]
                    }
                  }
                },
                "type_text": {
                  "summary": "Text",
                  "value": {
                    "to": "61412345678",
                    "type": "text",
                    "text": {
                      "body": "Your order has shipped.",
                      "preview_url": false
                    }
                  }
                },
                "type_image": {
                  "summary": "Image",
                  "value": {
                    "to": "61412345678",
                    "type": "image",
                    "image": {
                      "link": "https://example.com/photo.jpg",
                      "caption": "Your parcel"
                    }
                  }
                },
                "type_video": {
                  "summary": "Video",
                  "value": {
                    "to": "61412345678",
                    "type": "video",
                    "video": {
                      "link": "https://example.com/howto.mp4",
                      "caption": "How to set it up"
                    }
                  }
                },
                "type_document": {
                  "summary": "Document",
                  "value": {
                    "to": "61412345678",
                    "type": "document",
                    "document": {
                      "link": "https://example.com/invoice-1234.pdf",
                      "filename": "invoice-1234.pdf",
                      "caption": "Invoice"
                    }
                  }
                },
                "type_audio": {
                  "summary": "Audio and voice message",
                  "value": {
                    "to": "61412345678",
                    "type": "audio",
                    "audio": {
                      "id": "1013859600285441",
                      "voice": true
                    }
                  }
                },
                "type_sticker": {
                  "summary": "Sticker",
                  "value": {
                    "to": "61412345678",
                    "type": "sticker",
                    "sticker": {
                      "link": "https://example.com/stickers/thanks.webp"
                    }
                  }
                },
                "type_location": {
                  "summary": "Location",
                  "value": {
                    "to": "61412345678",
                    "type": "location",
                    "location": {
                      "latitude": -33.8568,
                      "longitude": 151.2153,
                      "name": "Sydney Opera House",
                      "address": "Bennelong Point, Sydney NSW 2000"
                    }
                  }
                },
                "type_contacts": {
                  "summary": "Contact card",
                  "value": {
                    "to": "61412345678",
                    "type": "contacts",
                    "contacts": [
                      {
                        "name": {
                          "formatted_name": "Jane Citizen",
                          "first_name": "Jane",
                          "last_name": "Citizen"
                        },
                        "phones": [
                          {
                            "phone": "+61 412 345 678",
                            "type": "CELL",
                            "wa_id": "61412345678"
                          }
                        ],
                        "emails": [
                          {
                            "email": "jane@example.com",
                            "type": "WORK"
                          }
                        ],
                        "org": {
                          "company": "Example Pty Ltd"
                        }
                      }
                    ]
                  }
                },
                "type_reaction": {
                  "summary": "Reaction",
                  "value": {
                    "to": "61412345678",
                    "type": "reaction",
                    "reaction": {
                      "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgASGBQzQUZCMTY0MDc2MUYwNzBDNTY5MAA=",
                      "emoji": "👍"
                    }
                  }
                },
                "type_button": {
                  "summary": "Reply buttons",
                  "value": {
                    "to": "61412345678",
                    "type": "interactive",
                    "interactive": {
                      "type": "button",
                      "body": {
                        "text": "Confirm your booking for Friday 10:00?"
                      },
                      "action": {
                        "buttons": [
                          {
                            "type": "reply",
                            "reply": {
                              "id": "yes",
                              "title": "Confirm"
                            }
                          },
                          {
                            "type": "reply",
                            "reply": {
                              "id": "no",
                              "title": "Change"
                            }
                          }
                        ]
                      }
                    }
                  }
                },
                "type_list": {
                  "summary": "List",
                  "value": {
                    "to": "61412345678",
                    "type": "interactive",
                    "interactive": {
                      "type": "list",
                      "body": {
                        "text": "Which time suits you?"
                      },
                      "action": {
                        "button": "Times",
                        "sections": [
                          {
                            "title": "Friday",
                            "rows": [
                              {
                                "id": "fri10",
                                "title": "10:00"
                              },
                              {
                                "id": "fri11",
                                "title": "11:00"
                              }
                            ]
                          }
                        ]
                      }
                    }
                  }
                },
                "type_cta_url": {
                  "summary": "URL button",
                  "value": {
                    "to": "61412345678",
                    "type": "interactive",
                    "interactive": {
                      "type": "cta_url",
                      "body": {
                        "text": "Your invoice is ready."
                      },
                      "action": {
                        "name": "cta_url",
                        "parameters": {
                          "display_text": "Open invoice",
                          "url": "https://example.com/invoice/1234"
                        }
                      }
                    }
                  }
                },
                "type_carousel": {
                  "summary": "Media carousel",
                  "value": {
                    "to": "61412345678",
                    "type": "interactive",
                    "interactive": {
                      "type": "carousel",
                      "body": {
                        "text": "Three of our latest arrivals, each under $25:"
                      },
                      "action": {
                        "cards": [
                          {
                            "card_index": 0,
                            "type": "cta_url",
                            "header": {
                              "type": "image",
                              "image": {
                                "link": "https://example.com/img/echeveria.jpg"
                              }
                            },
                            "body": {
                              "text": "*Blue Echeveria*"
                            },
                            "action": {
                              "name": "cta_url",
                              "parameters": {
                                "display_text": "Buy now",
                                "url": "https://shop.example.com/echeveria"
                              }
                            }
                          },
                          {
                            "card_index": 1,
                            "type": "cta_url",
                            "header": {
                              "type": "image",
                              "image": {
                                "link": "https://example.com/img/haworthia.jpg"
                              }
                            },
                            "body": {
                              "text": "*Zebra Haworthia*"
                            },
                            "action": {
                              "name": "cta_url",
                              "parameters": {
                                "display_text": "Buy now",
                                "url": "https://shop.example.com/haworthia"
                              }
                            }
                          }
                        ]
                      }
                    }
                  }
                },
                "type_product_carousel": {
                  "summary": "Product carousel",
                  "value": {
                    "to": "61412345678",
                    "type": "interactive",
                    "interactive": {
                      "type": "carousel",
                      "body": {
                        "text": "Picked for you this week:"
                      },
                      "action": {
                        "cards": [
                          {
                            "card_index": 0,
                            "type": "product",
                            "action": {
                              "product_retailer_id": "SKU-1234",
                              "catalog_id": "194836987003835"
                            }
                          },
                          {
                            "card_index": 1,
                            "type": "product",
                            "action": {
                              "product_retailer_id": "SKU-5678",
                              "catalog_id": "194836987003835"
                            }
                          }
                        ]
                      }
                    }
                  }
                },
                "type_location_request_message": {
                  "summary": "Location request",
                  "value": {
                    "to": "61412345678",
                    "type": "interactive",
                    "interactive": {
                      "type": "location_request_message",
                      "body": {
                        "text": "Where should we pick you up? Tap to share your location."
                      },
                      "action": {
                        "name": "send_location"
                      }
                    }
                  }
                },
                "type_request_contact_info": {
                  "summary": "Contact info request",
                  "value": {
                    "to": "61412345678",
                    "type": "interactive",
                    "interactive": {
                      "type": "request_contact_info",
                      "body": {
                        "text": "Please share your phone number so we can call you back."
                      },
                      "action": {
                        "name": "request_contact_info"
                      }
                    }
                  }
                },
                "type_flow": {
                  "summary": "Flow",
                  "value": {
                    "to": "61412345678",
                    "type": "interactive",
                    "interactive": {
                      "type": "flow",
                      "header": {
                        "type": "text",
                        "text": "Book a table"
                      },
                      "body": {
                        "text": "Pick a day and time."
                      },
                      "action": {
                        "name": "flow",
                        "parameters": {
                          "flow_message_version": "3",
                          "flow_id": "1234567890123456",
                          "flow_cta": "Book now",
                          "flow_token": "booking-5521",
                          "flow_action": "navigate",
                          "flow_action_payload": {
                            "screen": "WELCOME"
                          }
                        }
                      }
                    }
                  }
                },
                "type_product": {
                  "summary": "Single product",
                  "value": {
                    "to": "61412345678",
                    "type": "interactive",
                    "interactive": {
                      "type": "product",
                      "body": {
                        "text": "The one you asked about:"
                      },
                      "action": {
                        "catalog_id": "194836987003835",
                        "product_retailer_id": "SKU-1234"
                      }
                    }
                  }
                },
                "type_product_list": {
                  "summary": "Product list",
                  "value": {
                    "to": "61412345678",
                    "type": "interactive",
                    "interactive": {
                      "type": "product_list",
                      "header": {
                        "type": "text",
                        "text": "Our picks"
                      },
                      "body": {
                        "text": "Popular this week."
                      },
                      "action": {
                        "catalog_id": "194836987003835",
                        "sections": [
                          {
                            "title": "Succulents",
                            "product_items": [
                              {
                                "product_retailer_id": "SKU-1234"
                              },
                              {
                                "product_retailer_id": "SKU-5678"
                              }
                            ]
                          }
                        ]
                      }
                    }
                  }
                },
                "type_catalog_message": {
                  "summary": "Catalog",
                  "value": {
                    "to": "61412345678",
                    "type": "interactive",
                    "interactive": {
                      "type": "catalog_message",
                      "body": {
                        "text": "Browse our catalog."
                      },
                      "action": {
                        "name": "catalog_message",
                        "parameters": {
                          "thumbnail_product_retailer_id": "SKU-1234"
                        }
                      }
                    }
                  }
                },
                "type_call_permission_request": {
                  "summary": "Call permission request",
                  "value": {
                    "to": "61412345678",
                    "type": "interactive",
                    "interactive": {
                      "type": "call_permission_request",
                      "body": {
                        "text": "May we call you on WhatsApp about your order?"
                      },
                      "action": {
                        "name": "call_permission_request"
                      }
                    }
                  }
                },
                "type_voice_call": {
                  "summary": "Call button",
                  "value": {
                    "to": "61412345678",
                    "type": "interactive",
                    "interactive": {
                      "type": "voice_call",
                      "body": {
                        "text": "Questions? Call us on WhatsApp."
                      },
                      "action": {
                        "name": "voice_call",
                        "parameters": {
                          "display_text": "Call us",
                          "ttl_minutes": 60
                        }
                      }
                    }
                  }
                },
                "type_address_message": {
                  "summary": "Address request",
                  "value": {
                    "to": "919876543210",
                    "type": "interactive",
                    "interactive": {
                      "type": "address_message",
                      "body": {
                        "text": "Where should we deliver?"
                      },
                      "action": {
                        "name": "address_message",
                        "parameters": {
                          "country": "IN"
                        }
                      }
                    }
                  }
                },
                "type_order_details": {
                  "summary": "Order details",
                  "value": {
                    "to": "919876543210",
                    "type": "interactive",
                    "interactive": {
                      "type": "order_details",
                      "body": {
                        "text": "Your order is ready to pay."
                      },
                      "action": {
                        "name": "review_and_pay",
                        "parameters": {
                          "reference_id": "ORDER-1234",
                          "type": "digital-goods",
                          "payment_type": "upi",
                          "payment_configuration": "my-config",
                          "currency": "INR",
                          "total_amount": {
                            "value": 21000,
                            "offset": 100
                          },
                          "order": {
                            "status": "pending",
                            "subtotal": {
                              "value": 21000,
                              "offset": 100
                            },
                            "items": [
                              {
                                "retailer_id": "SKU-1234",
                                "name": "Gift card",
                                "amount": {
                                  "value": 21000,
                                  "offset": 100
                                },
                                "quantity": 1
                              }
                            ]
                          }
                        }
                      }
                    }
                  }
                },
                "type_order_status": {
                  "summary": "Order status",
                  "value": {
                    "to": "919876543210",
                    "type": "interactive",
                    "interactive": {
                      "type": "order_status",
                      "body": {
                        "text": "Your order has shipped."
                      },
                      "action": {
                        "name": "review_order",
                        "parameters": {
                          "reference_id": "ORDER-1234",
                          "order": {
                            "status": "shipped",
                            "description": "Arrives Friday"
                          }
                        }
                      }
                    }
                  }
                },
                "type_template": {
                  "summary": "Template",
                  "value": {
                    "to": "61412345678",
                    "type": "template",
                    "template": {
                      "name": "order_update",
                      "language": {
                        "code": "en"
                      },
                      "components": [
                        {
                          "type": "body",
                          "parameters": [
                            {
                              "type": "text",
                              "text": "Jane"
                            },
                            {
                              "type": "text",
                              "text": "#1234"
                            }
                          ]
                        }
                      ]
                    }
                  }
                },
                "type_template_named": {
                  "summary": "Template, named parameters",
                  "value": {
                    "to": "61412345678",
                    "type": "template",
                    "template": {
                      "name": "order_update_named",
                      "language": {
                        "code": "en"
                      },
                      "components": [
                        {
                          "type": "body",
                          "parameters": [
                            {
                              "type": "text",
                              "parameter_name": "first_name",
                              "text": "Jane"
                            },
                            {
                              "type": "text",
                              "parameter_name": "order_id",
                              "text": "#1234"
                            }
                          ]
                        }
                      ]
                    }
                  }
                },
                "type_template_location": {
                  "summary": "Template, location header",
                  "value": {
                    "to": "61412345678",
                    "type": "template",
                    "template": {
                      "name": "pickup_ready",
                      "language": {
                        "code": "en"
                      },
                      "components": [
                        {
                          "type": "header",
                          "parameters": [
                            {
                              "type": "location",
                              "location": {
                                "latitude": "-33.8568",
                                "longitude": "151.2153",
                                "name": "Our shop",
                                "address": "1 George St, Sydney"
                              }
                            }
                          ]
                        },
                        {
                          "type": "body",
                          "parameters": [
                            {
                              "type": "text",
                              "text": "Jane"
                            }
                          ]
                        }
                      ]
                    }
                  }
                },
                "type_template_carousel": {
                  "summary": "Carousel template",
                  "value": {
                    "to": "61412345678",
                    "type": "template",
                    "template": {
                      "name": "summer_succulents",
                      "language": {
                        "code": "en"
                      },
                      "components": [
                        {
                          "type": "body",
                          "parameters": [
                            {
                              "type": "text",
                              "text": "Jane"
                            }
                          ]
                        },
                        {
                          "type": "carousel",
                          "cards": [
                            {
                              "card_index": 0,
                              "components": [
                                {
                                  "type": "header",
                                  "parameters": [
                                    {
                                      "type": "image",
                                      "image": {
                                        "link": "https://example.com/img/card0.jpg"
                                      }
                                    }
                                  ]
                                },
                                {
                                  "type": "button",
                                  "sub_type": "quick_reply",
                                  "index": "0",
                                  "parameters": [
                                    {
                                      "type": "payload",
                                      "payload": "more-0"
                                    }
                                  ]
                                },
                                {
                                  "type": "button",
                                  "sub_type": "url",
                                  "index": "1",
                                  "parameters": [
                                    {
                                      "type": "text",
                                      "text": "card-0"
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "card_index": 1,
                              "components": [
                                {
                                  "type": "header",
                                  "parameters": [
                                    {
                                      "type": "image",
                                      "image": {
                                        "link": "https://example.com/img/card1.jpg"
                                      }
                                    }
                                  ]
                                },
                                {
                                  "type": "button",
                                  "sub_type": "quick_reply",
                                  "index": "0",
                                  "parameters": [
                                    {
                                      "type": "payload",
                                      "payload": "more-1"
                                    }
                                  ]
                                },
                                {
                                  "type": "button",
                                  "sub_type": "url",
                                  "index": "1",
                                  "parameters": [
                                    {
                                      "type": "text",
                                      "text": "card-1"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                },
                "type_template_product_carousel": {
                  "summary": "Product card carousel template",
                  "value": {
                    "to": "61412345678",
                    "type": "template",
                    "template": {
                      "name": "product_picks",
                      "language": {
                        "code": "en"
                      },
                      "components": [
                        {
                          "type": "carousel",
                          "cards": [
                            {
                              "card_index": 0,
                              "components": [
                                {
                                  "type": "header",
                                  "parameters": [
                                    {
                                      "type": "product",
                                      "product": {
                                        "product_retailer_id": "SKU-1234",
                                        "catalog_id": "194836987003835"
                                      }
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "card_index": 1,
                              "components": [
                                {
                                  "type": "header",
                                  "parameters": [
                                    {
                                      "type": "product",
                                      "product": {
                                        "product_retailer_id": "SKU-5678",
                                        "catalog_id": "194836987003835"
                                      }
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                },
                "type_template_limited_time_offer": {
                  "summary": "Limited-time offer template",
                  "value": {
                    "to": "61412345678",
                    "type": "template",
                    "template": {
                      "name": "flash_sale",
                      "language": {
                        "code": "en"
                      },
                      "components": [
                        {
                          "type": "header",
                          "parameters": [
                            {
                              "type": "image",
                              "image": {
                                "link": "https://example.com/img/sale.jpg"
                              }
                            }
                          ]
                        },
                        {
                          "type": "limited_time_offer",
                          "parameters": [
                            {
                              "type": "limited_time_offer",
                              "limited_time_offer": {
                                "expiration_time_ms": 1767225600000
                              }
                            }
                          ]
                        },
                        {
                          "type": "button",
                          "sub_type": "copy_code",
                          "index": "0",
                          "parameters": [
                            {
                              "type": "coupon_code",
                              "coupon_code": "SAVE20"
                            }
                          ]
                        },
                        {
                          "type": "button",
                          "sub_type": "url",
                          "index": "1",
                          "parameters": [
                            {
                              "type": "text",
                              "text": "summer"
                            }
                          ]
                        }
                      ]
                    }
                  }
                },
                "type_template_copy_code": {
                  "summary": "Coupon code template",
                  "value": {
                    "to": "61412345678",
                    "type": "template",
                    "template": {
                      "name": "welcome_coupon",
                      "language": {
                        "code": "en"
                      },
                      "components": [
                        {
                          "type": "button",
                          "sub_type": "copy_code",
                          "index": "0",
                          "parameters": [
                            {
                              "type": "coupon_code",
                              "coupon_code": "WELCOME10"
                            }
                          ]
                        }
                      ]
                    }
                  }
                },
                "type_template_catalog": {
                  "summary": "Catalog template",
                  "value": {
                    "to": "61412345678",
                    "type": "template",
                    "template": {
                      "name": "browse_catalog",
                      "language": {
                        "code": "en"
                      },
                      "components": [
                        {
                          "type": "button",
                          "sub_type": "catalog",
                          "index": "0",
                          "parameters": [
                            {
                              "type": "action",
                              "action": {
                                "thumbnail_product_retailer_id": "SKU-1234"
                              }
                            }
                          ]
                        }
                      ]
                    }
                  }
                },
                "type_template_mpm": {
                  "summary": "Multi-product template",
                  "value": {
                    "to": "61412345678",
                    "type": "template",
                    "template": {
                      "name": "new_arrivals",
                      "language": {
                        "code": "en"
                      },
                      "components": [
                        {
                          "type": "header",
                          "parameters": [
                            {
                              "type": "text",
                              "text": "Succulents"
                            }
                          ]
                        },
                        {
                          "type": "button",
                          "sub_type": "mpm",
                          "index": "0",
                          "parameters": [
                            {
                              "type": "action",
                              "action": {
                                "thumbnail_product_retailer_id": "SKU-1234",
                                "sections": [
                                  {
                                    "title": "Popular",
                                    "product_items": [
                                      {
                                        "product_retailer_id": "SKU-1234"
                                      },
                                      {
                                        "product_retailer_id": "SKU-5678"
                                      }
                                    ]
                                  }
                                ]
                              }
                            }
                          ]
                        }
                      ]
                    }
                  }
                },
                "type_template_spm": {
                  "summary": "Single-product template",
                  "value": {
                    "to": "61412345678",
                    "type": "template",
                    "template": {
                      "name": "product_of_the_week",
                      "language": {
                        "code": "en"
                      },
                      "components": [
                        {
                          "type": "header",
                          "parameters": [
                            {
                              "type": "product",
                              "product": {
                                "product_retailer_id": "SKU-1234",
                                "catalog_id": "194836987003835"
                              }
                            }
                          ]
                        }
                      ]
                    }
                  }
                },
                "type_template_flow": {
                  "summary": "Flow button template",
                  "value": {
                    "to": "61412345678",
                    "type": "template",
                    "template": {
                      "name": "book_a_table",
                      "language": {
                        "code": "en"
                      },
                      "components": [
                        {
                          "type": "button",
                          "sub_type": "flow",
                          "index": "0",
                          "parameters": [
                            {
                              "type": "action",
                              "action": {
                                "flow_token": "booking-5521",
                                "flow_action_data": {
                                  "party_size": 2
                                }
                              }
                            }
                          ]
                        }
                      ]
                    }
                  }
                },
                "type_template_otp": {
                  "summary": "One-time password template",
                  "value": {
                    "to": "61412345678",
                    "type": "template",
                    "template": {
                      "name": "login_code",
                      "language": {
                        "code": "en"
                      },
                      "components": [
                        {
                          "type": "body",
                          "parameters": [
                            {
                              "type": "text",
                              "text": "482913"
                            }
                          ]
                        },
                        {
                          "type": "button",
                          "sub_type": "url",
                          "index": "0",
                          "parameters": [
                            {
                              "type": "text",
                              "text": "482913"
                            }
                          ]
                        }
                      ]
                    }
                  }
                },
                "type_template_marketing_messages_api": {
                  "summary": "Marketing template via the Marketing Messages API",
                  "value": {
                    "to": "61412345678",
                    "type": "template",
                    "template": {
                      "name": "november_offer",
                      "language": {
                        "code": "en"
                      },
                      "components": [
                        {
                          "type": "body",
                          "parameters": [
                            {
                              "type": "text",
                              "text": "Jane"
                            }
                          ]
                        }
                      ]
                    },
                    "marketing_api": "mm_api",
                    "product_policy": "CLOUD_API_FALLBACK",
                    "message_activity_sharing": true,
                    "callback_data": "campaign-nov"
                  }
                },
                "type_mark_read": {
                  "summary": "Mark as read and typing",
                  "value": {
                    "messaging_product": "whatsapp",
                    "status": "read",
                    "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgASGBQzQUZCMTY0MDc2MUYwNzBDNTY5MAA=",
                    "typing_indicator": {
                      "type": "text"
                    }
                  }
                },
                "meta_exact_body": {
                  "summary": "Meta's own body, unchanged",
                  "value": {
                    "messaging_product": "whatsapp",
                    "recipient_type": "individual",
                    "to": "+61412345678",
                    "type": "text",
                    "text": {
                      "preview_url": false,
                      "body": "Your order has shipped."
                    },
                    "biz_opaque_callback_data": "order-1234"
                  }
                },
                "callback_data": {
                  "summary": "callback_data, back in message.status",
                  "value": {
                    "to": "61412345678",
                    "type": "text",
                    "text": {
                      "body": "Your table is booked for 7 pm."
                    },
                    "callback_data": "booking-5521"
                  }
                },
                "reaction_remove": {
                  "summary": "Remove a reaction",
                  "value": {
                    "to": "61412345678",
                    "type": "reaction",
                    "reaction": {
                      "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgASGBQzQUZCMTY0MDc2MUYwNzBDNTY5MAA=",
                      "emoji": ""
                    }
                  }
                },
                "audio_link": {
                  "summary": "Audio file from a link",
                  "value": {
                    "to": "61412345678",
                    "type": "audio",
                    "audio": {
                      "link": "https://example.com/audio/welcome.mp3"
                    }
                  }
                },
                "carousel_quick_replies": {
                  "summary": "Carousel with quick-reply buttons",
                  "value": {
                    "to": "61412345678",
                    "type": "interactive",
                    "interactive": {
                      "type": "carousel",
                      "body": {
                        "text": "Which one do you like?"
                      },
                      "action": {
                        "cards": [
                          {
                            "card_index": 0,
                            "header": {
                              "type": "image",
                              "image": {
                                "link": "https://example.com/img/plant0.jpg"
                              }
                            },
                            "action": {
                              "buttons": [
                                {
                                  "type": "quick_reply",
                                  "quick_reply": {
                                    "id": "more-0",
                                    "title": "More like this"
                                  }
                                }
                              ]
                            }
                          },
                          {
                            "card_index": 1,
                            "header": {
                              "type": "image",
                              "image": {
                                "link": "https://example.com/img/plant1.jpg"
                              }
                            },
                            "action": {
                              "buttons": [
                                {
                                  "type": "quick_reply",
                                  "quick_reply": {
                                    "id": "more-1",
                                    "title": "More like this"
                                  }
                                }
                              ]
                            }
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted by WhatsApp (all numbers, when several were given). A dry run also answers 200. A free-form message answers 200 too. A sandbox key answers 200 with sandbox: true.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendMessageResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "kxrkf",
                  "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA=",
                  "status": "accepted",
                  "from": "4976659348270",
                  "to": "61412345678",
                  "template": {
                    "name": "order_update",
                    "language": "en",
                    "category": "UTILITY"
                  },
                  "text": "Hi John, your order #1234 has shipped.",
                  "conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_...",
                  "note": "accepted by WhatsApp. delivery and read status appear in your app2email Activity Log (WhatsApp sent).",
                  "contacts": [
                    {
                      "input": "61412345678",
                      "wa_id": "61412345678"
                    }
                  ]
                }
              }
            },
            "headers": {
              "Idempotent-Replayed": {
                "description": "true when this is the stored answer of an earlier request with the same Idempotency-Key.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "202": {
            "description": "\"background\": true - checked, and sending has started (progress: broadcast.status_url). Or \"send_at\" - status scheduled, sent at scheduled_for (cancel with POST /broadcasts/{code}/cancel). Or status pending_approval: held by the key's approval gate until a person approves it (approval.url). The example is the background answer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendMessageResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "t7wpe",
                  "status": "queued",
                  "from": "4976659348270",
                  "template": {
                    "name": "october_newsletter",
                    "language": "en",
                    "category": "MARKETING"
                  },
                  "broadcast": {
                    "name": "October newsletter",
                    "code": "k3XbQ9rTzP2mWv7a1c9e",
                    "report_url": "https://www.app2email.com/dashboard/log/broadcast/k3XbQ9rTzP2mWv7a1c9e",
                    "status_url": "https://api.app2email.com/v1/4976659348270/broadcasts/k3XbQ9rTzP2mWv7a1c9e"
                  },
                  "recipients": 3,
                  "queued": 3,
                  "skipped": 0,
                  "results": [],
                  "note": "Sending in the background. GET broadcast.status_url for progress and the result for each number, or use the broadcast.completed webhook."
                }
              }
            }
          },
          "207": {
            "description": "Several numbers: some were accepted, some not. 'results' has the outcome per number.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendMessageResponse"
                },
                "example": {
                  "success": false,
                  "request_id": "q8m2d",
                  "status": "partially_accepted",
                  "from": "4976659348270",
                  "template": {
                    "name": "order_update",
                    "language": "en",
                    "category": "UTILITY"
                  },
                  "text": "Hi John, your order #1234 has shipped.",
                  "broadcast": {
                    "name": "Order updates 21 Oct",
                    "code": "k3XbQ9rTzP2mWv7a1c9e",
                    "report_url": "https://www.app2email.com/dashboard/log/broadcast/k3XbQ9rTzP2mWv7a1c9e"
                  },
                  "recipients": 3,
                  "accepted": 2,
                  "failed": 1,
                  "results": [
                    {
                      "to": "61412345678",
                      "success": true,
                      "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA=",
                      "status": "accepted",
                      "conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_..."
                    },
                    {
                      "to": "61498765432",
                      "success": true,
                      "message_id": "wamid.HBgLNjE0OTg3NjU0MzIVAgARGBJTQU1QTEVfT1VUQk9VTkQwMgA=",
                      "status": "accepted",
                      "conversation_url": "https://www.app2email.com/conversation/61498765432_4976659348270_..."
                    },
                    {
                      "to": "61400111222",
                      "success": false,
                      "error": {
                        "code": "recipient_unreachable",
                        "message": "WhatsApp did not send the message: ...",
                        "how_to_fix": "WhatsApp could not deliver to this number. Check it is a WhatsApp number written with its country code ..."
                      }
                    }
                  ],
                  "note": "accepted by WhatsApp. delivery and read status appear in your app2email Activity Log under Broadcasts (broadcast.report_url)."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "The request or the media file is too large. Possible error.code values: request_too_large, media_too_large, approval_body_too_large, test_event_too_large, flow_json_too_large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:send",
        "x-a2e-sandbox": "simulated",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "approval_body_too_large",
          "background_start_failed",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "broadcast_cancelled",
          "bsuid_not_supported",
          "call_permission_required",
          "caption_not_supported",
          "caption_too_long",
          "daily_cap_reached",
          "display_name_not_approved",
          "duplicate_recipients",
          "free_form_single_recipient",
          "idempotency_key_reused",
          "idempotency_request_in_progress",
          "idempotency_request_interrupted",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_base64",
          "invalid_callback_data",
          "invalid_components",
          "invalid_contacts_message",
          "invalid_cursor",
          "invalid_idempotency_key",
          "invalid_identity_key_hash",
          "invalid_interactive",
          "invalid_json",
          "invalid_location",
          "invalid_marketing_api",
          "invalid_media_link",
          "invalid_number_in_url",
          "invalid_reaction",
          "invalid_recipients",
          "invalid_reply_to",
          "invalid_send_at",
          "invalid_to",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_download_failed",
          "media_too_large",
          "media_type_not_allowed",
          "media_upload_error",
          "media_upload_failed",
          "message_too_old",
          "messaging_limit_restricted",
          "missing_api_key",
          "missing_interactive",
          "missing_media",
          "missing_message_id",
          "missing_template_language",
          "missing_template_name",
          "missing_text",
          "monthly_cap_reached",
          "monthly_limit_reached",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "reaction_too_old",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_not_opted_in",
          "recipient_opted_out",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "request_too_large",
          "required_parameter_missing",
          "schedule_failed",
          "segment_and_recipients",
          "segment_empty",
          "segment_not_found",
          "send_at_in_past",
          "send_at_too_far",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_language_not_found",
          "template_lookup_failed",
          "template_not_approved",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_parameters_invalid",
          "template_paused",
          "template_sample_media_failed",
          "template_text_too_long",
          "text_too_long",
          "to_and_recipients",
          "too_many_messages_to_recipient",
          "too_many_recipients",
          "unsupported_content_type",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "voice_needs_ogg_opus",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [
          "broadcast.completed",
          "message.failed",
          "message.held_for_approval",
          "message.status",
          "usage.threshold"
        ],
        "x-a2e-mcp-tool": "send_template",
        "x-a2e-mcp-tools": [
          "send_template",
          "send_text",
          "send_media",
          "send_interactive",
          "send_message",
          "send_reaction",
          "send_location"
        ],
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/messages/{message_id}": {
      "get": {
        "tags": [
          "Messages"
        ],
        "operationId": "getMessageStatus",
        "summary": "Status of a sent message",
        "description": "Any message sent from the number (API, Broadcast page, email replies): status, the time of each step, why it failed, and the contact's reply or button tap.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "message_id",
            "in": "path",
            "required": true,
            "description": "The message_id from the send answer (starts with 'wamid.'). URL-encode it.",
            "schema": {
              "type": "string",
              "example": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA="
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageStatusResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "ip_not_allowed",
          "message_not_found",
          "missing_api_key",
          "missing_message_id",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "get_message",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/templates": {
      "get": {
        "tags": [
          "Templates"
        ],
        "operationId": "listTemplates",
        "summary": "List your templates, with an example request for each",
        "description": "All templates of the number's WhatsApp account: status, category, what values each needs, and for approved templates a complete example request.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "The templates.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplatesResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live",
          "template_lookup_failed"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "list_templates",
        "x-a2e-needs": null
      },
      "post": {
        "tags": [
          "Templates"
        ],
        "operationId": "createTemplate",
        "summary": "Create a template and submit it for approval",
        "description": "Needs the 'templates:manage' scope. The template goes to WhatsApp for review (minutes to a day). `template.status_changed` tells the result. Every Meta field is passed on (TTL, link tracking, max price, Template Library). WABA-wide: every number on this WhatsApp Business Account uses the same templates.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplateCreateRequest"
              },
              "examples": {
                "own": {
                  "summary": "Your own text",
                  "value": {
                    "name": "order_update",
                    "language": "en",
                    "category": "UTILITY",
                    "components": [
                      {
                        "type": "BODY",
                        "text": "Hi {{1}}, your order {{2}} has shipped.",
                        "example": {
                          "body_text": [
                            [
                              "John",
                              "#1234"
                            ]
                          ]
                        }
                      }
                    ]
                  }
                },
                "library": {
                  "summary": "From the Template Library",
                  "value": {
                    "name": "my_delivery_update",
                    "language": "en_US",
                    "category": "UTILITY",
                    "library_template_name": "delivery_update_1",
                    "library_template_button_inputs": [
                      {
                        "type": "URL",
                        "url": {
                          "base_url": "https://www.example.com/{{1}}",
                          "url_suffix_example": "https://www.example.com/order/1234"
                        }
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Submitted (status PENDING).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateCreateResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "c3ppl",
                  "template": {
                    "id": "2234567890",
                    "name": "order_update",
                    "language": "en",
                    "category": "UTILITY",
                    "status": "PENDING"
                  },
                  "note": "Submitted to WhatsApp for review (minutes to a day). You get a template.status_changed webhook event with the result, or GET https://api.app2email.com/v1/4976659348270/templates/order_update."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "The request or the media file is too large. Possible error.code values: request_too_large, media_too_large, approval_body_too_large, test_event_too_large, flow_json_too_large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-webhook-events": [
          "template.status_changed"
        ],
        "x-a2e-scope": "templates:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_json",
          "invalid_media_link",
          "invalid_number_in_url",
          "invalid_optimization_spec",
          "invalid_template_category",
          "invalid_template_components",
          "invalid_template_field",
          "invalid_template_language",
          "invalid_template_name",
          "ip_not_allowed",
          "media_too_large",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "sandbox_key",
          "service_not_live",
          "template_already_exists",
          "template_limit_reached",
          "template_name_reserved",
          "template_not_editable",
          "template_rejected",
          "template_sample_media_failed",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit"
        ],
        "x-a2e-mcp-tool": "create_template",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/templates/{name}": {
      "get": {
        "tags": [
          "Templates"
        ],
        "operationId": "getTemplate",
        "summary": "One template: status, rejection reason, what it needs",
        "description": "Every language of the template. Not from a cache: a status that just changed shows. With every field Meta keeps (sub_category, previous_category, TTL, link tracking, library name).",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "The template's name.",
            "schema": {
              "type": "string",
              "example": "order_update"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The template's languages.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateDetailResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "k7qtm",
                  "name": "order_update",
                  "versions": [
                    {
                      "id": "1234567890",
                      "name": "order_update",
                      "language": "en",
                      "category": "UTILITY",
                      "status": "APPROVED",
                      "can_send": true,
                      "needs": {
                        "body": "2 text values"
                      },
                      "example_request": {
                        "to": "61412345678",
                        "type": "template",
                        "template": {
                          "name": "order_update",
                          "language": {
                            "code": "en"
                          },
                          "components": [
                            {
                              "type": "body",
                              "parameters": [
                                {
                                  "type": "text",
                                  "text": "John"
                                },
                                {
                                  "type": "text",
                                  "text": "#1234"
                                }
                              ]
                            }
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live",
          "template_lookup_failed",
          "template_not_found"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "get_template",
        "x-a2e-needs": null
      },
      "delete": {
        "tags": [
          "Templates"
        ],
        "operationId": "deleteTemplate",
        "summary": "Delete a template (every language, or one)",
        "description": "Needs the 'templates:manage' scope. The template app2email uses for its own alerts cannot be deleted here. WABA-wide: every number on this WhatsApp Business Account uses the same templates.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "The template's name.",
            "schema": {
              "type": "string",
              "example": "order_update"
            }
          },
          {
            "name": "language",
            "in": "query",
            "required": false,
            "description": "Only this language. Default: every language.",
            "schema": {
              "type": "string",
              "example": "en"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateDeleteResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "e2mxa",
                  "deleted": "order_update",
                  "languages": [
                    "en"
                  ],
                  "note": "All languages of the template were deleted. The same name and language can be used again after WhatsApp has removed it."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-webhook-events": [
          "template.status_changed"
        ],
        "x-a2e-scope": "templates:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_number_in_url",
          "invalid_template_language",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "sandbox_key",
          "service_not_live",
          "template_delete_failed",
          "template_language_not_found",
          "template_language_required",
          "template_lookup_failed",
          "template_name_reserved",
          "template_not_found",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit"
        ],
        "x-a2e-mcp-tool": "delete_template",
        "x-a2e-needs": null
      },
      "patch": {
        "tags": [
          "Templates"
        ],
        "operationId": "editTemplate",
        "summary": "Edit a template (components, category, TTL, max price)",
        "description": "Needs 'templates:manage'. Only APPROVED, REJECTED or PAUSED templates; an approved one at most once a day, 10 times in 30 days. WABA-wide: every number on this WhatsApp Business Account uses the same templates.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "The template's name.",
            "schema": {
              "type": "string",
              "example": "order_update"
            }
          },
          {
            "name": "language",
            "in": "query",
            "required": false,
            "description": "The template's language (eg en, en_US). Needed when the template has several.",
            "schema": {
              "type": "string",
              "example": "en"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplateEditRequest"
              },
              "examples": {
                "components": {
                  "summary": "New text",
                  "value": {
                    "components": [
                      {
                        "type": "BODY",
                        "text": "Hi {{1}}, your order {{2}} is on its way.",
                        "example": {
                          "body_text": [
                            [
                              "John",
                              "#1234"
                            ]
                          ]
                        }
                      },
                      {
                        "type": "FOOTER",
                        "text": "Reply STOP to opt out"
                      }
                    ]
                  }
                },
                "max_price": {
                  "summary": "Max price of a marketing template",
                  "value": {
                    "optimization_spec": {
                      "bid_amount": 5000,
                      "bid_strategy": "LOWEST_COST_WITH_BID_CAP",
                      "bid_country_multiplier_overrides": {
                        "IN": 1.2
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Changed (components: WhatsApp reviews them again).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateEditResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "t2edt",
                  "template": {
                    "id": "1234567890",
                    "name": "order_update",
                    "language": "en",
                    "previous_status": "APPROVED"
                  },
                  "changed": [
                    "components"
                  ],
                  "note": "WhatsApp reviews the edited template again; the template.status_changed event tells the result. Every number on this WhatsApp Business Account uses the new version."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "The request or the media file is too large. Possible error.code values: request_too_large, media_too_large, approval_body_too_large, test_event_too_large, flow_json_too_large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-webhook-events": [
          "template.status_changed"
        ],
        "x-a2e-scope": "templates:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_json",
          "invalid_media_link",
          "invalid_number_in_url",
          "invalid_optimization_spec",
          "invalid_template_category",
          "invalid_template_components",
          "invalid_template_field",
          "invalid_template_language",
          "ip_not_allowed",
          "media_too_large",
          "missing_api_key",
          "nothing_to_change",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "sandbox_key",
          "service_not_live",
          "template_already_exists",
          "template_category_locked",
          "template_language_not_found",
          "template_language_required",
          "template_limit_reached",
          "template_lookup_failed",
          "template_name_reserved",
          "template_not_editable",
          "template_not_found",
          "template_rejected",
          "template_sample_media_failed",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit"
        ],
        "x-a2e-mcp-tool": "edit_template",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/media": {
      "post": {
        "tags": [
          "Media"
        ],
        "operationId": "uploadMedia",
        "summary": "Upload a file once, get a media id",
        "description": "Uploads an image, video, document, audio file or sticker to WhatsApp and returns a `media_id` for `{\"id\": ...}` in later sends (templates or free-form). WhatsApp keeps it 30 days. JSON (a link or base64 data) or multipart/form-data (`file`, optional `type`). Limits: image JPEG/PNG 5 MB, video MP4/3GP 16 MB, audio 16 MB, sticker WebP 100 KB static / 500 KB animated, document 100 MB. A sandbox key checks the file and uploads nothing.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaUploadRequest"
              },
              "examples": {
                "image_link": {
                  "summary": "An image from a link",
                  "value": {
                    "type": "image",
                    "file": {
                      "link": "https://example.com/photo.jpg"
                    }
                  }
                },
                "sticker_link": {
                  "summary": "A sticker from a link",
                  "value": {
                    "type": "sticker",
                    "file": {
                      "link": "https://example.com/stickers/thanks.webp"
                    }
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/MediaMultipartUpload"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Uploaded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaUploadResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "g4vbq",
                  "media_id": "1234567890",
                  "type": "image",
                  "filename": "photo.jpg",
                  "info": {
                    "mime_type": "image/jpeg",
                    "size_bytes": 248113
                  },
                  "expires_in_days": 30,
                  "note": "Use it as {\"image\": {\"id\": \"1234567890\"}} in a template header or a free-form message. WhatsApp keeps uploaded files for 30 days."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "The request or the media file is too large. Possible error.code values: request_too_large, media_too_large, approval_body_too_large, test_event_too_large, flow_json_too_large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-sandbox": "simulated",
        "x-a2e-scope": "messages:send",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_base64",
          "invalid_json",
          "invalid_media_link",
          "invalid_media_type",
          "invalid_number_in_url",
          "ip_not_allowed",
          "media_download_failed",
          "media_too_large",
          "media_type_not_allowed",
          "media_upload_failed",
          "missing_api_key",
          "missing_file",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live",
          "unsupported_content_type",
          "voice_needs_ogg_opus"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "upload_media",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/broadcasts": {
      "get": {
        "tags": [
          "Broadcasts"
        ],
        "operationId": "listBroadcasts",
        "summary": "Your latest broadcasts",
        "description": "Broadcasts sent through the API (several numbers) and from the Broadcast page, newest first.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many (1 to 100, default 20).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The broadcasts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BroadcastsResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "list_broadcasts",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/broadcasts/{code}": {
      "get": {
        "tags": [
          "Broadcasts"
        ],
        "operationId": "getBroadcast",
        "summary": "A broadcast's status and the result per number",
        "description": "Counts and the result for each number, live while a background send runs.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "code",
            "in": "path",
            "required": true,
            "description": "broadcast.code from the send answer, or from GET /broadcasts.",
            "schema": {
              "type": "string",
              "example": "k3XbQ9rTzP2mWv7a1c9e"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The broadcast.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BroadcastStatusResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "broadcast_not_found",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "get_broadcast",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/broadcasts/{code}/results.csv": {
      "get": {
        "tags": [
          "Broadcasts"
        ],
        "operationId": "getBroadcastCsv",
        "summary": "A broadcast's result for each message, as CSV",
        "description": "One row per message: number, status, message_id, the time of each step, the reply and the error. Opens in a spreadsheet. Values that start with = + - or @ get a ' in front, so a spreadsheet does not run them as formulas.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "code",
            "in": "path",
            "required": true,
            "description": "broadcast.code from the send answer, or from GET /broadcasts.",
            "schema": {
              "type": "string",
              "example": "k3XbQ9rTzP2mWv7a1c9e"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The CSV file (Content-Disposition: attachment).",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "broadcast_not_found",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/broadcasts/{code}/cancel": {
      "post": {
        "tags": [
          "Broadcasts"
        ],
        "operationId": "cancelBroadcast",
        "summary": "Cancel a scheduled or sending API broadcast",
        "description": "Needs the 'messages:send' scope. A scheduled broadcast (send_at) is removed: nothing is sent (200). A broadcast that is sending now (API list, background or scheduled): the messages not yet handed to WhatsApp are not sent, those already sent stay sent (202, status cancelling). Broadcasts started from the dashboard, and finished ones, cannot be cancelled here (409 broadcast_not_cancellable). broadcast.completed is sent with data.status cancelled.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "code",
            "in": "path",
            "required": true,
            "description": "broadcast.code from the send answer.",
            "schema": {
              "type": "string",
              "example": "k3XbQ9rTzP2mWv7a1c9e"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Scheduled broadcast removed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BroadcastCancelResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "u1nqc",
                  "broadcast": {
                    "code": "k3XbQ9rTzP2mWv7a1c9e",
                    "status": "cancelled"
                  },
                  "sent_before_cancel": 0,
                  "note": "It was scheduled and had not started: nothing was sent."
                }
              }
            }
          },
          "202": {
            "description": "Cancelling: the sending stops.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BroadcastCancelResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "u1nqd",
                  "broadcast": {
                    "code": "k3XbQ9rTzP2mWv7a1c9e",
                    "status": "cancelling"
                  },
                  "note": "Cancelling. Messages already handed to WhatsApp stay sent; the rest are not sent. GET https://api.app2email.com/v1/4976659348270/broadcasts/k3XbQ9rTzP2mWv7a1c9e shows the result."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:send",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "broadcast_not_cancellable",
          "broadcast_not_found",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [
          "broadcast.completed"
        ],
        "x-a2e-mcp-tool": "cancel_broadcast",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/me": {
      "get": {
        "tags": [
          "Account"
        ],
        "operationId": "getMe",
        "summary": "Check the key: its scopes, the number, the plan and the limits",
        "description": "Works with any valid key, whatever its scopes. Use it for a 'test connection' step in Zapier, Make, n8n or Power Automate.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "The key and the number.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "a7k3p",
                  "key_valid": true,
                  "api_version": "v1",
                  "number": "4976659348270",
                  "plan": "standard_5000",
                  "service_status": "LIVE",
                  "key": {
                    "name": "Zapier",
                    "scopes": [
                      "messages:read",
                      "messages:send"
                    ],
                    "ip_allow": ""
                  },
                  "limits": {
                    "max_numbers_per_request": 1000,
                    "requests_per_second": 20,
                    "burst": 50,
                    "rate_limit_mode": "log_only",
                    "webhooks_max": 5
                  },
                  "scopes_available": [
                    "messages:send",
                    "messages:read",
                    "dnc:manage",
                    "webhooks:manage",
                    "templates:manage",
                    "settings:manage",
                    "contacts:manage",
                    "calls:manage",
                    "bookings:manage"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "check_key",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/requests": {
      "get": {
        "tags": [
          "Account"
        ],
        "operationId": "listRequests",
        "summary": "The latest logged API requests",
        "description": "Only errors (status 400 and up) and requests that change something (sends, webhook and settings changes) are logged, for 30 days. Each one has its request_id, route, status, time, key and address. No bodies and no keys are stored.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many (1 to 200, default 50).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "error (400 and up), ok (below 400), or an HTTP status such as 422.",
            "schema": {
              "type": "string",
              "example": "error"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The requests, newest first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestsResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "x9d2m",
                  "requests": [
                    {
                      "request_id": "kxrkf",
                      "time": "2026-10-26T01:12:09Z",
                      "method": "POST",
                      "route": "/v1/4976659348270/messages",
                      "status": 422,
                      "ms": 412,
                      "key": "Zapier",
                      "ip": "203.0.113.7"
                    }
                  ],
                  "note": "Only errors and requests that change something are logged. Rows are kept 30 days."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "invalid_status",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "request_log_unavailable",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/requests/{id}": {
      "get": {
        "tags": [
          "Account"
        ],
        "operationId": "getRequest",
        "summary": "One logged request, by its request_id",
        "description": "The request_id of any answer, for example from a failed send.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The request_id from an answer.",
            "schema": {
              "type": "string",
              "example": "kxrkf"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "p3uvn",
                  "request": {
                    "request_id": "kxrkf",
                    "time": "2026-10-26T01:12:09Z",
                    "method": "POST",
                    "route": "/v1/4976659348270/messages",
                    "status": 422,
                    "ms": 412,
                    "key": "Zapier",
                    "ip": "203.0.113.7"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "request_log_unavailable",
          "request_not_found",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/conversations": {
      "get": {
        "tags": [
          "Conversations"
        ],
        "operationId": "listConversations",
        "summary": "The contacts, most recent activity first",
        "description": "One entry per contact, with the last message in each direction and whether a free-form reply can be sent now (window_open).",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "Only contacts active at or after this time. ISO 8601.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many (1 to 200, default 50).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The next_cursor of the previous answer, unchanged. Leave out for the first page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The contacts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationsResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "q2lzd",
                  "conversations": [
                    {
                      "contact": "61412345678",
                      "name": "John",
                      "last_inbound": "2026-10-26T01:20:44Z",
                      "last_outbound": "2026-10-26T01:12:09Z",
                      "window_open": true,
                      "messages": 12,
                      "conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_..."
                    }
                  ],
                  "next_cursor": null,
                  "count": 1
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_limit",
          "invalid_number_in_url",
          "invalid_time",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "list_conversations",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/conversations/{phone}/messages": {
      "get": {
        "tags": [
          "Conversations"
        ],
        "operationId": "listConversationMessages",
        "summary": "One contact's messages, both directions",
        "description": "The messages with one contact, newest first. window_open says whether a free-form reply can be sent now.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "phone",
            "in": "path",
            "required": true,
            "description": "The contact's number, with country code, or their business-scoped user id.",
            "schema": {
              "type": "string",
              "example": "61412345678"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "At or after this time. ISO 8601.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "description": "Before this time. ISO 8601.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many (1 to 200, default 50).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The next_cursor of the previous answer, unchanged. Leave out for the first page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The messages.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationMessagesResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "d8ce1",
                  "contact": "61412345678",
                  "window_open": true,
                  "messages": [
                    {
                      "direction": "in",
                      "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA=",
                      "from": "61412345678",
                      "name": "John",
                      "text": "Yes, Friday works",
                      "media": null,
                      "time": "2026-10-26T01:20:44Z",
                      "conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_..."
                    }
                  ],
                  "next_cursor": null,
                  "count": 1
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_limit",
          "invalid_number_in_url",
          "invalid_phone",
          "invalid_time",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "get_conversation_messages",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/usage/history": {
      "get": {
        "tags": [
          "Account"
        ],
        "operationId": "getUsageHistory",
        "summary": "Messages and broadcasts per month",
        "description": "Per calendar month (UTC), newest first: messages sent, failed, received and broadcasts.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "months",
            "in": "query",
            "required": false,
            "description": "How many months (1 to 24, default 6).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 24,
              "default": 6
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The months.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageHistoryResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "m4ry7",
                  "number": "4976659348270",
                  "months": [
                    {
                      "month": "2026-10",
                      "messages_sent": 412,
                      "messages_failed": 3,
                      "messages_received": 97,
                      "broadcasts": 2
                    },
                    {
                      "month": "2026-09",
                      "messages_sent": 380,
                      "messages_failed": 1,
                      "messages_received": 88,
                      "broadcasts": 1
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_months",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/stats": {
      "get": {
        "tags": [
          "Account"
        ],
        "operationId": "getStats",
        "summary": "Message counts, delivery and read rates for a period",
        "description": "For a time range (default the last 30 days, at most 366 days). The same counts as a broadcast report.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Start of the range. ISO 8601.",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-09-26T00:00:00Z"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "End of the range. ISO 8601.",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-10-26T00:00:00Z"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The counts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatsResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "t6bwe",
                  "from": "2026-09-26T00:00:00Z",
                  "to": "2026-10-26T00:00:00Z",
                  "messages": {
                    "submitted": 120,
                    "accepted": 118,
                    "sent": 117,
                    "delivered": 110,
                    "read": 84,
                    "failed": 2,
                    "replied": 19
                  },
                  "received": 40,
                  "rates": {
                    "delivery": 0.9402,
                    "read": 0.7636,
                    "reply": 0.1624
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "invalid_range",
          "invalid_time",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "range_too_large",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/usage": {
      "get": {
        "tags": [
          "Account"
        ],
        "operationId": "getUsage",
        "summary": "Plan, messages used and left, limits, what WhatsApp charges",
        "description": "WhatsApp messages used and left this billing month, the billing period, the most numbers per send request, your own monthly cap, and `meta_pricing`: the month's messages by Meta's pricing category with an indicative cost.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "Usage.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "get_usage",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/donotcall": {
      "get": {
        "tags": [
          "Do Not Call"
        ],
        "operationId": "listDoNotCall",
        "summary": "The Do Not Call list, or check one number",
        "description": "The whole list, or with ?number= whether that number is on it.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "number",
            "in": "query",
            "required": false,
            "description": "Check only this number (with country code).",
            "schema": {
              "type": "string",
              "example": "61412345678"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DoNotCallListResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "dnc:manage",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "list_donotcall",
        "x-a2e-needs": null
      },
      "post": {
        "tags": [
          "Do Not Call"
        ],
        "operationId": "addDoNotCall",
        "summary": "Add numbers to the Do Not Call list",
        "description": "Up to 1000 numbers, with an optional name and note each. Numbers already on the list are left as they are. All or nothing: one invalid number, nothing is added.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DoNotCallAddRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Added.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DoNotCallAddResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "dnc:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_json",
          "invalid_number_in_url",
          "invalid_numbers",
          "ip_not_allowed",
          "missing_api_key",
          "missing_numbers",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live",
          "too_many_numbers"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "add_donotcall",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/donotcall/{phone}": {
      "delete": {
        "tags": [
          "Do Not Call"
        ],
        "operationId": "removeDoNotCall",
        "summary": "Remove a number from the Do Not Call list",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "phone",
            "in": "path",
            "required": true,
            "description": "The number to remove, with country code.",
            "schema": {
              "type": "string",
              "example": "61412345678"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Done ('removed' false: it was not on the list).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DoNotCallRemoveResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "dnc:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "remove_donotcall",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/settings/autoreply": {
      "get": {
        "tags": [
          "Settings"
        ],
        "operationId": "getAutoreply",
        "summary": "The auto reply to new contacts",
        "description": "Needs the 'settings:manage' scope. The text of the first reply a new contact gets (the dashboard's Auto reply page).",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "The text.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutoreplyResponse"
                },
                "example": {
                  "text": "Thanks for writing! We reply within a day."
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "settings:manage",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      },
      "put": {
        "tags": [
          "Settings"
        ],
        "operationId": "setAutoreply",
        "summary": "Change the auto reply text",
        "description": "Text only: the image and attachment of the auto reply are set on the dashboard. 1 to 4000 characters.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutoreplySettings"
              },
              "example": {
                "text": "Thanks for writing! We reply within a day."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutoreplyResponse"
                },
                "example": {
                  "text": "Thanks for writing! We reply within a day."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "settings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_json",
          "invalid_number_in_url",
          "invalid_text",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "sandbox_key",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/settings/forwarding": {
      "get": {
        "tags": [
          "Settings"
        ],
        "operationId": "getForwarding",
        "summary": "Who gets the messages by email",
        "description": "Needs the 'settings:manage' scope. The email addresses that get each WhatsApp message (the dashboard's Forward email page).",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "The forwarding settings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForwardingResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "f9hsi",
                  "forwarding": {
                    "to": [
                      "a@x.com"
                    ],
                    "cc": [],
                    "bcc": [],
                    "text": "New WhatsApp message",
                    "works_on_this_plan": true,
                    "plan": "standard_5000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "settings:manage",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      },
      "put": {
        "tags": [
          "Settings"
        ],
        "operationId": "setForwarding",
        "summary": "Change who gets the messages by email",
        "description": "Fields left out stay as they are. Up to 3 valid emails each for to, cc and bcc. WhatsApp-to-email forwarding works on the Professional and Trial plans (works_on_this_plan says whether it does for this number).",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ForwardingSettings"
              },
              "example": {
                "to": [
                  "a@x.com"
                ],
                "cc": [],
                "bcc": [],
                "text": "New WhatsApp message"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForwardingResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "f9hsi",
                  "forwarding": {
                    "to": [
                      "a@x.com"
                    ],
                    "cc": [],
                    "bcc": [],
                    "text": "New WhatsApp message",
                    "works_on_this_plan": true,
                    "plan": "standard_5000"
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "settings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_email",
          "invalid_json",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "nothing_to_change",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "sandbox_key",
          "service_not_live",
          "text_too_long"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/settings/optin": {
      "get": {
        "tags": [
          "Opt-ins"
        ],
        "operationId": "getOptinSetting",
        "summary": "Is the opt-in rule for marketing on?",
        "description": "Needs the 'settings:manage' scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "The setting.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OptinSettingResponse"
                },
                "example": {
                  "require_optin_for_marketing": true
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "settings:manage",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      },
      "put": {
        "tags": [
          "Opt-ins"
        ],
        "operationId": "setOptinSetting",
        "summary": "Turn the opt-in rule for marketing on or off",
        "description": "When on, MARKETING template messages are only sent to numbers with an opt-in record. Others are skipped (recipient_not_opted_in; a single recipient gets 403). Utility templates and replies are not affected. Off by default.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OptinSettingRequest"
              },
              "example": {
                "require_optin_for_marketing": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OptinSettingResponse"
                },
                "example": {
                  "require_optin_for_marketing": true
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "settings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "invalid_setting",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "sandbox_key",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/optins": {
      "get": {
        "tags": [
          "Opt-ins"
        ],
        "operationId": "listOptins",
        "summary": "The opt-in records, or check one number",
        "description": "Your own proof that people agreed to your messages (kept by app2email; nothing else uses it unless the opt-in rule is on). Needs the 'settings:manage' scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "number",
            "in": "query",
            "required": false,
            "description": "Check only this number: opted_in true or false.",
            "schema": {
              "type": "string",
              "example": "61412345678"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many (1 to 200, default 100).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 100
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "The next_after of the previous page.",
            "schema": {
              "type": "string",
              "example": "61412345678"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The opt-ins.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OptinsListResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "o1lkr",
                  "total": 2,
                  "optins": [
                    {
                      "number": "61412345678",
                      "name": "John",
                      "source": "api",
                      "note": "",
                      "at": "2026-10-26T01:00:00Z",
                      "added_by": "api"
                    },
                    {
                      "number": "61498765432",
                      "name": "Mary",
                      "source": "web form",
                      "note": "ticked the box",
                      "at": "2026-10-01T00:00:00Z",
                      "added_by": "api"
                    }
                  ],
                  "next_after": null,
                  "opted_in": null
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "settings:manage",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      },
      "post": {
        "tags": [
          "Opt-ins"
        ],
        "operationId": "addOptins",
        "summary": "Record that people opted in",
        "description": "Up to 1000 entries, all or nothing. A number already recorded is updated. Needs the 'settings:manage' scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OptinsAddRequest"
              },
              "example": {
                "numbers": [
                  "61412345678",
                  {
                    "number": "61498765432",
                    "name": "Mary",
                    "source": "web form",
                    "note": "ticked the box",
                    "at": "2026-10-01T00:00:00Z"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OptinsAddResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "o9ahv",
                  "saved": 2
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "settings:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "invalid_numbers",
          "ip_not_allowed",
          "missing_api_key",
          "missing_numbers",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live",
          "too_many_numbers"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/optins/{phone}": {
      "delete": {
        "tags": [
          "Opt-ins"
        ],
        "operationId": "removeOptin",
        "summary": "Remove an opt-in record",
        "description": "Needs the 'settings:manage' scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "phone",
            "in": "path",
            "required": true,
            "description": "The number, with country code.",
            "schema": {
              "type": "string",
              "example": "61412345678"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Removed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OptinRemoveResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "r6dyw",
                  "removed": "61412345678"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "settings:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "optin_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/conversations/{contact}": {
      "get": {
        "tags": [
          "Conversations"
        ],
        "operationId": "getConversation",
        "summary": "One contact: window state, last messages, owner",
        "description": "The conversation with one contact: `window_state` open or closed and `window_closes_at`, the last message each way, held email replies, and who owns it (see PUT .../owner).",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "contact",
            "in": "path",
            "required": true,
            "description": "The contact's number (country code first), or their business-scoped user id.",
            "schema": {
              "type": "string",
              "example": "61412345678"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The conversation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationDetailResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "c9slm",
                  "contact": "61412345678",
                  "identity_type": "phone",
                  "phone": "61412345678",
                  "name": "John",
                  "window_state": "open",
                  "window_open": true,
                  "window_closes_at": "2026-10-27T01:05:44Z",
                  "last_inbound_at": "2026-10-26T01:20:44Z",
                  "last_outbound_at": "2026-10-26T01:12:09Z",
                  "messages": 12,
                  "owner": "human",
                  "owner_set_at": "2026-10-26T01:21:00Z",
                  "owner_set_by": "api:Support bot",
                  "owner_reason": "customer asked for a person",
                  "owner_summary": "Wants to move the delivery to Monday.",
                  "held_replies": false,
                  "conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_..."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "conversation_not_found",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "invalid_phone",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "get_conversation",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/conversations/{contact}/owner": {
      "put": {
        "tags": [
          "Conversations"
        ],
        "operationId": "setConversationOwner",
        "summary": "Hand a contact over: human, agent, paused, or back to normal",
        "description": "Needs the 'messages:send' scope. `human` or `paused`: app2email's auto reply and the A2A / OpenClaw agent leave the contact alone (while the number's setting a2a.respect_owner is on); email forwarding carries on. `agent`: an automation owns it (a marker for everyone else). `\"\"`: the normal routing. `until_minutes` makes it temporary. Fires the conversation.owner_changed webhook event. A number that has never been in touch gets a conversation record so the owner can be set first.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "contact",
            "in": "path",
            "required": true,
            "description": "The contact's number (country code first), or their business-scoped user id.",
            "schema": {
              "type": "string",
              "example": "61412345678"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OwnerRequest"
              },
              "example": {
                "owner": "human",
                "reason": "customer asked for a person",
                "summary": "Wants to move the delivery to Monday.",
                "until_minutes": 240
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OwnerResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:send",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "conversation_not_found",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_json",
          "invalid_number_in_url",
          "invalid_owner",
          "invalid_phone",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [
          "conversation.owner_changed"
        ],
        "x-a2e-mcp-tool": "set_conversation_owner",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/settings/number": {
      "get": {
        "tags": [
          "Settings"
        ],
        "operationId": "getNumberSettings",
        "summary": "The number's settings: email behaviour, caps, compliance",
        "description": "Every setting with its value (defaults filled in).",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "The settings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NumberSettingsResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "s1xpa",
                  "settings": {
                    "email": {
                      "delivery_receipts": "failed_only",
                      "mark_read_on_open": false,
                      "include_history": 20,
                      "history_images": "link"
                    },
                    "caps": {
                      "monthly_messages": 0
                    },
                    "compliance": {
                      "adm_disclosure": "",
                      "stop_keywords_extra": []
                    },
                    "a2a": {
                      "respect_owner": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      },
      "put": {
        "tags": [
          "Settings"
        ],
        "operationId": "updateNumberSettings",
        "summary": "Change some of the number's settings",
        "description": "Needs the 'settings:manage' scope. Only the keys given change; nested objects (`{\"email\": {\"mark_read_on_open\": true}}`) or dotted keys (`{\"email.mark_read_on_open\": true}`) both work. Not with a sandbox key.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NumberSettings"
              },
              "example": {
                "email": {
                  "mark_read_on_open": true,
                  "include_history": 3
                },
                "caps": {
                  "monthly_messages": 2000
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The settings as they are now.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NumberSettingsResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "s1xpa",
                  "settings": {
                    "email": {
                      "delivery_receipts": "failed_only",
                      "mark_read_on_open": false,
                      "include_history": 20,
                      "history_images": "link"
                    },
                    "caps": {
                      "monthly_messages": 0
                    },
                    "compliance": {
                      "adm_disclosure": "",
                      "stop_keywords_extra": []
                    },
                    "a2a": {
                      "respect_owner": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "settings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_json",
          "invalid_number_in_url",
          "invalid_setting",
          "ip_not_allowed",
          "missing_api_key",
          "nothing_to_change",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "sandbox_key",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/contacts": {
      "get": {
        "tags": [
          "Contacts"
        ],
        "operationId": "listContacts",
        "summary": "Your contacts, newest first",
        "description": "Filter by a search text, a tag, or consent. Page with `next_cursor`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Part of the name or number.",
            "schema": {
              "type": "string",
              "example": "john"
            }
          },
          {
            "name": "tag",
            "in": "query",
            "required": false,
            "description": "Only contacts with this tag.",
            "schema": {
              "type": "string",
              "example": "vip"
            }
          },
          {
            "name": "consent",
            "in": "query",
            "required": false,
            "description": "true: with marketing consent. false: without.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many (1 to 200, default 50).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The next_cursor of the previous answer, unchanged. Leave out for the first page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The contacts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactsResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "l4vne",
                  "contacts": [
                    {
                      "identity": "61412345678",
                      "identity_type": "phone",
                      "phone": "61412345678",
                      "name": "John Smith",
                      "tags": [
                        "vip"
                      ],
                      "custom_fields": {
                        "first_name": "John",
                        "order_id": "1234"
                      },
                      "source": "crm",
                      "consent": {
                        "marketing": true,
                        "at": "2026-10-01T09:00:00Z",
                        "source": "web form",
                        "text": "Yes, send me offers on WhatsApp",
                        "evidence": "https://example.com/forms/123",
                        "recorded": true
                      },
                      "last_inbound_at": "2026-10-26T01:20:44Z",
                      "created": "2026-10-01T09:00:10Z",
                      "updated": "2026-10-26T01:20:44Z"
                    }
                  ],
                  "next_cursor": null,
                  "count": 1,
                  "total": 1
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_limit",
          "invalid_number_in_url",
          "invalid_setting",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "list_contacts",
        "x-a2e-needs": null
      },
      "post": {
        "tags": [
          "Contacts"
        ],
        "operationId": "upsertContacts",
        "summary": "Make or update contacts (one, or a list of up to 1000)",
        "description": "Needs the 'contacts:manage' scope. Upsert by identity (phone or business-scoped user id): the fields given replace, the ones left out stay. Custom fields merge. `consent` records consent with its evidence. Fires contact.updated for requests of up to 50 contacts.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactsUpsertRequest"
              },
              "example": {
                "phone": "61412345678",
                "name": "John Smith",
                "tags": [
                  "vip"
                ],
                "custom_fields": {
                  "first_name": "John",
                  "order_id": "1234"
                },
                "source": "crm",
                "consent": {
                  "marketing": true,
                  "at": "2026-10-01T09:00:00Z",
                  "source": "web form",
                  "text": "Yes, send me offers on WhatsApp",
                  "evidence": "https://example.com/forms/123"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactsUpsertResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "u8wqb",
                  "saved": 1,
                  "created": 1,
                  "updated": 0,
                  "contacts": [
                    {
                      "identity": "61412345678",
                      "identity_type": "phone",
                      "phone": "61412345678",
                      "name": "John Smith",
                      "tags": [
                        "vip"
                      ],
                      "custom_fields": {
                        "first_name": "John",
                        "order_id": "1234"
                      },
                      "source": "crm",
                      "consent": {
                        "marketing": true,
                        "at": "2026-10-01T09:00:00Z",
                        "source": "web form",
                        "text": "Yes, send me offers on WhatsApp",
                        "evidence": "https://example.com/forms/123",
                        "recorded": true
                      },
                      "last_inbound_at": "2026-10-26T01:20:44Z",
                      "created": "2026-10-01T09:00:10Z",
                      "updated": "2026-10-26T01:20:44Z"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "contacts:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_contacts",
          "invalid_json",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live",
          "too_many_numbers"
        ],
        "x-a2e-webhook-events": [
          "contact.updated"
        ],
        "x-a2e-mcp-tool": "upsert_contact",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/contacts/import": {
      "post": {
        "tags": [
          "Contacts"
        ],
        "operationId": "importContacts",
        "summary": "Import contacts from CSV or JSON (up to 5000 rows)",
        "description": "Needs the 'contacts:manage' scope. `text/csv` with a header row: phone (or identity / number / mobile), name (or first_name + last_name), tags (separated by |), consent_marketing (yes/no), consent_source, consent_text, consent_evidence, consent_at, source; every other column becomes a custom field. Or `application/json` with a list of contacts as for POST /contacts. Rows with a problem are skipped and listed; the rest are saved.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "text/csv": {
              "schema": {
                "type": "string"
              },
              "example": "phone,name,tags,consent_marketing,consent_source,consent_text,first_name\n61412345678,John Smith,vip|newsletter,yes,web form,Yes send me offers on WhatsApp,John\n"
            },
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ContactInput"
                }
              },
              "example": [
                {
                  "phone": "61412345678",
                  "name": "John Smith",
                  "tags": [
                    "vip"
                  ],
                  "custom_fields": {
                    "first_name": "John",
                    "order_id": "1234"
                  },
                  "source": "crm",
                  "consent": {
                    "marketing": true,
                    "at": "2026-10-01T09:00:00Z",
                    "source": "web form",
                    "text": "Yes, send me offers on WhatsApp",
                    "evidence": "https://example.com/forms/123"
                  }
                }
              ]
            }
          }
        },
        "responses": {
          "200": {
            "description": "Imported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactsImportResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "i2gka",
                  "rows": 120,
                  "saved": 118,
                  "created": 90,
                  "updated": 28,
                  "skipped": 2,
                  "errors": [
                    {
                      "row": 7,
                      "problem": "'0412' must be a WhatsApp number with country code, digits only (8 to 15 digits), or a business-scoped user id like 61.AbC123"
                    }
                  ],
                  "note": "Rows with a problem were skipped (the first 50 are listed); the rest were saved."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "The request or the media file is too large. Possible error.code values: request_too_large, media_too_large, approval_body_too_large, test_event_too_large, flow_json_too_large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "contacts:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_csv",
          "invalid_json",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "request_too_large",
          "service_not_live",
          "too_many_numbers"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/contacts/export.csv": {
      "get": {
        "tags": [
          "Contacts"
        ],
        "operationId": "exportContacts",
        "summary": "All contacts as CSV",
        "description": "One row per contact with tags (separated by |), consent and custom fields (as JSON). Up to 50,000 rows.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "The CSV file.",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/contacts/{identity}": {
      "get": {
        "tags": [
          "Contacts"
        ],
        "operationId": "getContact",
        "summary": "One contact",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "identity",
            "in": "path",
            "required": true,
            "description": "The contact's number (country code first), or their business-scoped user id.",
            "schema": {
              "type": "string",
              "example": "61412345678"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The contact.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "contact_not_found",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "invalid_phone",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      },
      "patch": {
        "tags": [
          "Contacts"
        ],
        "operationId": "updateContact",
        "summary": "Change a contact",
        "description": "Needs the 'contacts:manage' scope. The same fields as POST /contacts; only the ones given change.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "identity",
            "in": "path",
            "required": true,
            "description": "The contact's number (country code first), or their business-scoped user id.",
            "schema": {
              "type": "string",
              "example": "61412345678"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactInput"
              },
              "example": {
                "name": "John Smith",
                "tags": [
                  "vip",
                  "newsletter"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The contact.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "contacts:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "contact_not_found",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_contacts",
          "invalid_json",
          "invalid_number_in_url",
          "invalid_phone",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [
          "contact.updated"
        ],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      },
      "delete": {
        "tags": [
          "Contacts"
        ],
        "operationId": "deleteContact",
        "summary": "Delete a contact record",
        "description": "Needs the 'contacts:manage' scope. The Do Not Call list and the opt-ins are separate records and stay. The contact's appointments (and notes, payments, packages) are kept: add `booking_data=erase` to erase or anonymise them too (future confirmed appointments are cancelled without a message, every appointment loses the customer's name, number, e-mail and notes, and their notes, links, holds and poll votes are deleted; the answer then carries `booking_data_erased` with the counts, and `booking.customer.erased` is sent). That cannot be undone.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "identity",
            "in": "path",
            "required": true,
            "description": "The contact's number (country code first), or their business-scoped user id.",
            "schema": {
              "type": "string",
              "example": "61412345678"
            }
          },
          {
            "name": "booking_data",
            "in": "query",
            "required": false,
            "description": "erase: also erase the contact's booking data (appointments, notes, links, holds, poll votes, package and payment details). Left out: the appointments are kept.",
            "schema": {
              "type": "string",
              "enum": [
                "erase"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactDeleteResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "contacts:manage",
        "x-a2e-sandbox": "simulated",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "approval_body_too_large",
          "background_start_failed",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "broadcast_cancelled",
          "bsuid_not_supported",
          "call_permission_required",
          "caption_not_supported",
          "caption_too_long",
          "contact_not_found",
          "daily_cap_reached",
          "display_name_not_approved",
          "duplicate_recipients",
          "free_form_single_recipient",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_base64",
          "invalid_callback_data",
          "invalid_components",
          "invalid_contacts_message",
          "invalid_cursor",
          "invalid_identity_key_hash",
          "invalid_interactive",
          "invalid_location",
          "invalid_marketing_api",
          "invalid_media_link",
          "invalid_number_in_url",
          "invalid_phone",
          "invalid_reaction",
          "invalid_recipients",
          "invalid_reply_to",
          "invalid_send_at",
          "invalid_to",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_download_failed",
          "media_too_large",
          "media_type_not_allowed",
          "media_upload_error",
          "media_upload_failed",
          "message_too_old",
          "messaging_limit_restricted",
          "missing_api_key",
          "missing_interactive",
          "missing_media",
          "missing_message_id",
          "missing_template_language",
          "missing_template_name",
          "missing_text",
          "monthly_cap_reached",
          "monthly_limit_reached",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "reaction_too_old",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_not_opted_in",
          "recipient_opted_out",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "schedule_failed",
          "segment_and_recipients",
          "segment_empty",
          "segment_not_found",
          "send_at_in_past",
          "send_at_too_far",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_language_not_found",
          "template_lookup_failed",
          "template_not_approved",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_parameters_invalid",
          "template_paused",
          "template_sample_media_failed",
          "template_text_too_long",
          "text_too_long",
          "to_and_recipients",
          "too_many_messages_to_recipient",
          "too_many_recipients",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "voice_needs_ogg_opus",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [
          "booking.customer.erased",
          "broadcast.completed",
          "message.failed",
          "message.held_for_approval",
          "message.status",
          "usage.threshold"
        ],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/contacts/{identity}/consent": {
      "post": {
        "tags": [
          "Contacts"
        ],
        "operationId": "recordConsent",
        "summary": "Record consent (or its withdrawal) with evidence",
        "description": "Needs the 'contacts:manage' scope. Makes the contact when it is new. `marketing: false` records a withdrawal: add the contact to the Do Not Call list too. Fires contact.updated.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "identity",
            "in": "path",
            "required": true,
            "description": "The contact's number (country code first), or their business-scoped user id.",
            "schema": {
              "type": "string",
              "example": "61412345678"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Consent"
              },
              "example": {
                "marketing": true,
                "source": "web form",
                "text": "Yes, send me offers on WhatsApp",
                "evidence": "https://example.com/forms/123"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Recorded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "contacts:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_contacts",
          "invalid_json",
          "invalid_number_in_url",
          "invalid_phone",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [
          "contact.updated"
        ],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/segments": {
      "get": {
        "tags": [
          "Contacts"
        ],
        "operationId": "listSegments",
        "summary": "Your segments (saved contact filters)",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "The segments.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SegmentsResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "g5tnr",
                  "segments": [
                    {
                      "id": 12,
                      "name": "VIP, consented",
                      "filter": {
                        "tags_any": [
                          "vip"
                        ],
                        "consent_marketing": true,
                        "last_inbound_days": 90
                      },
                      "contacts": null,
                      "created": "2026-11-02T01:00:00Z",
                      "updated": "2026-11-02T01:00:00Z"
                    }
                  ],
                  "count": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      },
      "post": {
        "tags": [
          "Contacts"
        ],
        "operationId": "createSegment",
        "summary": "Save a contact filter as a segment",
        "description": "Needs the 'contacts:manage' scope. Up to 100 segments. Send to it with POST /messages `segment`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SegmentRequest"
              },
              "example": {
                "name": "VIP, consented",
                "filter": {
                  "tags_any": [
                    "vip"
                  ],
                  "consent_marketing": true,
                  "last_inbound_days": 90
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created, with how many contacts match now.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SegmentResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "contacts:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_json",
          "invalid_number_in_url",
          "invalid_segment",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "segment_exists",
          "service_not_live",
          "too_many_segments"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/segments/{id}": {
      "get": {
        "tags": [
          "Contacts"
        ],
        "operationId": "getSegment",
        "summary": "One segment, with how many contacts match now",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The segment's id, or its exact name.",
            "schema": {
              "type": "string",
              "example": "12"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The segment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SegmentResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "segment_not_found",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      },
      "put": {
        "tags": [
          "Contacts"
        ],
        "operationId": "updateSegment",
        "summary": "Rename a segment or replace its filter",
        "description": "Needs the 'contacts:manage' scope. A `filter` given replaces the whole filter.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The segment's id, or its exact name.",
            "schema": {
              "type": "string",
              "example": "12"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SegmentRequest"
              },
              "example": {
                "name": "VIP, consented",
                "filter": {
                  "tags_any": [
                    "vip"
                  ],
                  "consent_marketing": true,
                  "last_inbound_days": 90
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The segment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SegmentResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "contacts:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "invalid_segment",
          "ip_not_allowed",
          "missing_api_key",
          "nothing_to_change",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "segment_exists",
          "segment_not_found",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      },
      "delete": {
        "tags": [
          "Contacts"
        ],
        "operationId": "deleteSegment",
        "summary": "Delete a segment (its contacts stay)",
        "description": "Needs the 'contacts:manage' scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The segment's id, or its exact name.",
            "schema": {
              "type": "string",
              "example": "12"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SegmentDeleteResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "contacts:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "segment_not_found",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/segments/{id}/contacts": {
      "get": {
        "tags": [
          "Contacts"
        ],
        "operationId": "listSegmentContacts",
        "summary": "The contacts a segment matches now",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The segment's id, or its exact name.",
            "schema": {
              "type": "string",
              "example": "12"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many (1 to 200, default 50).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The next_cursor of the previous answer, unchanged. Leave out for the first page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The contacts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SegmentContactsResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_limit",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "segment_not_found",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/compliance/export.csv": {
      "get": {
        "tags": [
          "Do Not Call"
        ],
        "operationId": "exportCompliance",
        "summary": "Consent records, Do Not Call list and opt-ins as one CSV",
        "description": "Needs the 'dnc:manage' scope. One row per record with record_type (consent, do_not_call, opt_in), identity, name, status, time, source, text, note and evidence: the records the Spam Act 2003 expects you to be able to show.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "The CSV file.",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "dnc:manage",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/usage/meta": {
      "get": {
        "tags": [
          "Account"
        ],
        "operationId": "getUsageMeta",
        "summary": "What WhatsApp charges this billing month, per day",
        "description": "The billing month's messages by Meta's pricing category (the 1,000 free service messages, billable service, utility, marketing, authentication) with an indicative cost estimate, in all and per day. From the pricing object of WhatsApp's status webhooks; Meta bills you directly, so treat the amount as a guide.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "The counts and the estimate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageMetaResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "m7bqs",
                  "number": "4976659348270",
                  "meta_pricing": {
                    "billing_period": {
                      "start": "2026-10-15T00:00:00Z",
                      "end": "2026-11-15T00:00:00Z"
                    },
                    "counts": {
                      "service_free_used": 412,
                      "service_billable": 0,
                      "utility": 120,
                      "marketing": 35,
                      "authentication": 0,
                      "free_entry_point": 2,
                      "unknown": 3,
                      "total": 572,
                      "estimated_cost_usd": 4.3
                    },
                    "free_service_messages": {
                      "allowance_per_month": 1000,
                      "used": 412,
                      "left": 588
                    },
                    "estimated_cost": {
                      "currency": "USD",
                      "amount": 4.3,
                      "rate_region": "Rest of Asia Pacific (Australia, New Zealand, Japan, ...)",
                      "rate_region_code": "apac",
                      "rates_per_message": {
                        "marketing": 0.0842,
                        "utility": 0.0113,
                        "authentication": 0.0113,
                        "service": 0.0113
                      },
                      "rates_last_checked": "2026-11-02"
                    },
                    "days": [
                      {
                        "date": "2026-11-01",
                        "counts": {
                          "service_free_used": 20,
                          "service_billable": 0,
                          "utility": 5,
                          "marketing": 0,
                          "authentication": 0,
                          "free_entry_point": 0,
                          "unknown": 0,
                          "total": 25,
                          "estimated_cost_usd": 0.0565
                        }
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/media/{id}": {
      "get": {
        "tags": [
          "Media"
        ],
        "operationId": "getMedia",
        "summary": "Download a received file (stored copy, else from WhatsApp)",
        "description": "app2email keeps its own copy of every received image, video, audio, document and sticker (WhatsApp's ids expire after 7 days): served first. Without one, the file comes from WhatsApp by the message's media id, or by a WhatsApp media id in the URL. Header X-Media-Source: stored | whatsapp. `?info=true`: type, size and sha256 instead of the file. WhatsApp pauses media lookups after many errors, so an id it did not know is remembered for 30 minutes.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The message_id of a received message (wamid..., URL-encoded), or a WhatsApp media id (digits).",
            "schema": {
              "type": "string",
              "example": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA="
            }
          },
          {
            "name": "info",
            "in": "query",
            "required": false,
            "description": "true: the file's type, size and sha256 as JSON, not the file.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The file (or with ?info=true the JSON info).",
            "content": {
              "*/*": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            },
            "headers": {
              "X-Media-Source": {
                "description": "stored: app2email's copy. whatsapp: fetched from WhatsApp now.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "stored",
                    "whatsapp"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-info-response": {
          "query": {
            "info": "true"
          },
          "content_type": "application/json",
          "schema": {
            "$ref": "#/components/schemas/MediaInfoResponse"
          },
          "example": {
            "success": true,
            "request_id": "i3nfo",
            "media": {
              "id": "wamid.HBgLNjE0MTIzNDU2NzgVAgASGBQzQUZCMTY0MDc2MUYwNzBDNTY5MAA=",
              "source": "stored",
              "mime_type": "image/jpeg",
              "file_size": 182044,
              "sha256": "9b2f3c0c4f8f4c3e8f0d8a2b6c1e7f5a3d9b0c2e4f6a8b1c3d5e7f9a0b2c4d6e",
              "filename": "251106_010203_img.jpg",
              "whatsapp_media_id": "1037543291543636"
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_number_in_url",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_lookup_failed",
          "media_lookups_paused",
          "media_not_found",
          "media_upload_error",
          "message_not_found",
          "messaging_limit_restricted",
          "missing_api_key",
          "missing_message_id",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "get_media_info",
        "x-a2e-needs": null
      },
      "delete": {
        "tags": [
          "Media"
        ],
        "operationId": "deleteMedia",
        "summary": "Delete an uploaded file at WhatsApp",
        "description": "The media_id of POST /media (WhatsApp keeps uploads 30 days otherwise). A scheduled send that still uses it then fails. app2email's stored copies of received files stay.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The WhatsApp media id (digits).",
            "schema": {
              "type": "string",
              "example": "1037543291543636"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaDeleteResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "d7mdl",
                  "media_id": "1037543291543636",
                  "deleted": true
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_media_id",
          "invalid_number_in_url",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_delete_failed",
          "media_download_error",
          "media_not_found",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "sandbox_key",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-scope": "messages:send",
        "x-a2e-sandbox": "refused",
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "delete_media",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/approvals": {
      "get": {
        "tags": [
          "Approvals"
        ],
        "operationId": "listApprovals",
        "summary": "Sends held for approval",
        "description": "Sends held by a key's approval gate (approval_above on the API key page): pending ones by default, `status=all` for the resolved and expired ones of the last 7 days too.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "pending (default) or all.",
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "all"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The held sends.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalsResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "a4lxc",
                  "approvals": [
                    {
                      "id": "apr_a1b2c3d4e5f6g7h8",
                      "status": "pending",
                      "created": "2026-11-02T01:12:09Z",
                      "expires": "2026-11-04T01:12:09Z",
                      "key": "Agent",
                      "request_id": "p3kdm",
                      "recipients": 250,
                      "summary": {
                        "recipients": 250,
                        "to_send": 248,
                        "template": {
                          "name": "november_offer",
                          "language": "en",
                          "category": "MARKETING"
                        },
                        "text": "Hi {{first_name}}, ..."
                      },
                      "url": "https://www.app2email.com/dashboard/approvals?id=apr_a1b2c3d4e5f6g7h8",
                      "approve_url": "https://api.app2email.com/v1/4976659348270/approvals/apr_a1b2c3d4e5f6g7h8/approve"
                    }
                  ],
                  "count": 1
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "invalid_status",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "list_approvals",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/approvals/{id}/approve": {
      "post": {
        "tags": [
          "Approvals"
        ],
        "operationId": "approveSend",
        "summary": "Approve a held send: it is sent now",
        "description": "Needs the 'messages:send' scope, from a key that is not a sandbox key. The stored request is run as a normal send (the Do Not Call list, the limits and the daily cap are checked again); `send` in the answer is the answer the original request would have got. Fires approval.resolved. A held send expires 48 hours after it was held.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The approval's id.",
            "schema": {
              "type": "string",
              "example": "apr_a1b2c3d4e5f6g7h8"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Approved and run.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalResolveResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "a5mzd",
                  "approval": {
                    "id": "apr_a1b2c3d4e5f6g7h8",
                    "status": "approved",
                    "resolved_by": "api:Manager",
                    "resolved_at": "2026-11-02T02:00:00Z",
                    "result": {
                      "http_status": 200,
                      "status": "accepted",
                      "accepted": 248,
                      "failed": 0,
                      "broadcast_code": "k3XbQ9rTzP2mWv7a1c9e"
                    }
                  },
                  "send": {
                    "success": true,
                    "status": "accepted",
                    "recipients": 250,
                    "accepted": 248,
                    "failed": 2
                  },
                  "note": "Approved and sent: 'send' is the answer the original request would have got."
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:send",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "approval_already_resolved",
          "approval_body_too_large",
          "approval_expired",
          "approval_not_found",
          "background_start_failed",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "broadcast_cancelled",
          "bsuid_not_supported",
          "call_permission_required",
          "caption_not_supported",
          "caption_too_long",
          "daily_cap_reached",
          "display_name_not_approved",
          "duplicate_recipients",
          "free_form_single_recipient",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_base64",
          "invalid_callback_data",
          "invalid_components",
          "invalid_contacts_message",
          "invalid_cursor",
          "invalid_identity_key_hash",
          "invalid_interactive",
          "invalid_location",
          "invalid_marketing_api",
          "invalid_media_link",
          "invalid_number_in_url",
          "invalid_reaction",
          "invalid_recipients",
          "invalid_reply_to",
          "invalid_send_at",
          "invalid_to",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_download_failed",
          "media_too_large",
          "media_type_not_allowed",
          "media_upload_error",
          "media_upload_failed",
          "message_too_old",
          "messaging_limit_restricted",
          "missing_api_key",
          "missing_interactive",
          "missing_media",
          "missing_message_id",
          "missing_template_language",
          "missing_template_name",
          "missing_text",
          "monthly_cap_reached",
          "monthly_limit_reached",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "reaction_too_old",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_not_opted_in",
          "recipient_opted_out",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "sandbox_key",
          "schedule_failed",
          "segment_and_recipients",
          "segment_empty",
          "segment_not_found",
          "send_at_in_past",
          "send_at_too_far",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_language_not_found",
          "template_lookup_failed",
          "template_not_approved",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_parameters_invalid",
          "template_paused",
          "template_sample_media_failed",
          "template_text_too_long",
          "text_too_long",
          "to_and_recipients",
          "too_many_messages_to_recipient",
          "too_many_recipients",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "voice_needs_ogg_opus",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [
          "approval.resolved",
          "broadcast.completed",
          "message.failed",
          "message.held_for_approval",
          "message.status",
          "usage.threshold"
        ],
        "x-a2e-mcp-tool": "approve_send",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/approvals/{id}/reject": {
      "post": {
        "tags": [
          "Approvals"
        ],
        "operationId": "rejectSend",
        "summary": "Reject a held send: nothing is sent",
        "description": "Needs the 'messages:send' scope. Fires approval.resolved.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The approval's id.",
            "schema": {
              "type": "string",
              "example": "apr_a1b2c3d4e5f6g7h8"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalResolveResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:send",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "approval_already_resolved",
          "approval_body_too_large",
          "approval_expired",
          "approval_not_found",
          "background_start_failed",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "broadcast_cancelled",
          "bsuid_not_supported",
          "call_permission_required",
          "caption_not_supported",
          "caption_too_long",
          "daily_cap_reached",
          "display_name_not_approved",
          "duplicate_recipients",
          "free_form_single_recipient",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_base64",
          "invalid_callback_data",
          "invalid_components",
          "invalid_contacts_message",
          "invalid_cursor",
          "invalid_identity_key_hash",
          "invalid_interactive",
          "invalid_location",
          "invalid_marketing_api",
          "invalid_media_link",
          "invalid_number_in_url",
          "invalid_reaction",
          "invalid_recipients",
          "invalid_reply_to",
          "invalid_send_at",
          "invalid_to",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_download_failed",
          "media_too_large",
          "media_type_not_allowed",
          "media_upload_error",
          "media_upload_failed",
          "message_too_old",
          "messaging_limit_restricted",
          "missing_api_key",
          "missing_interactive",
          "missing_media",
          "missing_message_id",
          "missing_template_language",
          "missing_template_name",
          "missing_text",
          "monthly_cap_reached",
          "monthly_limit_reached",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "reaction_too_old",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_not_opted_in",
          "recipient_opted_out",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "sandbox_key",
          "schedule_failed",
          "segment_and_recipients",
          "segment_empty",
          "segment_not_found",
          "send_at_in_past",
          "send_at_too_far",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_language_not_found",
          "template_lookup_failed",
          "template_not_approved",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_parameters_invalid",
          "template_paused",
          "template_sample_media_failed",
          "template_text_too_long",
          "text_too_long",
          "to_and_recipients",
          "too_many_messages_to_recipient",
          "too_many_recipients",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "voice_needs_ogg_opus",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [
          "approval.resolved"
        ],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/webhooks": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "listWebhooks",
        "summary": "Your webhooks",
        "description": "With the result of the last delivery to each.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "The webhooks.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhooksResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "w3bls",
                  "events_available": [
                    "message.status",
                    "message.received",
                    "message.failed",
                    "contact.opted_out",
                    "broadcast.completed",
                    "usage.threshold",
                    "template.status_changed",
                    "conversation.owner_changed",
                    "message.held_for_approval",
                    "approval.resolved",
                    "contact.updated",
                    "booking.created",
                    "booking.cancelled",
                    "booking.rescheduled",
                    "booking.rated",
                    "flow.completed",
                    "booking.updated",
                    "booking.note.created",
                    "calendar.block.created",
                    "calendar.block.deleted",
                    "call.incoming",
                    "call.status",
                    "message.edited",
                    "message.deleted",
                    "contact.changed_number",
                    "number.updated",
                    "number.error",
                    "flow.status_changed",
                    "booking.paid",
                    "booking.refunded",
                    "payment.paid",
                    "package.purchased",
                    "poll.voted",
                    "poll.closed",
                    "booking.customer.erased"
                  ],
                  "webhooks": [
                    {
                      "id": "wh_a1b2c3d4e5f6g7h8",
                      "url": "https://hooks.example.com/app2email",
                      "events": [
                        "message.status",
                        "message.received",
                        "message.failed",
                        "contact.opted_out",
                        "broadcast.completed",
                        "usage.threshold",
                        "template.status_changed",
                        "conversation.owner_changed",
                        "message.held_for_approval",
                        "approval.resolved",
                        "contact.updated",
                        "booking.created",
                        "booking.cancelled",
                        "booking.rescheduled",
                        "booking.rated",
                        "flow.completed",
                        "booking.updated",
                        "booking.note.created",
                        "calendar.block.created",
                        "calendar.block.deleted",
                        "call.incoming",
                        "call.status",
                        "message.edited",
                        "message.deleted",
                        "contact.changed_number",
                        "number.updated",
                        "number.error",
                        "flow.status_changed",
                        "booking.paid",
                        "booking.refunded",
                        "payment.paid",
                        "package.purchased",
                        "poll.voted",
                        "poll.closed",
                        "booking.customer.erased"
                      ],
                      "secret": "whsec_3Fq9LmZ2xT8pW1rK7vB4nD6sH0jC5yA9",
                      "created": "2026-11-01T09:30:00.000Z",
                      "active": true,
                      "format": "app2email",
                      "headers": {
                        "Authorization": "****YXNz"
                      },
                      "last_delivery": {
                        "at": "2026-11-06T01:00:03.300Z",
                        "ok": true,
                        "result": "HTTP 200 in 184 ms"
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "webhooks:manage",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "list_webhooks",
        "x-a2e-needs": null
      },
      "post": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "createWebhook",
        "summary": "Get events at your URL",
        "description": "Up to 5 per number. Every webhook gets every event: use the event's type to pick the ones you handle. The same URL again answers that webhook, turned on (200). The answer has the secret that signs every event. Optional: headers (custom headers) and format (app2email or meta).",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookRequest"
              },
              "example": {
                "url": "https://hooks.example.com/app2email"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponse"
                }
              }
            }
          },
          "200": {
            "description": "This URL already had a webhook: it is on, same id and secret.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "webhooks:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_json",
          "invalid_number_in_url",
          "invalid_webhook_format",
          "invalid_webhook_headers",
          "invalid_webhook_url",
          "ip_not_allowed",
          "missing_api_key",
          "missing_url",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live",
          "too_many_webhooks"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "create_webhook",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/webhooks/samples": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "webhookSamples",
        "summary": "A sample of every event",
        "description": "Each event type (and ping) as a test of that type sends it: the real fields, with made-up values and \"test\": true. Needs the 'webhooks:manage' scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "The samples.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSamplesResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "w3bsm",
                  "samples": {
                    "ping": {
                      "id": "evt_Xq3k9m2Lw8Rt5Yp1Zs01",
                      "type": "ping",
                      "created": "2026-11-06T01:00:00.000Z",
                      "number": "4976659348270",
                      "test": true,
                      "data": {
                        "webhook_id": "wh_a1b2c3d4e5f6g7h8",
                        "message": "Test event. If you can see this, your webhook works."
                      }
                    },
                    "message.received": {
                      "id": "evt_Xq3k9m2Lw8Rt5Yp1Zs01",
                      "type": "message.received",
                      "created": "2026-11-06T01:00:00.000Z",
                      "number": "4976659348270",
                      "data": {
                        "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA=",
                        "from": "61412345678",
                        "name": "Sample Contact",
                        "type": "text",
                        "text": "Hi, is my order on its way?",
                        "conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_SAMPLEk3XbQ9rTzP2mW",
                        "timestamp": "2026-11-06T01:00:00.000Z",
                        "from_user_id": "AU.1234567890123456",
                        "whatsapp": {
                          "from": "61412345678",
                          "from_user_id": "AU.1234567890123456",
                          "id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA=",
                          "timestamp": "1762390800",
                          "type": "text",
                          "text": {
                            "body": "Hi, is my order on its way?"
                          }
                        }
                      },
                      "test": true
                    },
                    "message.status": {
                      "id": "evt_Xq3k9m2Lw8Rt5Yp1Zs01",
                      "type": "message.status",
                      "created": "2026-11-06T01:00:00.000Z",
                      "number": "4976659348270",
                      "data": {
                        "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA=",
                        "to": "61412345678",
                        "status": "delivered",
                        "timestamp": "2026-11-06T01:00:00.000Z",
                        "sent_by": "api",
                        "whatsapp_status": "delivered",
                        "recipient_user_id": "AU.1234567890123456",
                        "pricing": {
                          "billable": true,
                          "pricing_model": "PMP",
                          "type": "regular",
                          "category": "utility"
                        },
                        "callback_data": "order-1234"
                      },
                      "test": true
                    }
                  },
                  "meta_samples": {
                    "message.received": {
                      "object": "whatsapp_business_account",
                      "entry": [
                        {
                          "id": "102290129340398",
                          "changes": [
                            {
                              "field": "messages",
                              "value": {
                                "messaging_product": "whatsapp",
                                "metadata": {
                                  "display_phone_number": "4976659348270",
                                  "phone_number_id": "106540352242922"
                                },
                                "contacts": [
                                  {
                                    "profile": {
                                      "name": "Sample Contact"
                                    },
                                    "wa_id": "61412345678",
                                    "user_id": "AU.1234567890123456"
                                  }
                                ],
                                "messages": [
                                  {
                                    "from": "61412345678",
                                    "from_user_id": "AU.1234567890123456",
                                    "id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA=",
                                    "timestamp": "1762390800",
                                    "type": "text",
                                    "text": {
                                      "body": "Hi, is my order on its way?"
                                    }
                                  }
                                ]
                              }
                            }
                          ]
                        }
                      ]
                    }
                  },
                  "note": "What a test of each type sends (POST .../webhooks/{id}/test with {\"type\": \"...\"}). Real events have the same fields, with real values and without \"test\". meta_samples: what a webhook with \"format\": \"meta\" gets instead, for the events that come from WhatsApp."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "webhooks:manage",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/webhooks/{id}": {
      "patch": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "updateWebhook",
        "summary": "Change a webhook: url, active, headers, format",
        "description": "Only what is given changes: url, active, headers (a header set to null is removed), format. `active: true` turns a webhook back on after it was switched off for failures (and clears the failure count). The same url as another webhook of the number: 409 webhook_url_in_use. Needs the 'webhooks:manage' scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The webhook's id.",
            "schema": {
              "type": "string",
              "example": "wh_a1b2c3d4e5f6g7h8"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPatchRequest"
              },
              "example": {
                "url": "https://hooks.example.com/app2email",
                "active": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The webhook.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "v3gkx",
                  "webhook": {
                    "id": "wh_a1b2c3d4e5f6g7h8",
                    "url": "https://hooks.example.com/app2email",
                    "events": [
                      "message.status",
                      "message.received",
                      "message.failed",
                      "contact.opted_out",
                      "broadcast.completed",
                      "usage.threshold",
                      "template.status_changed",
                      "conversation.owner_changed",
                      "message.held_for_approval",
                      "approval.resolved",
                      "contact.updated",
                      "booking.created",
                      "booking.cancelled",
                      "booking.rescheduled",
                      "booking.rated",
                      "flow.completed",
                      "booking.updated",
                      "booking.note.created",
                      "calendar.block.created",
                      "calendar.block.deleted",
                      "call.incoming",
                      "call.status",
                      "message.edited",
                      "message.deleted",
                      "contact.changed_number",
                      "number.updated",
                      "number.error",
                      "flow.status_changed",
                      "booking.paid",
                      "booking.refunded",
                      "payment.paid",
                      "package.purchased",
                      "poll.voted",
                      "poll.closed",
                      "booking.customer.erased"
                    ],
                    "secret": "whsec_...",
                    "created": "2026-10-20T04:00:00Z",
                    "active": true,
                    "disabled_reason": null,
                    "last_delivery": {
                      "at": "2026-10-26T01:12:11Z",
                      "ok": true,
                      "result": "200"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "webhooks:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_json",
          "invalid_number_in_url",
          "invalid_webhook_format",
          "invalid_webhook_headers",
          "invalid_webhook_url",
          "ip_not_allowed",
          "missing_api_key",
          "nothing_to_change",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live",
          "webhook_not_found",
          "webhook_url_in_use"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "update_webhook",
        "x-a2e-needs": null
      },
      "delete": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "deleteWebhook",
        "summary": "Delete a webhook",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The webhook's id.",
            "schema": {
              "type": "string",
              "example": "wh_a1b2c3d4e5f6g7h8"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeleteResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "w3bdl",
                  "deleted": "wh_a1b2c3d4e5f6g7h8"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "description": "Stops every delivery to it, planned retries included. Its delivery log is kept 7 days.",
        "x-a2e-scope": "webhooks:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live",
          "webhook_not_found"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "delete_webhook",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/webhooks/{id}/test": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "testWebhook",
        "summary": "Send a test event now",
        "description": "Sends a test event to the webhook's URL straight away (once, no retries, not in the delivery log) and answers how the URL responded. No body: a 'ping'. {\"type\": \"message.received\"}: that event's sample. {\"event\": {...}}: your own event. Test events carry \"test\": true and the header X-App2email-Test: true, and are signed like every event. Up to 30 tests an hour per number (429 too_many_tests). A webhook with format meta gets the event as Meta's own body.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The webhook's id.",
            "schema": {
              "type": "string",
              "example": "wh_a1b2c3d4e5f6g7h8"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NumberWebhookTestRequest"
              },
              "example": {
                "type": "message.received"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The test was made: see 'delivered'.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookTestResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "The request or the media file is too large. Possible error.code values: request_too_large, media_too_large, approval_body_too_large, test_event_too_large, flow_json_too_large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "webhooks:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_events",
          "invalid_json",
          "invalid_number_in_url",
          "invalid_test_event",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live",
          "test_event_too_large",
          "too_many_tests",
          "webhook_not_found"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/webhooks/{id}/rotate-secret": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "rotateWebhookSecret",
        "summary": "Make a new signing secret",
        "description": "Events are signed with the new secret from then on; the old one stops working at once, unless keep_old_for_hours (1 to 24) is given: the old secret then also signs (a second v1= in X-App2email-Signature) until previous_secret_until. Needs the 'webhooks:manage' scope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The webhook's id.",
            "schema": {
              "type": "string",
              "example": "wh_a1b2c3d4e5f6g7h8"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookRotateRequest"
              },
              "example": {
                "keep_old_for_hours": 24
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The webhook with its new secret.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "v3gkx",
                  "webhook": {
                    "id": "wh_a1b2c3d4e5f6g7h8",
                    "url": "https://hooks.example.com/app2email",
                    "events": [
                      "message.status",
                      "message.received",
                      "message.failed",
                      "contact.opted_out",
                      "broadcast.completed",
                      "usage.threshold",
                      "template.status_changed",
                      "conversation.owner_changed",
                      "message.held_for_approval",
                      "approval.resolved",
                      "contact.updated",
                      "booking.created",
                      "booking.cancelled",
                      "booking.rescheduled",
                      "booking.rated",
                      "flow.completed",
                      "booking.updated",
                      "booking.note.created",
                      "calendar.block.created",
                      "calendar.block.deleted",
                      "call.incoming",
                      "call.status",
                      "message.edited",
                      "message.deleted",
                      "contact.changed_number",
                      "number.updated",
                      "number.error",
                      "flow.status_changed",
                      "booking.paid",
                      "booking.refunded",
                      "payment.paid",
                      "package.purchased",
                      "poll.voted",
                      "poll.closed",
                      "booking.customer.erased"
                    ],
                    "secret": "whsec_...",
                    "created": "2026-10-20T04:00:00Z",
                    "active": true,
                    "disabled_reason": null,
                    "last_delivery": {
                      "at": "2026-10-26T01:12:11Z",
                      "ok": true,
                      "result": "200"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "webhooks:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_json",
          "invalid_keep_old_for_hours",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live",
          "webhook_not_found"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/webhooks/{id}/deliveries": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "listWebhookDeliveries",
        "summary": "The last deliveries, with every attempt",
        "description": "The events sent to this webhook in the last 7 days (the latest 100), newest first, each with its attempts. Use it to find what failed.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The webhook's id.",
            "schema": {
              "type": "string",
              "example": "wh_a1b2c3d4e5f6g7h8"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many (1 to 100, default 50).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "failed: never delivered. delivered: delivered.",
            "schema": {
              "type": "string",
              "enum": [
                "failed",
                "delivered"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The deliveries.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveriesResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "p0fsa",
                  "deliveries": [
                    {
                      "event_id": "evt_Xq3k9m2",
                      "type": "message.status",
                      "created": "2026-10-26T01:12:11Z",
                      "delivered": false,
                      "attempts": [
                        {
                          "at": "2026-10-26T01:12:11Z",
                          "ok": false,
                          "http_status": 503,
                          "ms": 2001,
                          "error": "timeout"
                        },
                        {
                          "at": "2026-10-26T01:12:21Z",
                          "ok": false,
                          "http_status": 503,
                          "ms": 1995,
                          "error": "timeout"
                        }
                      ]
                    }
                  ],
                  "note": "The last 100 deliveries of the last 7 days."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "webhooks:manage",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "invalid_status",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live",
          "webhook_not_found"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/webhooks/{id}/deliveries/{event_id}": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "getWebhookDelivery",
        "summary": "One delivery, with the event as it was sent",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The webhook's id.",
            "schema": {
              "type": "string",
              "example": "wh_a1b2c3d4e5f6g7h8"
            }
          },
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "description": "The event's id (X-App2email-Delivery, or 'id' in the event).",
            "schema": {
              "type": "string",
              "example": "evt_Xq3k9m2"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "y5wdn",
                  "delivery": {
                    "event_id": "evt_Xq3k9m2",
                    "type": "message.status",
                    "created": "2026-10-26T01:12:11Z",
                    "delivered": false,
                    "attempts": [
                      {
                        "at": "2026-10-26T01:12:11Z",
                        "ok": false,
                        "http_status": 503,
                        "ms": 2001,
                        "error": "timeout"
                      }
                    ],
                    "event_body": {
                      "id": "evt_Xq3k9m2",
                      "type": "message.status",
                      "created": "2026-10-26T01:12:11Z",
                      "number": "4976659348270",
                      "data": {
                        "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA=",
                        "to": "61412345678",
                        "status": "delivered",
                        "timestamp": "2026-10-26T01:12:11Z"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "description": "Every try, and next_attempt_at while a retry is planned. event_body only with a key that also has messages:read.",
        "x-a2e-scope": "webhooks:manage",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "delivery_not_found",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live",
          "webhook_not_found"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/webhooks/{id}/deliveries/{event_id}/redeliver": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "redeliverWebhookEvent",
        "summary": "Send a stored event again",
        "description": "The same event (same id, same body) is sent to the webhook's URL once, now, and the answer says how the URL responded. Needs the 'webhooks:manage' scope. An event that is being sent right now (its first try or a planned retry): 409 delivery_in_progress. Delivered: no more planned retries.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The webhook's id.",
            "schema": {
              "type": "string",
              "example": "wh_a1b2c3d4e5f6g7h8"
            }
          },
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "description": "The event's id.",
            "schema": {
              "type": "string",
              "example": "evt_Xq3k9m2"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The answer of the URL.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookRedeliverResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "z8rjh",
                  "delivered": true,
                  "http_status": 200,
                  "response_ms": 180,
                  "error": null
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "webhooks:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "delivery_in_progress",
          "delivery_not_found",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live",
          "webhook_not_found"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/account/signup": {
      "post": {
        "tags": [
          "Account management"
        ],
        "operationId": "createAccount",
        "summary": "Start an account for a person (agent sign-up)",
        "description": "No key. E-mails the person a link to confirm; nothing is created until they do. Then they connect their WhatsApp number and pay. Every call makes a new sign-up, key and e-mail: an open sign-up of the same address is replaced (its link and management_key stop working). An address that has an account is never linked: the person creates an account key on the dashboard instead. Limits: per address, per e-mail address and in all (429 too_many_signups).",
        "security": [],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Requested. The management_key is shown once.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountSignupResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "kq3vd",
                  "signup_id": "su_Q7pX2mLw9Rk4Tz1b",
                  "status": "pending_email",
                  "management_key": "a2e_acct_ZTNmMV9hY2N0X0V4YW1wbGVLZXlFeGFtcGxlS2V5RXhhbXBsZUs.Ex4mpl3S1gn0",
                  "onboarding_link": "https://www.app2email.com/agent-signup/su_Q7pX2mLw9Rk4Tz1b",
                  "expires_at": "2026-11-08T09:00:00Z",
                  "next_steps": [
                    "The person opens the link e-mailed to a***@acme-bakery.example and confirms (before 2026-11-08T09:00:00Z).",
                    "If they have an app2email account already, nothing changes: they create an account key at https://www.app2email.com/dashboard/account-keys and give it to you instead.",
                    "Then call get_account_status again."
                  ],
                  "message": "Account requested. We e-mailed a link to a***@acme-bakery.example: the person opens it to confirm, then connects their WhatsApp number and chooses a plan. Give them the onboarding_link too. Keep the management_key (it is shown once) and send it as Authorization: Bearer <management_key> on every later call to https://api.app2email.com/mcp/manage. get_account_status says what is still needed."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "account_service_error",
          "account_service_unavailable",
          "email_not_sent",
          "internal_error",
          "invalid_contact_email",
          "invalid_json",
          "invalid_plan",
          "rate_limited",
          "route_not_found",
          "too_many_signups",
          "unsupported_content_type"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountSignupRequest"
              },
              "example": {
                "contact_email": "ann@acme-bakery.example",
                "business_name": "Acme Bakery",
                "plan": "standard_5000"
              }
            }
          }
        },
        "x-a2e-mcp-tool": "create_account",
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      }
    },
    "/v1/account": {
      "get": {
        "tags": [
          "Account management"
        ],
        "operationId": "getAccount",
        "summary": "Account status and what is still needed",
        "description": "pending_email, pending_whatsapp, pending_payment or live, with the numbers and next steps. Works with the management_key before the person confirms.",
        "security": [
          {
            "AccountKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "The account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountStatusResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "m2xpa",
                  "account": {
                    "status": "pending_payment",
                    "email": "ann@acme-bakery.example",
                    "name": "ann@acme-bakery.example",
                    "numbers": [
                      {
                        "number": "4976659348270",
                        "display_number": "+49 7665 9348270",
                        "name": "Acme Bakery",
                        "status": "pending_payment",
                        "service_status": "LIVE",
                        "plan": "TRIAL",
                        "plan_label": "Trial",
                        "api_allowed": false,
                        "billing_period_end": null,
                        "renewal_enabled": false
                      }
                    ],
                    "signup_id": "su_Q7pX2mLw9Rk4Tz1b",
                    "signup_expires": null
                  },
                  "key": {
                    "id": "ak_Hc4dR8sLm2Qv9Xw1",
                    "name": "Management key (create_account)",
                    "scopes": [
                      "account:read",
                      "account:manage",
                      "keys:manage",
                      "billing:read",
                      "webhooks:manage"
                    ]
                  },
                  "next_steps": [
                    "Call get_payment_link with the number +4976659348270 and a plan from list_plans, and give the link to the person. Or the person chooses a plan at https://www.app2email.com/pricing.",
                    "Then call get_account_status again."
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "missing_api_key",
          "rate_limited",
          "route_not_found"
        ],
        "x-a2e-mcp-tool": "get_account_status",
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      }
    },
    "/v1/account/plans": {
      "get": {
        "tags": [
          "Account management"
        ],
        "operationId": "listAccountPlans",
        "summary": "Plans that can be bought",
        "description": "Prices in US$, messages per month, and whether the plan includes the API. No key.",
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "The plans.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountPlansResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "p1qza",
                  "currency": "USD",
                  "yearly_discount": 0.2,
                  "plans": [
                    {
                      "id": "standard_5000",
                      "type": "standard",
                      "label": "Standard 5,000",
                      "messages_per_month": 5000,
                      "price_monthly": 5,
                      "price_yearly": 48,
                      "api": true,
                      "email_bridge": false,
                      "includes": "WhatsApp broadcasts, auto reply and the integrations API (REST, n8n, Zapier, Make, Power Automate, OpenClaw, A2A)."
                    },
                    {
                      "id": "professional_5000",
                      "type": "professional",
                      "label": "Professional 5,000",
                      "messages_per_month": 5000,
                      "price_monthly": 6,
                      "price_yearly": 57.6,
                      "api": true,
                      "email_bridge": true,
                      "includes": "Everything in Standard, plus the WhatsApp to email bridge: messages arrive in your inbox and your email replies go back to WhatsApp."
                    }
                  ],
                  "note": "Messages per month count WhatsApp and e-mail messages together. Meta charges for WhatsApp messages separately. Only plans with api: true can use the API and MCP."
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "account_service_error",
          "account_service_unavailable",
          "internal_error",
          "rate_limited"
        ],
        "x-a2e-mcp-tool": "list_plans",
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      }
    },
    "/v1/account/numbers": {
      "get": {
        "tags": [
          "Account management"
        ],
        "operationId": "listAccountNumbers",
        "summary": "The account's WhatsApp numbers",
        "description": "Every number the account owns, with its status and plan.",
        "security": [
          {
            "AccountKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "The numbers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountNumbersResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "t7cna",
                  "numbers": [
                    {
                      "number": "4976659348270",
                      "display_number": "+49 7665 9348270",
                      "name": "Acme Bakery",
                      "status": "live",
                      "service_status": "LIVE",
                      "plan": "standard_5000",
                      "plan_label": "Standard 5,000",
                      "api_allowed": true,
                      "billing_period_end": "2026-12-06T00:00:00Z",
                      "renewal_enabled": true
                    }
                  ],
                  "count": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "account:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_not_confirmed",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "missing_api_key",
          "rate_limited",
          "route_not_found"
        ],
        "x-a2e-mcp-tool": "list_numbers",
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      }
    },
    "/v1/account/numbers/{number}": {
      "get": {
        "tags": [
          "Account management"
        ],
        "operationId": "getAccountNumber",
        "summary": "One number of the account",
        "description": "Its status, plan and billing period.",
        "security": [
          {
            "AccountKey": []
          }
        ],
        "parameters": [
          {
            "name": "number",
            "in": "path",
            "required": true,
            "description": "A WhatsApp number of the account: country code first, digits only.",
            "schema": {
              "type": "string",
              "example": "4976659348270",
              "pattern": "^[0-9]{8,15}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The number.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountNumberResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "t8dnb",
                  "number": {
                    "number": "4976659348270",
                    "display_number": "+49 7665 9348270",
                    "name": "Acme Bakery",
                    "status": "live",
                    "service_status": "LIVE",
                    "plan": "standard_5000",
                    "plan_label": "Standard 5,000",
                    "api_allowed": true,
                    "billing_period_end": "2026-12-06T00:00:00Z",
                    "renewal_enabled": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "account:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_not_confirmed",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_number_in_url",
          "missing_api_key",
          "number_not_found",
          "rate_limited",
          "route_not_found"
        ],
        "x-a2e-mcp-tool": null,
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      }
    },
    "/v1/account/numbers/{number}/keys": {
      "get": {
        "tags": [
          "Account management"
        ],
        "operationId": "listNumberKeys",
        "summary": "The keys of a number",
        "description": "Name, permissions, sandbox, last use. Never the keys themselves.",
        "security": [
          {
            "AccountKey": []
          }
        ],
        "parameters": [
          {
            "name": "number",
            "in": "path",
            "required": true,
            "description": "A WhatsApp number of the account: country code first, digits only.",
            "schema": {
              "type": "string",
              "example": "4976659348270",
              "pattern": "^[0-9]{8,15}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The keys.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountNumberKeysResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "u2kfa",
                  "number": "4976659348270",
                  "keys": [
                    {
                      "id": 1234,
                      "name": "Support agent",
                      "prefix": "a2e_",
                      "first4": "ZDQ3",
                      "last4": "Sgn1",
                      "scopes": [
                        "messages:send",
                        "messages:read"
                      ],
                      "ip_allow": [],
                      "created": "2026-11-06T09:10:00Z",
                      "last_used": null,
                      "expires": null,
                      "sandbox": true,
                      "daily_cap": 0,
                      "approval_above": 0
                    }
                  ],
                  "count": 1,
                  "default_key": {
                    "exists": true,
                    "first4": "Y2Vj",
                    "last4": "hoWM"
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "keys:manage",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_not_confirmed",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_number_in_url",
          "missing_api_key",
          "number_not_found",
          "rate_limited",
          "route_not_found"
        ],
        "x-a2e-mcp-tool": "list_number_keys",
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      },
      "post": {
        "tags": [
          "Account management"
        ],
        "operationId": "createNumberKey",
        "summary": "Create a key for a number",
        "description": "The same key the dashboard makes, for /v1/{number}/... and the messaging MCP. Shown once. Sandbox unless \"sandbox\": false. The number must be live; at most 10 keys per number.",
        "security": [
          {
            "AccountKey": []
          }
        ],
        "parameters": [
          {
            "name": "number",
            "in": "path",
            "required": true,
            "description": "A WhatsApp number of the account: country code first, digits only.",
            "schema": {
              "type": "string",
              "example": "4976659348270",
              "pattern": "^[0-9]{8,15}$"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "The key (shown once).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountNumberKeyCreated"
                },
                "example": {
                  "success": true,
                  "request_id": "u3lgb",
                  "api_key": "a2e_ZDQ3Y191c2VyXzQ5NzY2NTkzNDgyNzBfMTc2MjQwMDAwMDAwMA.Ex4mpl3S1gn1",
                  "key": {
                    "id": 1234,
                    "name": "Support agent",
                    "prefix": "a2e_",
                    "first4": "ZDQ3",
                    "last4": "Sgn1",
                    "scopes": [
                      "messages:send",
                      "messages:read"
                    ],
                    "ip_allow": [],
                    "created": "2026-11-06T09:10:00Z",
                    "last_used": null,
                    "expires": null,
                    "sandbox": true,
                    "daily_cap": 0,
                    "approval_above": 0
                  },
                  "number": "4976659348270",
                  "message": "The key is shown only this once. Send it as Authorization: Bearer <api_key> to https://api.app2email.com/v1/4976659348270/... or https://api.app2email.com/mcp. It is a sandbox key: nothing is sent to WhatsApp."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "keys:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_not_confirmed",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_json",
          "invalid_key_request",
          "invalid_number_in_url",
          "key_limit_reached",
          "key_limits_unavailable",
          "missing_api_key",
          "number_not_found",
          "number_not_live",
          "rate_limited",
          "route_not_found",
          "unsupported_content_type"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountNumberKeyRequest"
              },
              "example": {
                "name": "Support agent",
                "scopes": "send",
                "sandbox": true
              }
            }
          }
        },
        "x-a2e-mcp-tool": "create_number_key",
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      }
    },
    "/v1/account/numbers/{number}/keys/{key_id}": {
      "delete": {
        "tags": [
          "Account management"
        ],
        "operationId": "revokeNumberKey",
        "summary": "Revoke a key of a number",
        "description": "Calls with it fail within 10 seconds. Cannot be undone.",
        "security": [
          {
            "AccountKey": []
          }
        ],
        "parameters": [
          {
            "name": "number",
            "in": "path",
            "required": true,
            "description": "A WhatsApp number of the account: country code first, digits only.",
            "schema": {
              "type": "string",
              "example": "4976659348270",
              "pattern": "^[0-9]{8,15}$"
            }
          },
          {
            "name": "key_id",
            "in": "path",
            "required": true,
            "description": "The key's id (from the list).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "example": 1234
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountRevokeResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "u4mhc",
                  "revoked": true,
                  "key_id": 1234,
                  "number": "4976659348270",
                  "message": "Revoked. The API refuses the key within 10 seconds."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "keys:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_not_confirmed",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_number_in_url",
          "key_not_found",
          "missing_api_key",
          "number_not_found",
          "rate_limited",
          "route_not_found"
        ],
        "x-a2e-mcp-tool": "revoke_number_key",
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      }
    },
    "/v1/account/numbers/{number}/checkout": {
      "post": {
        "tags": [
          "Account management"
        ],
        "operationId": "createNumberCheckout",
        "summary": "Payment link for a plan of a number",
        "description": "A Stripe Checkout link for the person. Nothing is charged until they pay; the plan starts when Stripe confirms it. 409 plan_already_active for the plan the number has.",
        "security": [
          {
            "AccountKey": []
          }
        ],
        "parameters": [
          {
            "name": "number",
            "in": "path",
            "required": true,
            "description": "A WhatsApp number of the account: country code first, digits only.",
            "schema": {
              "type": "string",
              "example": "4976659348270",
              "pattern": "^[0-9]{8,15}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The link.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountCheckoutResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "c5rkd",
                  "number": "4976659348270",
                  "plan": {
                    "id": "standard_5000",
                    "label": "Standard 5,000",
                    "messages_per_month": 5000,
                    "price": 5,
                    "currency": "USD",
                    "interval": "month"
                  },
                  "checkout_url": "https://checkout.stripe.com/c/pay/cs_live_a1B2c3D4e5F6g7H8",
                  "expires_at": "2026-11-07T09:15:00Z",
                  "test_mode": false,
                  "message": "Give this link to the person. Nothing is charged until they pay; the plan starts when Stripe confirms the payment."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "account:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_not_confirmed",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_json",
          "invalid_number_in_url",
          "invalid_plan",
          "missing_api_key",
          "number_not_found",
          "payment_link_failed",
          "plan_already_active",
          "plan_not_available",
          "rate_limited",
          "route_not_found",
          "unsupported_content_type"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountCheckoutRequest"
              },
              "example": {
                "plan": "standard_5000",
                "yearly": false
              }
            }
          }
        },
        "x-a2e-mcp-tool": "get_payment_link",
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      }
    },
    "/v1/account/usage": {
      "get": {
        "tags": [
          "Account management"
        ],
        "operationId": "getAccountUsage",
        "summary": "Messages used this billing month, per number",
        "description": "Sent (WhatsApp + e-mail) against each plan's limit, and the totals.",
        "security": [
          {
            "AccountKey": []
          }
        ],
        "parameters": [
          {
            "name": "number",
            "in": "query",
            "required": false,
            "description": "Only this number (digits).",
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{8,15}$",
              "example": "4976659348270"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The usage.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountUsageResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "g6sle",
                  "numbers": [
                    {
                      "number": "4976659348270",
                      "plan": "standard_5000",
                      "service_status": "LIVE",
                      "billing_period": {
                        "start": "2026-11-01T00:00:00Z",
                        "end": "2026-12-01T00:00:00Z"
                      },
                      "plan_messages": {
                        "whatsapp_sent": 1240,
                        "emails_sent": 0,
                        "total_sent": 1240,
                        "limit": 5000,
                        "left": 3760
                      },
                      "messages_received_this_billing_month": 310
                    }
                  ],
                  "totals": {
                    "total_sent": 1240,
                    "whatsapp_sent": 1240,
                    "emails_sent": 0
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "billing:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_not_confirmed",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_number_in_url",
          "missing_api_key",
          "number_not_found",
          "rate_limited",
          "route_not_found"
        ],
        "x-a2e-mcp-tool": "get_usage",
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      }
    },
    "/v1/account/keys": {
      "get": {
        "tags": [
          "Account management"
        ],
        "operationId": "listAccountKeys",
        "summary": "Account keys",
        "description": "The account's keys (never the keys themselves), management keys of agent sign-ups included.",
        "security": [
          {
            "AccountKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "The keys.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountKeysResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "k7tmf",
                  "keys": [
                    {
                      "id": "ak_Hc4dR8sLm2Qv9Xw1",
                      "name": "Billing agent",
                      "scopes": [
                        "account:read",
                        "billing:read"
                      ],
                      "prefix": "a2e_acct_",
                      "first4": "ZTNm",
                      "last4": "Sgn0",
                      "created": "2026-11-06T09:20:00Z",
                      "created_by": "api",
                      "last_used": null,
                      "expires": null,
                      "management_key": false
                    }
                  ],
                  "count": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "account:manage",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_not_confirmed",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "missing_api_key",
          "rate_limited",
          "route_not_found"
        ],
        "x-a2e-mcp-tool": null,
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      },
      "post": {
        "tags": [
          "Account management"
        ],
        "operationId": "createAccountKey",
        "summary": "Create an account key",
        "description": "Shown once. Never more permissions than the calling key has. At most 20 per account.",
        "security": [
          {
            "AccountKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "The key (shown once).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountKeyCreated"
                },
                "example": {
                  "success": true,
                  "request_id": "k8ung",
                  "account_key": "a2e_acct_ZTNmMV9hY2N0X0V4YW1wbGVLZXlFeGFtcGxlS2V5RXhhbXBsZUs.Ex4mpl3S1gn0",
                  "key": {
                    "id": "ak_Hc4dR8sLm2Qv9Xw1",
                    "name": "Billing agent",
                    "scopes": [
                      "account:read",
                      "billing:read"
                    ],
                    "prefix": "a2e_acct_",
                    "first4": "ZTNm",
                    "last4": "Sgn0",
                    "created": "2026-11-06T09:20:00Z",
                    "created_by": "api",
                    "last_used": null,
                    "expires": null,
                    "management_key": false
                  },
                  "message": "The key is shown only this once. Send it as Authorization: Bearer <account_key>."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "account:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_not_confirmed",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_json",
          "invalid_key_request",
          "key_limit_reached",
          "missing_api_key",
          "rate_limited",
          "route_not_found",
          "unsupported_content_type"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountKeyRequest"
              },
              "example": {
                "name": "Billing agent",
                "scopes": "read"
              }
            }
          }
        },
        "x-a2e-mcp-tool": null,
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      }
    },
    "/v1/account/keys/{key_id}": {
      "delete": {
        "tags": [
          "Account management"
        ],
        "operationId": "revokeAccountKey",
        "summary": "Revoke an account key",
        "description": "Also the key of this request. Cannot be undone.",
        "security": [
          {
            "AccountKey": []
          }
        ],
        "parameters": [
          {
            "name": "key_id",
            "in": "path",
            "required": true,
            "description": "The account key's id (from GET /v1/account/keys).",
            "schema": {
              "type": "string",
              "example": "ak_Hc4dR8sLm2Qv9Xw1"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountRevokeResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "k9voh",
                  "revoked": true,
                  "key_id": "ak_Hc4dR8sLm2Qv9Xw1",
                  "message": "Revoked."
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "account:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_not_confirmed",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "key_not_found",
          "missing_api_key",
          "rate_limited",
          "route_not_found"
        ],
        "x-a2e-mcp-tool": null,
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/analytics/pricing": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "operationId": "getPricingAnalytics",
        "summary": "WhatsApp cost and volume of this number",
        "description": "Meta's pricing_analytics for this number: delivered messages and their cost per period. Estimates, not the invoice.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "Start, ISO 8601. Default: 30 days before until. At most 1 year back.",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-10-01T00:00:00Z"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "description": "End, ISO 8601. Default: now.",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-11-01T00:00:00Z"
            }
          },
          {
            "name": "granularity",
            "in": "query",
            "required": false,
            "description": "Default day.",
            "schema": {
              "type": "string",
              "enum": [
                "half_hour",
                "day",
                "month"
              ],
              "default": "day"
            }
          },
          {
            "name": "countries",
            "in": "query",
            "required": false,
            "description": "Only these countries: comma separated 2-letter codes.",
            "schema": {
              "type": "string",
              "example": "DE,AT"
            }
          },
          {
            "name": "dimensions",
            "in": "query",
            "required": false,
            "description": "Break down by: comma separated category, type, country, tier, phone. Default category,type.",
            "schema": {
              "type": "string",
              "example": "category,type,country"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The data points.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PricingAnalyticsResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "a2p4r",
                  "since": "2026-10-01T00:00:00.000Z",
                  "until": "2026-10-03T00:00:00.000Z",
                  "granularity": "day",
                  "currency": "EUR",
                  "data_points": [
                    {
                      "start": "2026-10-01T00:00:00.000Z",
                      "end": "2026-10-02T00:00:00.000Z",
                      "pricing_category": "MARKETING",
                      "pricing_type": "REGULAR",
                      "volume": 120,
                      "cost": 15.6
                    },
                    {
                      "start": "2026-10-01T00:00:00.000Z",
                      "end": "2026-10-02T00:00:00.000Z",
                      "pricing_category": "SERVICE",
                      "pricing_type": "FREE_CUSTOMER_SERVICE",
                      "volume": 41,
                      "cost": 0
                    },
                    {
                      "start": "2026-10-02T00:00:00.000Z",
                      "end": "2026-10-03T00:00:00.000Z",
                      "pricing_category": "UTILITY",
                      "pricing_type": "REGULAR",
                      "volume": 300,
                      "cost": 6.9
                    }
                  ],
                  "totals": {
                    "volume": 461,
                    "cost": 22.5
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_analytics_query",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_number_in_url",
          "invalid_range",
          "invalid_time",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "range_too_large",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "get_pricing_analytics",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/analytics/messages": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "operationId": "getMessageAnalytics",
        "summary": "Messages sent and delivered, as WhatsApp counts them",
        "description": "Meta's analytics for this number, per period.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "Start, ISO 8601. Default: 30 days before until. At most 1 year back.",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-10-01T00:00:00Z"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "description": "End, ISO 8601. Default: now.",
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-11-01T00:00:00Z"
            }
          },
          {
            "name": "granularity",
            "in": "query",
            "required": false,
            "description": "Default day.",
            "schema": {
              "type": "string",
              "enum": [
                "half_hour",
                "day",
                "month"
              ],
              "default": "day"
            }
          },
          {
            "name": "countries",
            "in": "query",
            "required": false,
            "description": "Only these countries: comma separated 2-letter codes.",
            "schema": {
              "type": "string",
              "example": "DE,AT"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The data points.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageAnalyticsResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "a3m5s",
                  "since": "2026-10-01T00:00:00.000Z",
                  "until": "2026-10-03T00:00:00.000Z",
                  "granularity": "day",
                  "data_points": [
                    {
                      "start": "2026-10-01T00:00:00.000Z",
                      "end": "2026-10-02T00:00:00.000Z",
                      "sent": 161,
                      "delivered": 155
                    },
                    {
                      "start": "2026-10-02T00:00:00.000Z",
                      "end": "2026-10-03T00:00:00.000Z",
                      "sent": 300,
                      "delivered": 291
                    }
                  ],
                  "totals": {
                    "sent": 461,
                    "delivered": 446
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_analytics_query",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_number_in_url",
          "invalid_range",
          "invalid_time",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "range_too_large",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "get_message_analytics",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/activity": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "operationId": "getAccountActivity",
        "summary": "The WhatsApp Business Account's activity log",
        "description": "Newest first: registrations, PIN and partner changes, billing, templates. Covers every number on the WABA.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many (1 to 100, default 25).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The next_cursor of the previous answer.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The activities.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountActivityResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "a4c6t",
                  "activities": [
                    {
                      "id": "1234567890123",
                      "event_type": "PHONE_NUMBER_REGISTERED_ON_CLOUD_API",
                      "category": "PHONE_NUMBER",
                      "actor_id": "61550000000001",
                      "time": "2026-11-05T22:14:03.000Z"
                    },
                    {
                      "id": "1234567890122",
                      "event_type": "TWO_STEP_VERIFICATION_PIN_CHANGED",
                      "category": "PHONE_NUMBER",
                      "actor_id": "61550000000001",
                      "time": "2026-11-05T22:13:40.000Z"
                    }
                  ],
                  "count": 2,
                  "next_cursor": "QVFIUmFfVEhuS2xOZA"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_limit",
          "invalid_number_in_url",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "get_account_activity",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/conversions/dataset": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "operationId": "getConversionsDataset",
        "summary": "The Conversions API dataset of the account",
        "description": "404 dataset_not_found: create it first.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "The dataset.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversionsDatasetResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "a5d7u",
                  "dataset": {
                    "id": "1265431020859743",
                    "name": "WhatsApp conversions"
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-needs": "Meta permission: whatsapp_business_manage_events (Advanced access)",
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "dataset_not_found",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_number_in_url",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null
      },
      "post": {
        "tags": [
          "Analytics"
        ],
        "operationId": "createConversionsDataset",
        "summary": "Create the Conversions API dataset",
        "description": "One per WhatsApp Business Account. Answer 201.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversionsDatasetResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "a6e8v",
                  "dataset": {
                    "id": "1265431020859743",
                    "name": "WhatsApp conversions"
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConversionsDatasetRequest"
              },
              "example": {
                "name": "WhatsApp conversions"
              }
            }
          }
        },
        "x-a2e-needs": "Meta permission: whatsapp_business_manage_events (Advanced access)",
        "x-a2e-scope": "settings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_json",
          "invalid_number_in_url",
          "invalid_setting",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "sandbox_key",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null
      }
    },
    "/v1/{number}/conversions/dataset/quality": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "operationId": "getConversionsDatasetQuality",
        "summary": "Quality of the Conversions API dataset",
        "description": "Meta's dataset quality: event match quality, coverage, freshness. fields: Meta's field list (default: all of these).",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "description": "Meta's field list, eg web{event_match_quality,event_name}.",
            "schema": {
              "type": "string",
              "example": "web{event_match_quality{composite_score},event_name}"
            }
          },
          {
            "name": "agent_name",
            "in": "query",
            "required": false,
            "description": "Only the events a partner integration sent.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Meta's figures.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatasetQualityResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "a8g0x",
                  "dataset_id": "1265431020859743",
                  "quality": {
                    "web": [
                      {
                        "event_name": "Purchase",
                        "event_match_quality": {
                          "composite_score": 6.2,
                          "match_key_feedback": [
                            {
                              "identifier": "ctwa_clid",
                              "coverage": {
                                "percentage": 92.5
                              }
                            }
                          ]
                        },
                        "event_coverage": {
                          "percentage": 71.3
                        },
                        "data_freshness": {
                          "upload_frequency": "real_time"
                        }
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-needs": "Meta permission: whatsapp_business_manage_events (Advanced access)",
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "dataset_not_found",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_analytics_query",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_number_in_url",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null
      }
    },
    "/v1/{number}/conversions/events": {
      "post": {
        "tags": [
          "Analytics"
        ],
        "operationId": "sendConversionEvents",
        "summary": "Send conversion events of WhatsApp chats",
        "description": "Up to 1,000 events to the account's dataset (eg a Purchase after a click-to-WhatsApp ad). Defaults: action_source, messaging_channel, the WABA id.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "Taken by Meta.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversionEventsResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "a7f9w",
                  "dataset_id": "1265431020859743",
                  "events_received": 1,
                  "fbtrace_id": "AbCdEfGh1234"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConversionEventsRequest"
              },
              "example": {
                "data": [
                  {
                    "event_name": "Purchase",
                    "event_time": 1793926800,
                    "user_data": {
                      "ctwa_clid": "ARAkLkA8rmlFeiCktEJQ-QTwRiyYHAFDLMNDBH0CD3qpjd0HR4irJ6LEkR7JwFF4XvnO2E4Nx0-eM-GABDLOPaOdRMv-_zfUQ2a"
                    },
                    "custom_data": {
                      "currency": "EUR",
                      "value": 49.9
                    }
                  }
                ]
              }
            }
          }
        },
        "x-a2e-needs": "Meta permission: whatsapp_business_manage_events (Advanced access)",
        "x-a2e-scope": "messages:send",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "dataset_not_found",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_conversion_events",
          "invalid_cursor",
          "invalid_json",
          "invalid_number_in_url",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "sandbox_key",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null
      }
    },
    "/v1/{number}/bookings": {
      "get": {
        "tags": [
          "Bookings"
        ],
        "operationId": "listBookings",
        "summary": "The appointments, soonest start first",
        "description": "Scope: `bookings:manage` (or `messages:read`). Booked on WhatsApp, from the dashboard or through the API. Filter by a range of days (business time zone) or times, a status, or one contact; `order=desc` for the latest start first. Page with `next_cursor`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Only appointments starting at or after this day (YYYY-MM-DD, business time zone) or ISO 8601 time.",
            "schema": {
              "type": "string",
              "example": "2026-11-10"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "Only appointments starting on or before this day (YYYY-MM-DD, included) or before this ISO 8601 time.",
            "schema": {
              "type": "string",
              "example": "2026-11-16"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only this status.",
            "schema": {
              "type": "string",
              "enum": [
                "confirmed",
                "cancelled",
                "completed",
                "no_show"
              ]
            }
          },
          {
            "name": "contact",
            "in": "query",
            "required": false,
            "description": "Only this customer (number with country code, or business-scoped user id).",
            "schema": {
              "type": "string",
              "example": "61412345678"
            }
          },
          {
            "name": "provider_id",
            "in": "query",
            "required": false,
            "description": "Only this staff member's appointments (GET /bookings/staff).",
            "schema": {
              "type": "string",
              "example": "maria"
            }
          },
          {
            "name": "upcoming",
            "in": "query",
            "required": false,
            "description": "true: confirmed appointments starting now or later, soonest first (status, from, to and order are then ignored).",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Appointments whose customer name, reference or number contains this text.",
            "schema": {
              "type": "string",
              "example": "smith"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "asc: soonest start first (default). desc: latest start first.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "asc"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many (1 to 200, default 50).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The next_cursor of the previous answer, unchanged. Leave out for the first page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The appointments.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingsResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "b1kq2",
                  "bookings": [
                    {
                      "id": 42,
                      "reference": "BK-7Q3M2A",
                      "status": "confirmed",
                      "contact": "61412345678",
                      "contact_name": "John Smith",
                      "contact_email": "john@example.com",
                      "service": {
                        "id": "haircut",
                        "name": "Haircut",
                        "duration_min": 30
                      },
                      "start": "2026-11-09T22:00:00.000Z",
                      "end": "2026-11-09T22:30:00.000Z",
                      "timezone": "Australia/Sydney",
                      "source": "api",
                      "calendar": {
                        "provider": "google",
                        "event_id": "evt_1a2b3c",
                        "url": "https://calendar.google.com/calendar/event?eid=..."
                      },
                      "answers": {},
                      "notes": "First visit",
                      "provider": {
                        "id": "maria",
                        "name": "Maria"
                      },
                      "credits_used": 0,
                      "created": "2026-11-06T01:12:09.000Z"
                    }
                  ],
                  "next_cursor": null,
                  "count": 1,
                  "order": "asc",
                  "enabled": true,
                  "timezone": "Australia/Sydney"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage|messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_booking",
          "invalid_cursor",
          "invalid_limit",
          "invalid_number",
          "invalid_number_in_url",
          "invalid_range",
          "invalid_status",
          "invalid_time",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "list_bookings",
        "x-a2e-needs": null
      },
      "post": {
        "tags": [
          "Bookings"
        ],
        "operationId": "createBooking",
        "summary": "Book an appointment for a customer at a free slot",
        "description": "Scope: `bookings:manage`. Not with a sandbox key. The slot must be one of GET /bookings/availability (on the grid, inside the hours, free; the business's own minimum notice does not apply). The customer gets the confirmation on WhatsApp (a text with a calendar file inside their 24 hour window, else the booking confirmation template) unless `notify` is false; the business gets an email, the calendar event is written, and `booking.created` is sent (with `hold: true` when made from a hold). 409 `booking_slot_taken` when the time went meanwhile. To book a time kept with POST /bookings/holds, send its `hold` reference. Send an `Idempotency-Key` header to retry safely: the same key and body within 24 hours gets the first answer again.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A unique value for this message or list (eg a UUID). The same request with the same key within 24 hours gets the first answer again, and nothing is sent twice. Ignored by dry runs.",
            "schema": {
              "type": "string",
              "maxLength": 255,
              "example": "order-1234-shipped"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BookingCreateRequest"
              },
              "example": {
                "contact": "61412345678",
                "service_id": "haircut",
                "start": "2026-11-10T09:00",
                "name": "John Smith",
                "email": "john@example.com",
                "notes": "First visit",
                "provider_id": "maria",
                "notify": true
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Booked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "b2mz7",
                  "booking": {
                    "id": 42,
                    "reference": "BK-7Q3M2A",
                    "status": "confirmed",
                    "contact": "61412345678",
                    "contact_name": "John Smith",
                    "contact_email": "john@example.com",
                    "service": {
                      "id": "haircut",
                      "name": "Haircut",
                      "duration_min": 30
                    },
                    "start": "2026-11-09T22:00:00.000Z",
                    "end": "2026-11-09T22:30:00.000Z",
                    "timezone": "Australia/Sydney",
                    "source": "api",
                    "calendar": {
                      "provider": "google",
                      "event_id": "evt_1a2b3c",
                      "url": "https://calendar.google.com/calendar/event?eid=..."
                    },
                    "answers": {},
                    "notes": "First visit",
                    "provider": {
                      "id": "maria",
                      "name": "Maria"
                    },
                    "credits_used": 0,
                    "created": "2026-11-06T01:12:09.000Z"
                  },
                  "note": "Booked. The customer gets the confirmation on WhatsApp (a text inside their 24 hour window, else the booking confirmation template)."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "approval_body_too_large",
          "background_start_failed",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "booking_not_enabled",
          "booking_slot_taken",
          "broadcast_cancelled",
          "bsuid_not_supported",
          "call_permission_required",
          "caption_not_supported",
          "caption_too_long",
          "daily_cap_reached",
          "display_name_not_approved",
          "duplicate_recipients",
          "free_form_single_recipient",
          "hold_expired",
          "hold_not_found",
          "idempotency_key_reused",
          "idempotency_request_in_progress",
          "idempotency_request_interrupted",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_base64",
          "invalid_booking",
          "invalid_callback_data",
          "invalid_components",
          "invalid_contacts_message",
          "invalid_coupon",
          "invalid_cursor",
          "invalid_idempotency_key",
          "invalid_identity_key_hash",
          "invalid_interactive",
          "invalid_json",
          "invalid_location",
          "invalid_marketing_api",
          "invalid_media_link",
          "invalid_number_in_url",
          "invalid_reaction",
          "invalid_recipients",
          "invalid_reply_to",
          "invalid_send_at",
          "invalid_service",
          "invalid_start",
          "invalid_to",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_download_failed",
          "media_too_large",
          "media_type_not_allowed",
          "media_upload_error",
          "media_upload_failed",
          "message_too_old",
          "messaging_limit_restricted",
          "missing_api_key",
          "missing_interactive",
          "missing_media",
          "missing_message_id",
          "missing_template_language",
          "missing_template_name",
          "missing_text",
          "monthly_cap_reached",
          "monthly_limit_reached",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "package_not_found",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "reaction_too_old",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_not_opted_in",
          "recipient_opted_out",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "sandbox_key",
          "schedule_failed",
          "segment_and_recipients",
          "segment_empty",
          "segment_not_found",
          "send_at_in_past",
          "send_at_too_far",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_language_not_found",
          "template_lookup_failed",
          "template_not_approved",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_parameters_invalid",
          "template_paused",
          "template_sample_media_failed",
          "template_text_too_long",
          "text_too_long",
          "to_and_recipients",
          "too_many_messages_to_recipient",
          "too_many_recipients",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "voice_needs_ogg_opus",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [
          "broadcast.completed",
          "message.failed",
          "message.held_for_approval",
          "message.status",
          "usage.threshold"
        ],
        "x-a2e-mcp-tool": "create_booking",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/bookings/availability": {
      "get": {
        "tags": [
          "Bookings"
        ],
        "operationId": "getBookingAvailability",
        "summary": "The free slots per day for a service, as the customer would see them",
        "description": "Scope: `bookings:manage` (or `messages:read`). Every day of the range (at most 32 days, default today + 6) with its free start times: the opening hours, the closed days, the booked appointments and the calendar's busy time applied. Each slot's `id` is the local time `POST /bookings` takes as `start`. With staff members, `providers` names who is free; `provider_id` asks for one member's own availability.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "service_id",
            "in": "query",
            "required": false,
            "description": "The service (config.services[].id).",
            "schema": {
              "type": "string",
              "example": "haircut"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "The first day, YYYY-MM-DD in the business time zone. Default today.",
            "schema": {
              "type": "string",
              "example": "2026-11-10"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "The last day (included). Default from + 6 days; at most 32 days.",
            "schema": {
              "type": "string",
              "example": "2026-11-16"
            }
          },
          {
            "name": "provider_id",
            "in": "query",
            "required": false,
            "description": "One staff member's own availability (config.providers[].id). Left out: anyone available.",
            "schema": {
              "type": "string",
              "example": "maria"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The days and their slots.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AvailabilityResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "a9xw1",
                  "timezone": "Australia/Sydney",
                  "enabled": true,
                  "days": [
                    {
                      "date": "2026-11-10",
                      "slots": [
                        {
                          "id": "2026-11-10T09:00",
                          "title": "9:00 AM",
                          "start": "2026-11-09T22:00:00.000Z",
                          "end": "2026-11-09T22:30:00.000Z",
                          "providers": [
                            "maria",
                            "tom"
                          ]
                        },
                        {
                          "id": "2026-11-10T09:30",
                          "title": "9:30 AM",
                          "start": "2026-11-09T22:30:00.000Z",
                          "end": "2026-11-09T23:00:00.000Z",
                          "providers": [
                            "tom"
                          ]
                        }
                      ]
                    },
                    {
                      "date": "2026-11-11",
                      "slots": []
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage|messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "booking_not_enabled",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_booking",
          "invalid_number_in_url",
          "invalid_range",
          "invalid_service",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "range_too_large",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "get_booking_availability",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/bookings/reports": {
      "get": {
        "tags": [
          "Bookings"
        ],
        "operationId": "getBookingReports",
        "summary": "The booking numbers of the last 7, 30 or 90 days",
        "description": "Scope: `bookings:manage` (or `messages:read`). Bookings by source, completed, cancelled (by whom), no-shows and the no-show rate, the CSAT average and responses, reminders sent, Flow sessions started and completed, the top services, bookings per staff member and nudges sent. `format=csv` gives the same as metric,value lines.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "description": "The range: the last 7, 30 (default) or 90 days.",
            "schema": {
              "type": "integer",
              "enum": [
                7,
                30,
                90
              ],
              "default": 30
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "csv: a text/csv answer.",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The report.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingReportResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "r5mpk",
                  "days": 30,
                  "from": "2026-10-07T01:00:00.000Z",
                  "to": "2026-11-06T01:00:00.000Z",
                  "bookings": {
                    "total": 48,
                    "by_source": {
                      "whatsapp_flow": 40,
                      "dashboard": 5,
                      "api": 3
                    }
                  },
                  "completed": 39,
                  "cancelled": {
                    "total": 4,
                    "by": {
                      "customer": 3,
                      "business": 1
                    }
                  },
                  "no_shows": 2,
                  "no_show_rate": 0.0488,
                  "csat": {
                    "average": 4.6,
                    "responses": 21
                  },
                  "reminders_sent": 41,
                  "sessions": {
                    "started": 62,
                    "completed": 40,
                    "conversion": 0.6452
                  },
                  "top_services": [
                    {
                      "id": "haircut",
                      "name": "Haircut",
                      "count": 30
                    },
                    {
                      "id": "colour",
                      "name": "Colour",
                      "count": 18
                    }
                  ],
                  "per_provider": [
                    {
                      "id": "maria",
                      "name": "Maria",
                      "count": 28
                    },
                    {
                      "id": "tom",
                      "name": "Tom",
                      "count": 20
                    }
                  ],
                  "nudges": {
                    "rebook": 9
                  }
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage|messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "invalid_range",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "get_booking_reports",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/bookings/{id}": {
      "get": {
        "tags": [
          "Bookings"
        ],
        "operationId": "getBooking",
        "summary": "One appointment, by id or reference",
        "description": "Scope: `bookings:manage` (or `messages:read`).",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The booking's id, or its reference (BK-XXXXXX).",
            "schema": {
              "type": "string",
              "example": "BK-7Q3M2A"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The appointment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "b8sva",
                  "booking": {
                    "id": 42,
                    "reference": "BK-7Q3M2A",
                    "status": "confirmed",
                    "contact": "61412345678",
                    "contact_name": "John Smith",
                    "contact_email": "john@example.com",
                    "service": {
                      "id": "haircut",
                      "name": "Haircut",
                      "duration_min": 30
                    },
                    "start": "2026-11-09T22:00:00.000Z",
                    "end": "2026-11-09T22:30:00.000Z",
                    "timezone": "Australia/Sydney",
                    "source": "api",
                    "calendar": {
                      "provider": "google",
                      "event_id": "evt_1a2b3c",
                      "url": "https://calendar.google.com/calendar/event?eid=..."
                    },
                    "answers": {},
                    "notes": "First visit",
                    "provider": {
                      "id": "maria",
                      "name": "Maria"
                    },
                    "credits_used": 0,
                    "created": "2026-11-06T01:12:09.000Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage|messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "booking_not_found",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      },
      "patch": {
        "x-a2e-webhook-events": [
          "booking.updated"
        ],
        "tags": [
          "Calendar"
        ],
        "operationId": "updateBooking",
        "summary": "Change an appointment's details",
        "description": "Scope: `bookings:manage`. Not with a sandbox key. The customer's `name` or `email`, the `notes`, the `answers` and the staff member (`provider_id`: the time must be free for the new one, else 409 `booking_slot_taken`; the calendar event moves too). The time is changed with POST /bookings/{id}/reschedule. `booking.updated` is sent with `changed` naming the fields.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The booking's id, or its reference (BK-XXXXXX).",
            "schema": {
              "type": "string",
              "example": "BK-7Q3M2A"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BookingPatchRequest"
              },
              "example": {
                "notes": "Allergic to ammonia",
                "provider_id": "tom"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Changed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "c9bp1",
                  "booking": {
                    "id": 42,
                    "reference": "BK-7Q3M2A",
                    "status": "confirmed",
                    "contact": "61412345678",
                    "contact_name": "John Smith",
                    "contact_email": "john@example.com",
                    "service": {
                      "id": "haircut",
                      "name": "Haircut",
                      "duration_min": 30
                    },
                    "start": "2026-11-11T23:00:00.000Z",
                    "end": "2026-11-11T23:30:00.000Z",
                    "timezone": "Australia/Sydney",
                    "source": "api",
                    "calendar": {
                      "provider": "google",
                      "event_id": "evt_1a2b3c",
                      "url": null,
                      "error": null
                    },
                    "answers": {},
                    "notes": "First visit",
                    "provider": {
                      "id": "maria",
                      "name": "Maria"
                    },
                    "credits_used": 0,
                    "link_id": null,
                    "notes_count": 1,
                    "created": "2026-11-06T01:12:09.000Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "booking_cancelled",
          "booking_not_enabled",
          "booking_not_found",
          "booking_slot_taken",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_booking",
          "invalid_json",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "nothing_to_change",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "sandbox_key",
          "service_not_live"
        ],
        "x-a2e-mcp-tool": "update_booking",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/bookings/{id}/cancel": {
      "post": {
        "tags": [
          "Bookings"
        ],
        "operationId": "cancelBooking",
        "summary": "Cancel an appointment",
        "description": "Scope: `bookings:manage`. Not with a sandbox key. The calendar event is removed, `booking.cancelled` is sent, and the customer is told on WhatsApp (a text inside their 24 hour window, else the cancellation template) unless `notify` is false. 409 `booking_cancelled` when it already was.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The booking's id, or its reference (BK-XXXXXX).",
            "schema": {
              "type": "string",
              "example": "BK-7Q3M2A"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BookingCancelRequest"
              },
              "example": {
                "reason": "customer asked by phone",
                "notify": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Cancelled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "b3nd4",
                  "booking": {
                    "id": 42,
                    "reference": "BK-7Q3M2A",
                    "status": "cancelled",
                    "contact": "61412345678",
                    "contact_name": "John Smith",
                    "contact_email": "john@example.com",
                    "service": {
                      "id": "haircut",
                      "name": "Haircut",
                      "duration_min": 30
                    },
                    "start": "2026-11-09T22:00:00.000Z",
                    "end": "2026-11-09T22:30:00.000Z",
                    "timezone": "Australia/Sydney",
                    "source": "api",
                    "calendar": {
                      "provider": "google",
                      "event_id": "evt_1a2b3c",
                      "url": "https://calendar.google.com/calendar/event?eid=..."
                    },
                    "answers": {},
                    "notes": "First visit",
                    "provider": {
                      "id": "maria",
                      "name": "Maria"
                    },
                    "credits_used": 0,
                    "created": "2026-11-06T01:12:09.000Z",
                    "cancelled": {
                      "at": "2026-11-07T03:00:00.000Z",
                      "by": "api",
                      "reason": "customer asked by phone"
                    }
                  },
                  "note": "Cancelled. The customer is told on WhatsApp (a text inside their 24 hour window, else the cancellation template)."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "approval_body_too_large",
          "background_start_failed",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "booking_cancelled",
          "booking_not_found",
          "broadcast_cancelled",
          "bsuid_not_supported",
          "call_permission_required",
          "caption_not_supported",
          "caption_too_long",
          "daily_cap_reached",
          "display_name_not_approved",
          "duplicate_recipients",
          "free_form_single_recipient",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_base64",
          "invalid_booking",
          "invalid_callback_data",
          "invalid_components",
          "invalid_contacts_message",
          "invalid_cursor",
          "invalid_identity_key_hash",
          "invalid_interactive",
          "invalid_location",
          "invalid_marketing_api",
          "invalid_media_link",
          "invalid_number_in_url",
          "invalid_reaction",
          "invalid_recipients",
          "invalid_reply_to",
          "invalid_send_at",
          "invalid_to",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_download_failed",
          "media_too_large",
          "media_type_not_allowed",
          "media_upload_error",
          "media_upload_failed",
          "message_too_old",
          "messaging_limit_restricted",
          "missing_api_key",
          "missing_interactive",
          "missing_media",
          "missing_message_id",
          "missing_template_language",
          "missing_template_name",
          "missing_text",
          "monthly_cap_reached",
          "monthly_limit_reached",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "reaction_too_old",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_not_opted_in",
          "recipient_opted_out",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "sandbox_key",
          "schedule_failed",
          "segment_and_recipients",
          "segment_empty",
          "segment_not_found",
          "send_at_in_past",
          "send_at_too_far",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_language_not_found",
          "template_lookup_failed",
          "template_not_approved",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_parameters_invalid",
          "template_paused",
          "template_sample_media_failed",
          "template_text_too_long",
          "text_too_long",
          "to_and_recipients",
          "too_many_messages_to_recipient",
          "too_many_recipients",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "voice_needs_ogg_opus",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [
          "broadcast.completed",
          "message.failed",
          "message.held_for_approval",
          "message.status",
          "usage.threshold"
        ],
        "x-a2e-mcp-tool": "cancel_booking",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/bookings/{id}/status": {
      "post": {
        "tags": [
          "Bookings"
        ],
        "operationId": "setBookingStatus",
        "summary": "Mark an appointment completed, a no-show, or back to confirmed",
        "description": "Scope: `bookings:manage`. Not with a sandbox key. Completed appointments get the follow-up message (aftercare and the rating buttons) when the business turned it on; the reports count both. An appointment that is not marked is completed by itself 24 hours after its end. A cancelled appointment cannot be marked (409 `booking_cancelled`).",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The booking's id, or its reference (BK-XXXXXX).",
            "schema": {
              "type": "string",
              "example": "BK-7Q3M2A"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BookingStatusRequest"
              },
              "example": {
                "status": "completed"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Marked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "b9twc",
                  "booking": {
                    "id": 42,
                    "reference": "BK-7Q3M2A",
                    "status": "completed",
                    "contact": "61412345678",
                    "contact_name": "John Smith",
                    "contact_email": "john@example.com",
                    "service": {
                      "id": "haircut",
                      "name": "Haircut",
                      "duration_min": 30
                    },
                    "start": "2026-11-09T22:00:00.000Z",
                    "end": "2026-11-09T22:30:00.000Z",
                    "timezone": "Australia/Sydney",
                    "source": "api",
                    "calendar": {
                      "provider": "google",
                      "event_id": "evt_1a2b3c",
                      "url": "https://calendar.google.com/calendar/event?eid=..."
                    },
                    "answers": {},
                    "notes": "First visit",
                    "provider": {
                      "id": "maria",
                      "name": "Maria"
                    },
                    "credits_used": 0,
                    "created": "2026-11-06T01:12:09.000Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "booking_cancelled",
          "booking_not_found",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_json",
          "invalid_number_in_url",
          "invalid_status",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "sandbox_key",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [
          "usage.threshold"
        ],
        "x-a2e-mcp-tool": "set_booking_status",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/settings/booking": {
      "get": {
        "tags": [
          "Bookings"
        ],
        "operationId": "getBookingSettings",
        "summary": "The booking settings, the default Flow's status and every Flow",
        "description": "Scope: `bookings:manage` (or `messages:read`). Every key of the configuration with its value (defaults filled in): the trigger words, the hours, the services, the messages, the calendar, the staff members; plus the number's Bookings Flows (as booking_flow in GET /flows).",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "The settings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingSettingsResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "s4bkg",
                  "enabled": true,
                  "configured": true,
                  "timezone": "Australia/Sydney",
                  "key_status": "valid",
                  "validation": [],
                  "config": {
                    "trigger": {
                      "keywords": [
                        "book",
                        "booking",
                        "appointment",
                        "reserve",
                        "reservation",
                        "schedule"
                      ],
                      "new_contact": false,
                      "cancel_keywords": [
                        "cancel"
                      ],
                      "reschedule_keywords": [
                        "reschedule",
                        "change booking"
                      ],
                      "intro_text": "Tap the button below to choose a time that suits you.",
                      "cta": "Book now",
                      "header": "",
                      "footer": ""
                    },
                    "schedule": {
                      "timezone": "Australia/Sydney",
                      "hours": {
                        "mon": [
                          [
                            "09:00",
                            "17:00"
                          ]
                        ],
                        "tue": [
                          [
                            "09:00",
                            "17:00"
                          ]
                        ],
                        "wed": [
                          [
                            "09:00",
                            "17:00"
                          ]
                        ],
                        "thu": [
                          [
                            "09:00",
                            "17:00"
                          ]
                        ],
                        "fri": [
                          [
                            "09:00",
                            "17:00"
                          ]
                        ],
                        "sat": [],
                        "sun": []
                      },
                      "slot_interval_min": 30,
                      "buffer_before_min": 0,
                      "buffer_after_min": 0,
                      "min_notice_min": 120,
                      "max_advance_days": 30,
                      "max_per_slot": 1,
                      "overrides": []
                    },
                    "services": [
                      {
                        "id": "haircut",
                        "name": "Haircut",
                        "duration_min": 30,
                        "description": "",
                        "price": "$40",
                        "enabled": true
                      }
                    ],
                    "details": {
                      "ask_email": true,
                      "ask_notes": true
                    },
                    "messages": {
                      "business_name": "",
                      "location": "12 Example St, Sydney",
                      "confirmation_text": "You're booked: {service} on {date} at {time} ({duration} min). Reference {reference}. Reply CANCEL if your plans change.",
                      "send_ics": true,
                      "notify_email": ""
                    },
                    "calendar": {
                      "provider": "google",
                      "write_calendar_id": "primary",
                      "busy_calendar_ids": [],
                      "event_title": "{service} - {name}",
                      "event_description": "Booked on WhatsApp.\nPhone: +{phone}\nReference: {reference}\n{notes}"
                    },
                    "providers": []
                  },
                  "flow": {
                    "key": "booking",
                    "name": "Appointment booking",
                    "kind": "booking",
                    "enabled": true,
                    "is_default": true,
                    "trigger_keywords": [],
                    "id": "1234567890123456",
                    "status": "published",
                    "can_send": true,
                    "health": "AVAILABLE",
                    "last_published_at": "2026-11-06T00:00:00Z",
                    "updated_at": "2026-11-06T00:00:00.000Z"
                  },
                  "flows": [
                    {
                      "key": "booking",
                      "name": "Appointment booking",
                      "kind": "booking",
                      "enabled": true,
                      "is_default": true,
                      "trigger_keywords": [],
                      "id": "1234567890123456",
                      "status": "published",
                      "can_send": true,
                      "health": "AVAILABLE",
                      "last_published_at": "2026-11-06T00:00:00Z",
                      "updated_at": "2026-11-06T00:00:00.000Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage|messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "get_booking_settings",
        "x-a2e-needs": null
      },
      "put": {
        "tags": [
          "Bookings"
        ],
        "operationId": "updateBookingSettings",
        "summary": "Switch bookings on or off and change the settings",
        "description": "Scope: `bookings:manage`. Not with a sandbox key. `config` is partial: a section object is merged key by key into the stored section, a list (services, providers, schedule.overrides) or a single value replaces what is stored. The whole result is checked against the rules of every section (400 `invalid_setting` with `details.problems`; nothing is saved then). Switching bookings on also creates the utility templates bookings send outside the 24 hour window (Meta reviews them).",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BookingSettingsUpdateRequest"
              },
              "example": {
                "enabled": true,
                "config": {
                  "services": [
                    {
                      "id": "haircut",
                      "name": "Haircut",
                      "duration_min": 30,
                      "price": "$40",
                      "enabled": true
                    },
                    {
                      "id": "colour",
                      "name": "Colour",
                      "duration_min": 90,
                      "price": "$120",
                      "enabled": true
                    }
                  ],
                  "schedule": {
                    "timezone": "Australia/Sydney",
                    "min_notice_min": 60
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved: the settings as they are now.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingSettingsResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "s4bkg",
                  "enabled": true,
                  "configured": true,
                  "timezone": "Australia/Sydney",
                  "key_status": "valid",
                  "validation": [],
                  "config": {
                    "trigger": {
                      "keywords": [
                        "book",
                        "booking",
                        "appointment",
                        "reserve",
                        "reservation",
                        "schedule"
                      ],
                      "new_contact": false,
                      "cancel_keywords": [
                        "cancel"
                      ],
                      "reschedule_keywords": [
                        "reschedule",
                        "change booking"
                      ],
                      "intro_text": "Tap the button below to choose a time that suits you.",
                      "cta": "Book now",
                      "header": "",
                      "footer": ""
                    },
                    "schedule": {
                      "timezone": "Australia/Sydney",
                      "hours": {
                        "mon": [
                          [
                            "09:00",
                            "17:00"
                          ]
                        ],
                        "tue": [
                          [
                            "09:00",
                            "17:00"
                          ]
                        ],
                        "wed": [
                          [
                            "09:00",
                            "17:00"
                          ]
                        ],
                        "thu": [
                          [
                            "09:00",
                            "17:00"
                          ]
                        ],
                        "fri": [
                          [
                            "09:00",
                            "17:00"
                          ]
                        ],
                        "sat": [],
                        "sun": []
                      },
                      "slot_interval_min": 30,
                      "buffer_before_min": 0,
                      "buffer_after_min": 0,
                      "min_notice_min": 120,
                      "max_advance_days": 30,
                      "max_per_slot": 1,
                      "overrides": []
                    },
                    "services": [
                      {
                        "id": "haircut",
                        "name": "Haircut",
                        "duration_min": 30,
                        "description": "",
                        "price": "$40",
                        "enabled": true
                      }
                    ],
                    "details": {
                      "ask_email": true,
                      "ask_notes": true
                    },
                    "messages": {
                      "business_name": "",
                      "location": "12 Example St, Sydney",
                      "confirmation_text": "You're booked: {service} on {date} at {time} ({duration} min). Reference {reference}. Reply CANCEL if your plans change.",
                      "send_ics": true,
                      "notify_email": ""
                    },
                    "calendar": {
                      "provider": "google",
                      "write_calendar_id": "primary",
                      "busy_calendar_ids": [],
                      "event_title": "{service} - {name}",
                      "event_description": "Booked on WhatsApp.\nPhone: +{phone}\nReference: {reference}\n{notes}"
                    },
                    "providers": []
                  },
                  "flow": {
                    "key": "booking",
                    "name": "Appointment booking",
                    "kind": "booking",
                    "enabled": true,
                    "is_default": true,
                    "trigger_keywords": [],
                    "id": "1234567890123456",
                    "status": "published",
                    "can_send": true,
                    "health": "AVAILABLE",
                    "last_published_at": "2026-11-06T00:00:00Z",
                    "updated_at": "2026-11-06T00:00:00.000Z"
                  },
                  "flows": [
                    {
                      "key": "booking",
                      "name": "Appointment booking",
                      "kind": "booking",
                      "enabled": true,
                      "is_default": true,
                      "trigger_keywords": [],
                      "id": "1234567890123456",
                      "status": "published",
                      "can_send": true,
                      "health": "AVAILABLE",
                      "last_published_at": "2026-11-06T00:00:00Z",
                      "updated_at": "2026-11-06T00:00:00.000Z"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "booking_not_enabled",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_json",
          "invalid_media_link",
          "invalid_number_in_url",
          "invalid_optimization_spec",
          "invalid_setting",
          "invalid_slug",
          "invalid_template_category",
          "invalid_template_components",
          "invalid_template_field",
          "invalid_template_language",
          "invalid_template_name",
          "ip_not_allowed",
          "media_too_large",
          "missing_api_key",
          "nothing_to_change",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "sandbox_key",
          "service_not_live",
          "slug_taken",
          "template_already_exists",
          "template_limit_reached",
          "template_name_reserved",
          "template_not_editable",
          "template_rejected",
          "template_sample_media_failed",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "update_booking_settings",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/flows/{key}/send": {
      "post": {
        "tags": [
          "Bookings"
        ],
        "operationId": "sendFlow",
        "summary": "Send a Flow to a contact (the booking form or another form)",
        "description": "Scope: `bookings:manage`. Not with a sandbox key. A Flow of the number's Bookings section, by its `key` (GET /flows). A Flow message is free-form: it can only go to a contact who wrote to the number in the last 24 hours (422 `outside_24h_window`; send an approved template first, then the Flow when they answer). The Flow must be enabled and published (409 `flow_not_published`). The contact's answers come back as `booking.created` (a booking Flow) or `flow.completed` (a form Flow). Counts as one message of the plan.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "description": "The Flow's key (GET /flows).",
            "schema": {
              "type": "string",
              "example": "booking"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FlowSendRequest"
              },
              "example": {
                "contact": "61412345678"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowSendResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "f7rhb",
                  "sent": true,
                  "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBI...",
                  "session_id": 518,
                  "flow": {
                    "key": "booking",
                    "name": "Appointment booking",
                    "kind": "booking"
                  },
                  "contact": "61412345678",
                  "purpose": "book",
                  "note": "Sent. The contact's answers come back as the booking.created event (a booking Flow) or the flow.completed event (a form Flow)."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "booking_not_enabled",
          "booking_not_found",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "flow_not_found",
          "flow_not_published",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_booking",
          "invalid_cursor",
          "invalid_json",
          "invalid_number_in_url",
          "invalid_to",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "sandbox_key",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [
          "usage.threshold"
        ],
        "x-a2e-mcp-tool": "send_flow",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/calendar": {
      "get": {
        "tags": [
          "Calendar"
        ],
        "operationId": "getCalendar",
        "summary": "Everything on the calendar for a range of days",
        "description": "Scope: `bookings:manage` (or `messages:read`). One feed for a range of days (business time zone; default 7 days from today, at most 62): the appointments, the blocked time, the busy time of the connected calendar (our own appointments left out) and the times held right now, each with `start`/`end` in UTC and `start_local`/`end_local`; plus the opening hours per day (overrides applied), the staff and the services. `include` picks any of `bookings,blocks,busy,holds`; cancelled appointments only with `cancelled=true`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "The first day, YYYY-MM-DD in the business time zone. Default today.",
            "schema": {
              "type": "string",
              "example": "2026-11-10"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "The last day (included). Default from + 6 days; at most 62 days.",
            "schema": {
              "type": "string",
              "example": "2026-11-16"
            }
          },
          {
            "name": "provider_id",
            "in": "query",
            "required": false,
            "description": "Only this staff member's entries (and the business-wide ones). Left out: everyone.",
            "schema": {
              "type": "string",
              "example": "maria"
            }
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "description": "Comma list of bookings, blocks, busy, holds. Default: all four.",
            "schema": {
              "type": "string",
              "example": "bookings,blocks"
            }
          },
          {
            "name": "cancelled",
            "in": "query",
            "required": false,
            "description": "true: also the cancelled appointments.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The feed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarFeed"
                },
                "example": {
                  "success": true,
                  "request_id": "c1fd2",
                  "timezone": "Australia/Sydney",
                  "from": "2026-11-10",
                  "to": "2026-11-16",
                  "now_local": "2026-11-11T10:42",
                  "enabled": true,
                  "web": {
                    "enabled": true,
                    "slug": "sample-salon",
                    "url": "https://www.app2email.com/book/sample-salon"
                  },
                  "hours": {
                    "2026-11-12": [
                      [
                        "09:00",
                        "17:00"
                      ]
                    ],
                    "2026-11-14": []
                  },
                  "providers": [
                    {
                      "id": "maria",
                      "name": "Maria",
                      "enabled": true,
                      "services": [
                        "haircut"
                      ],
                      "hours": {
                        "2026-11-12": [
                          [
                            "09:00",
                            "17:00"
                          ]
                        ]
                      }
                    }
                  ],
                  "services": [
                    {
                      "id": "haircut",
                      "name": "Haircut",
                      "duration_min": 30,
                      "price": "$40",
                      "description": "",
                      "enabled": true
                    }
                  ],
                  "events": [
                    {
                      "kind": "booking",
                      "id": 42,
                      "reference": "BK-7Q3M2A",
                      "status": "confirmed",
                      "start": "2026-11-11T23:00:00.000Z",
                      "end": "2026-11-11T23:30:00.000Z",
                      "start_local": "2026-11-12T10:00",
                      "end_local": "2026-11-12T10:30",
                      "service_id": "haircut",
                      "service_name": "Haircut",
                      "duration_min": 30,
                      "provider_id": "maria",
                      "provider_name": "Maria",
                      "contact": "61412345678",
                      "contact_name": "John Smith",
                      "notes_count": 1
                    },
                    {
                      "id": 3,
                      "provider_id": "maria",
                      "title": "Lunch",
                      "notes": "",
                      "start": "2026-11-14T01:00:00.000Z",
                      "end": "2026-11-14T02:00:00.000Z",
                      "start_local": "2026-11-14T12:00",
                      "end_local": "2026-11-14T13:00",
                      "source": "api",
                      "created_by": "API key Planner",
                      "created": "2026-11-11T01:12:09.000Z",
                      "updated": "2026-11-11T01:12:09.000Z",
                      "kind": "block"
                    },
                    {
                      "kind": "busy",
                      "provider_id": "maria",
                      "title": "Busy (Google Calendar)",
                      "start": "2026-11-12T03:00:00.000Z",
                      "end": "2026-11-12T04:00:00.000Z",
                      "start_local": "2026-11-12T14:00",
                      "end_local": "2026-11-12T15:00"
                    },
                    {
                      "kind": "hold",
                      "reference": "BK-4HT9XC",
                      "service_id": "haircut",
                      "service_name": "Haircut",
                      "provider_id": "maria",
                      "name": "John",
                      "start": "2026-11-12T22:00:00.000Z",
                      "end": "2026-11-12T22:30:00.000Z",
                      "start_local": "2026-11-13T09:00",
                      "end_local": "2026-11-13T09:30",
                      "expires": "2026-11-11T01:22:00.000Z"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage|messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "booking_not_enabled",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "invalid_range",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "range_too_large",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "get_calendar",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/calendar/blocks": {
      "get": {
        "tags": [
          "Calendar"
        ],
        "operationId": "listCalendarBlocks",
        "summary": "The blocked times",
        "description": "Scope: `bookings:manage` (or `messages:read`). The time blocks touching a range of days (business time zone; default 31 days from today, at most 62), soonest first. With `provider_id`: that staff member's blocks and the business-wide ones.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "The first day, YYYY-MM-DD. Default today.",
            "schema": {
              "type": "string",
              "example": "2026-11-10"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "The last day (included). Default from + 30 days.",
            "schema": {
              "type": "string",
              "example": "2026-12-10"
            }
          },
          {
            "name": "provider_id",
            "in": "query",
            "required": false,
            "description": "One staff member's blocks and the business-wide ones.",
            "schema": {
              "type": "string",
              "example": "maria"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The blocks.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlocksResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "c2bl3",
                  "blocks": [
                    {
                      "id": 3,
                      "provider_id": "maria",
                      "title": "Lunch",
                      "notes": "",
                      "start": "2026-11-14T01:00:00.000Z",
                      "end": "2026-11-14T02:00:00.000Z",
                      "start_local": "2026-11-14T12:00",
                      "end_local": "2026-11-14T13:00",
                      "source": "api",
                      "created_by": "API key Planner",
                      "created": "2026-11-11T01:12:09.000Z",
                      "updated": "2026-11-11T01:12:09.000Z"
                    }
                  ],
                  "count": 1,
                  "from": "2026-11-10",
                  "to": "2026-12-10",
                  "timezone": "Australia/Sydney"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage|messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "booking_not_enabled",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_booking",
          "invalid_number_in_url",
          "invalid_range",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "range_too_large",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      },
      "post": {
        "x-a2e-webhook-events": [
          "calendar.block.created"
        ],
        "tags": [
          "Calendar"
        ],
        "operationId": "createCalendarBlock",
        "summary": "Block time so that no one can book it",
        "description": "Scope: `bookings:manage`. Not with a sandbox key. Time off, a break, a closed afternoon: for one staff member (`provider_id`) or the whole business. Give `start` and `end`, or `date` for one whole day. Existing appointments are not touched. The block is made with `source` \"api\" and `created_by` \"API key <name>\"; `calendar.block.created` is sent. Send an `Idempotency-Key` header to retry safely: the same key and body within 24 hours gets the first answer again (an error does not use the key up).",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A unique value for this message or list (eg a UUID). The same request with the same key within 24 hours gets the first answer again, and nothing is sent twice. Ignored by dry runs.",
            "schema": {
              "type": "string",
              "maxLength": 255,
              "example": "order-1234-shipped"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BlockCreateRequest"
              },
              "example": {
                "start": "2026-11-14T12:00",
                "end": "2026-11-14T13:00",
                "provider_id": "maria",
                "title": "Lunch"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Blocked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlockResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "c3bk4",
                  "block": {
                    "id": 3,
                    "provider_id": "maria",
                    "title": "Lunch",
                    "notes": "",
                    "start": "2026-11-14T01:00:00.000Z",
                    "end": "2026-11-14T02:00:00.000Z",
                    "start_local": "2026-11-14T12:00",
                    "end_local": "2026-11-14T13:00",
                    "source": "api",
                    "created_by": "API key Planner",
                    "created": "2026-11-11T01:12:09.000Z",
                    "updated": "2026-11-11T01:12:09.000Z"
                  },
                  "note": "Blocked. No one can book that time."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_not_found",
          "booking_not_enabled",
          "idempotency_key_reused",
          "idempotency_request_in_progress",
          "idempotency_request_interrupted",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_block",
          "invalid_idempotency_key",
          "invalid_json",
          "invalid_number_in_url",
          "invalid_time",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "sandbox_key",
          "service_not_live"
        ],
        "x-a2e-mcp-tool": "create_time_block",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/calendar/blocks/{id}": {
      "patch": {
        "tags": [
          "Calendar"
        ],
        "operationId": "updateCalendarBlock",
        "summary": "Change a blocked time",
        "description": "Scope: `bookings:manage`. Not with a sandbox key. Any of `start`, `end`, `date`, `provider_id`, `title`, `notes`; what is left out stays.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The block's id.",
            "schema": {
              "type": "string",
              "example": "3"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BlockUpdateRequest"
              },
              "example": {
                "end": "2026-11-14T13:30",
                "title": "Long lunch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Changed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlockResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "c4bu5",
                  "block": {
                    "id": 3,
                    "provider_id": "maria",
                    "title": "Long lunch",
                    "notes": "",
                    "start": "2026-11-14T01:00:00.000Z",
                    "end": "2026-11-14T02:30:00.000Z",
                    "start_local": "2026-11-14T12:00",
                    "end_local": "2026-11-14T13:30",
                    "source": "api",
                    "created_by": "API key Planner",
                    "created": "2026-11-11T01:12:09.000Z",
                    "updated": "2026-11-11T01:12:09.000Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_not_found",
          "booking_not_enabled",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_block",
          "invalid_json",
          "invalid_number_in_url",
          "invalid_time",
          "ip_not_allowed",
          "missing_api_key",
          "nothing_to_change",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "sandbox_key",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      },
      "delete": {
        "x-a2e-webhook-events": [
          "calendar.block.deleted"
        ],
        "tags": [
          "Calendar"
        ],
        "operationId": "deleteCalendarBlock",
        "summary": "Remove a blocked time",
        "description": "Scope: `bookings:manage`. Not with a sandbox key. The time can be booked again. `calendar.block.deleted` is sent.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The block's id.",
            "schema": {
              "type": "string",
              "example": "3"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Removed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlockDeleteResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "c5bd6",
                  "deleted": true,
                  "block": {
                    "id": 3,
                    "provider_id": "maria",
                    "title": "Lunch",
                    "notes": "",
                    "start": "2026-11-14T01:00:00.000Z",
                    "end": "2026-11-14T02:00:00.000Z",
                    "start_local": "2026-11-14T12:00",
                    "end_local": "2026-11-14T13:00",
                    "source": "api",
                    "created_by": "API key Planner",
                    "created": "2026-11-11T01:12:09.000Z",
                    "updated": "2026-11-11T01:12:09.000Z"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_not_found",
          "booking_not_enabled",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_block",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "sandbox_key",
          "service_not_live"
        ],
        "x-a2e-mcp-tool": "delete_time_block",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/bookings/services": {
      "get": {
        "tags": [
          "Calendar"
        ],
        "operationId": "listBookableServices",
        "summary": "The services a customer can book, and their staff",
        "description": "Scope: `bookings:manage` (or `messages:read`). The enabled services with their length, price and description, and the staff members who do each one (`staff` is empty when the business has no staff). The ids go into GET /bookings/availability, GET /bookings/next, POST /bookings and POST /bookings/holds.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "The services.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookableServicesResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "c6sv7",
                  "services": [
                    {
                      "id": "haircut",
                      "name": "Haircut",
                      "duration_min": 30,
                      "price": "$40",
                      "description": null,
                      "staff": [
                        "maria",
                        "tom"
                      ]
                    }
                  ],
                  "timezone": "Australia/Sydney",
                  "enabled": true
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage|messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "booking_not_enabled",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "list_booking_services",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/bookings/staff": {
      "get": {
        "tags": [
          "Calendar"
        ],
        "operationId": "listBookingStaff",
        "summary": "The staff members and the services they do",
        "description": "Scope: `bookings:manage` (or `messages:read`). The enabled staff members (`provider_id` in the other calls) with the ids of the enabled services each one does. Empty when the business has no staff.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "The staff.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaffResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "c7st8",
                  "staff": [
                    {
                      "id": "maria",
                      "name": "Maria",
                      "services": [
                        "haircut",
                        "colour"
                      ]
                    }
                  ],
                  "timezone": "Australia/Sydney",
                  "enabled": true
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage|messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "booking_not_enabled",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/bookings/next": {
      "get": {
        "tags": [
          "Calendar"
        ],
        "operationId": "getNextBookingSlots",
        "summary": "The next free start times for a service, across days",
        "description": "Scope: `bookings:manage` (or `messages:read`). Like GET /bookings/availability but without choosing days: the next `count` free start times after `after` (default now), looking at most 60 days ahead. Each slot's `id` is what POST /bookings, /bookings/holds and /bookings/{id}/reschedule take as `start`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "service_id",
            "in": "query",
            "required": false,
            "description": "The service (GET /bookings/services).",
            "schema": {
              "type": "string",
              "example": "haircut"
            }
          },
          {
            "name": "provider_id",
            "in": "query",
            "required": false,
            "description": "One staff member's own availability. Left out: anyone available.",
            "schema": {
              "type": "string",
              "example": "maria"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Only times after this: a day (YYYY-MM-DD, its start in the business time zone) or an ISO 8601 time. Default now.",
            "schema": {
              "type": "string",
              "example": "2026-11-12"
            }
          },
          {
            "name": "count",
            "in": "query",
            "required": false,
            "description": "How many slots (1 to 20).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20,
              "default": 5
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The slots.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NextSlotsResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "c8nx9",
                  "slots": [
                    {
                      "id": "2026-11-12T09:00",
                      "date": "2026-11-12",
                      "title": "9:00 AM",
                      "start": "2026-11-11T22:00:00.000Z",
                      "end": "2026-11-11T22:30:00.000Z",
                      "providers": [
                        "maria"
                      ]
                    }
                  ],
                  "count": 1,
                  "timezone": "Australia/Sydney",
                  "enabled": true
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage|messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "booking_not_enabled",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_booking",
          "invalid_limit",
          "invalid_number_in_url",
          "invalid_range",
          "invalid_service",
          "invalid_time",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "range_too_large",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "find_next_booking_slots",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/bookings/{id}/reschedule": {
      "post": {
        "x-a2e-webhook-events": [
          "booking.rescheduled"
        ],
        "tags": [
          "Calendar"
        ],
        "operationId": "rescheduleBooking",
        "summary": "Move an appointment to another time",
        "description": "Scope: `bookings:manage`. Not with a sandbox key. Moves a confirmed appointment in place: same `id` and `reference`, the calendar event moved, reminders start again. `start` must be a free slot (the booking's own time counts as free). The customer is told on WhatsApp unless `notify` is false. `booking.rescheduled` is sent with `rescheduled_from`. 409 `booking_slot_taken` when the time is not free. Send an `Idempotency-Key` header to retry safely: the same key and body within 24 hours gets the first answer again (an error does not use the key up).",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The booking's id, or its reference (BK-XXXXXX).",
            "schema": {
              "type": "string",
              "example": "BK-7Q3M2A"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A unique value for this message or list (eg a UUID). The same request with the same key within 24 hours gets the first answer again, and nothing is sent twice. Ignored by dry runs.",
            "schema": {
              "type": "string",
              "maxLength": 255,
              "example": "order-1234-shipped"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BookingRescheduleRequest"
              },
              "example": {
                "start": "2026-11-12T10:00",
                "notify": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Moved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "c0rs2",
                  "booking": {
                    "id": 42,
                    "reference": "BK-7Q3M2A",
                    "status": "confirmed",
                    "contact": "61412345678",
                    "contact_name": "John Smith",
                    "contact_email": "john@example.com",
                    "service": {
                      "id": "haircut",
                      "name": "Haircut",
                      "duration_min": 30
                    },
                    "start": "2026-11-11T23:00:00.000Z",
                    "end": "2026-11-11T23:30:00.000Z",
                    "timezone": "Australia/Sydney",
                    "source": "api",
                    "calendar": {
                      "provider": "google",
                      "event_id": "evt_1a2b3c",
                      "url": null,
                      "error": null
                    },
                    "answers": {},
                    "notes": "First visit",
                    "provider": {
                      "id": "maria",
                      "name": "Maria"
                    },
                    "credits_used": 0,
                    "link_id": null,
                    "notes_count": 1,
                    "created": "2026-11-06T01:12:09.000Z"
                  },
                  "note": "Moved. The booking keeps its id and reference. The customer is told on WhatsApp."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "approval_body_too_large",
          "background_start_failed",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "booking_cancelled",
          "booking_not_enabled",
          "booking_not_found",
          "booking_slot_taken",
          "broadcast_cancelled",
          "bsuid_not_supported",
          "call_permission_required",
          "caption_not_supported",
          "caption_too_long",
          "daily_cap_reached",
          "display_name_not_approved",
          "duplicate_recipients",
          "free_form_single_recipient",
          "idempotency_key_reused",
          "idempotency_request_in_progress",
          "idempotency_request_interrupted",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_base64",
          "invalid_booking",
          "invalid_callback_data",
          "invalid_components",
          "invalid_contacts_message",
          "invalid_cursor",
          "invalid_idempotency_key",
          "invalid_identity_key_hash",
          "invalid_interactive",
          "invalid_json",
          "invalid_location",
          "invalid_marketing_api",
          "invalid_media_link",
          "invalid_number_in_url",
          "invalid_reaction",
          "invalid_recipients",
          "invalid_reply_to",
          "invalid_send_at",
          "invalid_start",
          "invalid_to",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_download_failed",
          "media_too_large",
          "media_type_not_allowed",
          "media_upload_error",
          "media_upload_failed",
          "message_too_old",
          "messaging_limit_restricted",
          "missing_api_key",
          "missing_interactive",
          "missing_media",
          "missing_message_id",
          "missing_template_language",
          "missing_template_name",
          "missing_text",
          "monthly_cap_reached",
          "monthly_limit_reached",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "reaction_too_old",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_not_opted_in",
          "recipient_opted_out",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "sandbox_key",
          "schedule_failed",
          "segment_and_recipients",
          "segment_empty",
          "segment_not_found",
          "send_at_in_past",
          "send_at_too_far",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_language_not_found",
          "template_lookup_failed",
          "template_not_approved",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_parameters_invalid",
          "template_paused",
          "template_sample_media_failed",
          "template_text_too_long",
          "text_too_long",
          "to_and_recipients",
          "too_many_messages_to_recipient",
          "too_many_recipients",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "voice_needs_ogg_opus",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-mcp-tool": "reschedule_booking",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/bookings/{id}/notes": {
      "get": {
        "tags": [
          "Calendar"
        ],
        "operationId": "listBookingNotes",
        "summary": "The internal notes of an appointment and its customer",
        "description": "Scope: `bookings:manage` (or `messages:read`). The notes written on this appointment and the customer's other notes, pinned first then newest; `on_this_booking` tells them apart. Notes are never shown to the customer.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The booking's id, or its reference (BK-XXXXXX).",
            "schema": {
              "type": "string",
              "example": "BK-7Q3M2A"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The notes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotesResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "d1nl3",
                  "notes": [
                    {
                      "id": 7,
                      "contact": "61412345678",
                      "appointment_id": 42,
                      "booking_reference": "BK-7Q3M2A",
                      "body": "Prefers the window seat.",
                      "author": "API key Planner",
                      "author_kind": "api",
                      "pinned": false,
                      "created": "2026-11-11T01:12:09.000Z",
                      "updated": "2026-11-11T01:12:09.000Z",
                      "on_this_booking": true
                    }
                  ],
                  "count": 1,
                  "booking": {
                    "id": 42,
                    "reference": "BK-7Q3M2A"
                  },
                  "contact": "61412345678"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage|messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "booking_not_enabled",
          "booking_not_found",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "list_booking_notes",
        "x-a2e-needs": null
      },
      "post": {
        "tags": [
          "Calendar"
        ],
        "operationId": "addBookingNote",
        "summary": "Add an internal note to an appointment",
        "description": "Scope: `bookings:manage`. Not with a sandbox key. The note is about the appointment's customer and written on this appointment. `author` is \"API key <name>\" and `author_kind` \"api\". `booking.note.created` is sent. Send an `Idempotency-Key` header to retry safely: the same key and body within 24 hours gets the first answer again (an error does not use the key up).",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The booking's id, or its reference (BK-XXXXXX).",
            "schema": {
              "type": "string",
              "example": "BK-7Q3M2A"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A unique value for this message or list (eg a UUID). The same request with the same key within 24 hours gets the first answer again, and nothing is sent twice. Ignored by dry runs.",
            "schema": {
              "type": "string",
              "maxLength": 255,
              "example": "order-1234-shipped"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NoteCreateRequest"
              },
              "example": {
                "body": "Prefers the window seat.",
                "pinned": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Added.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NoteResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "d2na4",
                  "note": {
                    "id": 7,
                    "contact": "61412345678",
                    "appointment_id": 42,
                    "booking_reference": "BK-7Q3M2A",
                    "body": "Prefers the window seat.",
                    "author": "API key Planner",
                    "author_kind": "api",
                    "pinned": false,
                    "created": "2026-11-11T01:12:09.000Z",
                    "updated": "2026-11-11T01:12:09.000Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "booking_not_enabled",
          "booking_not_found",
          "idempotency_key_reused",
          "idempotency_request_in_progress",
          "idempotency_request_interrupted",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_idempotency_key",
          "invalid_json",
          "invalid_note",
          "invalid_number_in_url",
          "invalid_time",
          "ip_not_allowed",
          "missing_api_key",
          "note_not_found",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "sandbox_key",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [
          "booking.note.created"
        ],
        "x-a2e-mcp-tool": "add_booking_note",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/bookings/notes": {
      "get": {
        "tags": [
          "Calendar"
        ],
        "operationId": "listCustomerNotes",
        "summary": "The internal notes of a customer",
        "description": "Scope: `bookings:manage` (or `messages:read`). Every note about one customer (`contact` is required), pinned first then newest. Page with `next_cursor`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "contact",
            "in": "query",
            "required": false,
            "description": "The customer: number with country code, or business-scoped user id. Required.",
            "schema": {
              "type": "string",
              "example": "61412345678"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many (1 to 200, default 50).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The next_cursor of the previous answer, unchanged. Leave out for the first page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The notes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotesResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "d3nc5",
                  "notes": [
                    {
                      "id": 7,
                      "contact": "61412345678",
                      "appointment_id": 42,
                      "booking_reference": "BK-7Q3M2A",
                      "body": "Prefers the window seat.",
                      "author": "API key Planner",
                      "author_kind": "api",
                      "pinned": false,
                      "created": "2026-11-11T01:12:09.000Z",
                      "updated": "2026-11-11T01:12:09.000Z"
                    }
                  ],
                  "next_cursor": null,
                  "count": 1,
                  "contact": "61412345678"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage|messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "booking_not_enabled",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_limit",
          "invalid_number",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "list_booking_notes",
        "x-a2e-needs": null
      },
      "post": {
        "tags": [
          "Calendar"
        ],
        "operationId": "addCustomerNote",
        "summary": "Add an internal note to a customer",
        "description": "Scope: `bookings:manage`. Not with a sandbox key. Give `contact`, or `booking_id` to write it on one appointment (the customer is taken from it). `author` is \"API key <name>\", `author_kind` \"api\". `booking.note.created` is sent. Send an `Idempotency-Key` header to retry safely: the same key and body within 24 hours gets the first answer again (an error does not use the key up).",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A unique value for this message or list (eg a UUID). The same request with the same key within 24 hours gets the first answer again, and nothing is sent twice. Ignored by dry runs.",
            "schema": {
              "type": "string",
              "maxLength": 255,
              "example": "order-1234-shipped"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NoteCreateRequest"
              },
              "example": {
                "contact": "61412345678",
                "body": "Prefers the window seat.",
                "pinned": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Added.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NoteResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "d4nn6",
                  "note": {
                    "id": 7,
                    "contact": "61412345678",
                    "appointment_id": 42,
                    "booking_reference": "BK-7Q3M2A",
                    "body": "Prefers the window seat.",
                    "author": "API key Planner",
                    "author_kind": "api",
                    "pinned": false,
                    "created": "2026-11-11T01:12:09.000Z",
                    "updated": "2026-11-11T01:12:09.000Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "booking_not_enabled",
          "booking_not_found",
          "idempotency_key_reused",
          "idempotency_request_in_progress",
          "idempotency_request_interrupted",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_idempotency_key",
          "invalid_json",
          "invalid_note",
          "invalid_number",
          "invalid_number_in_url",
          "invalid_time",
          "ip_not_allowed",
          "missing_api_key",
          "note_not_found",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "sandbox_key",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [
          "booking.note.created"
        ],
        "x-a2e-mcp-tool": "add_booking_note",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/bookings/notes/{note_id}": {
      "delete": {
        "tags": [
          "Calendar"
        ],
        "operationId": "deleteBookingNote",
        "summary": "Delete an internal note",
        "description": "Scope: `bookings:manage`. Not with a sandbox key. The note is hidden from every list.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "note_id",
            "in": "path",
            "required": true,
            "description": "The note's id.",
            "schema": {
              "type": "string",
              "example": "7"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NoteDeleteResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "d5nd7",
                  "deleted": true,
                  "id": 7
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "booking_not_enabled",
          "booking_not_found",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_note",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "note_not_found",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "sandbox_key",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/bookings/links": {
      "get": {
        "tags": [
          "Calendar"
        ],
        "operationId": "listBookingLinks",
        "summary": "The personal booking links",
        "description": "Scope: `bookings:manage` (or `messages:read`). The personal links of the number, newest first; `contact` shows one customer's. Each has its `state` (ok, expired, revoked, used_up, off) and how often it was opened. Page with `next_cursor`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "contact",
            "in": "query",
            "required": false,
            "description": "Only this customer's links.",
            "schema": {
              "type": "string",
              "example": "61412345678"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many (1 to 200, default 50).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The next_cursor of the previous answer, unchanged. Leave out for the first page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The links.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingLinksResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "e1ll8",
                  "links": [
                    {
                      "id": 21,
                      "code": "k3XbQ9rTzP2m",
                      "url": "https://www.app2email.com/book/k3XbQ9rTzP2m",
                      "kind": "personal",
                      "contact": "61412345678",
                      "contact_name": "John",
                      "service_id": null,
                      "provider_id": null,
                      "purpose": "book",
                      "booking_id": null,
                      "single_use": false,
                      "max_uses": 0,
                      "uses": 0,
                      "expires": "2026-11-18T01:12:09.000Z",
                      "revoked": null,
                      "source": "api",
                      "created_by": "API key Planner",
                      "open_count": 0,
                      "last_opened": null,
                      "created": "2026-11-11T01:12:09.000Z",
                      "state": "ok"
                    }
                  ],
                  "next_cursor": null,
                  "count": 1
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage|messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "booking_not_enabled",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_limit",
          "invalid_number",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      },
      "post": {
        "tags": [
          "Calendar"
        ],
        "operationId": "createBookingLink",
        "summary": "Make a link that opens the online booking page",
        "description": "Scope: `bookings:manage`. Not with a sandbox key. A link for a customer to book, move an appointment (`purpose` reschedule + `booking_id`) or manage their appointments (`purpose` manage). Send the `url` to the customer yourself. With a `contact` the page knows the customer and confirms the booking right away; without one it is a one-off link and the customer confirms on WhatsApp. The online booking page must be switched on, else the answer says the link will not open yet. `created_by` is \"API key <name>\", `source` \"api\". Send an `Idempotency-Key` header to retry safely: the same key and body within 24 hours gets the first answer again (an error does not use the key up).",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A unique value for this message or list (eg a UUID). The same request with the same key within 24 hours gets the first answer again, and nothing is sent twice. Ignored by dry runs.",
            "schema": {
              "type": "string",
              "maxLength": 255,
              "example": "order-1234-shipped"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BookingLinkRequest"
              },
              "example": {
                "contact": "61412345678",
                "name": "John",
                "purpose": "book",
                "expires_in_hours": 48
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Made.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingLinkResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "e2lc9",
                  "link": {
                    "id": 21,
                    "code": "k3XbQ9rTzP2m",
                    "url": "https://www.app2email.com/book/k3XbQ9rTzP2m",
                    "kind": "personal",
                    "contact": "61412345678",
                    "contact_name": "John",
                    "service_id": null,
                    "provider_id": null,
                    "purpose": "book",
                    "booking_id": null,
                    "single_use": false,
                    "max_uses": 0,
                    "uses": 0,
                    "expires": "2026-11-18T01:12:09.000Z",
                    "revoked": null,
                    "source": "api",
                    "created_by": "API key Planner",
                    "open_count": 0,
                    "last_opened": null,
                    "created": "2026-11-11T01:12:09.000Z",
                    "state": "ok"
                  },
                  "note": "Send the url to the customer. It opens the booking page for them."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "booking_not_enabled",
          "booking_not_found",
          "idempotency_key_reused",
          "idempotency_request_in_progress",
          "idempotency_request_interrupted",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_idempotency_key",
          "invalid_json",
          "invalid_link",
          "invalid_number",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "sandbox_key",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "create_booking_link",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/bookings/links/{code}": {
      "delete": {
        "tags": [
          "Calendar"
        ],
        "operationId": "revokeBookingLink",
        "summary": "Revoke a personal booking link",
        "description": "Scope: `bookings:manage`. Not with a sandbox key. The link stops opening. The public address is not a personal link: change it on the dashboard.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "code",
            "in": "path",
            "required": true,
            "description": "The link's code (or its id).",
            "schema": {
              "type": "string",
              "example": "k3XbQ9rTzP2m"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingLinkResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "e3lr1",
                  "link": {
                    "id": 21,
                    "code": "k3XbQ9rTzP2m",
                    "url": "https://www.app2email.com/book/k3XbQ9rTzP2m",
                    "kind": "personal",
                    "contact": "61412345678",
                    "contact_name": "John",
                    "service_id": null,
                    "provider_id": null,
                    "purpose": "book",
                    "booking_id": null,
                    "single_use": false,
                    "max_uses": 0,
                    "uses": 0,
                    "expires": "2026-11-18T01:12:09.000Z",
                    "revoked": "2026-11-11T02:00:00.000Z",
                    "source": "api",
                    "created_by": "API key Planner",
                    "open_count": 0,
                    "last_opened": null,
                    "created": "2026-11-11T01:12:09.000Z",
                    "state": "revoked"
                  },
                  "note": "Revoked. The link no longer opens."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "booking_not_enabled",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_link",
          "invalid_number_in_url",
          "ip_not_allowed",
          "link_not_found",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "sandbox_key",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/bookings/holds": {
      "post": {
        "tags": [
          "Calendar"
        ],
        "operationId": "createBookingHold",
        "summary": "Keep a free time for a few minutes",
        "description": "Scope: `bookings:manage`. Not with a sandbox key. Keeps a free time for `minutes` (1 to 30, default 10) so no one else can book it while the customer decides: it counts as taken in the availability, the calendar and every booking check. The slot is checked like a booking is; 409 `booking_slot_taken` when it is not free. Book it with POST /bookings and `hold` (the `reference`), or release it with DELETE; it frees itself at `expires`. Send an `Idempotency-Key` header to retry safely: the same key and body within 24 hours gets the first answer again (an error does not use the key up).",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A unique value for this message or list (eg a UUID). The same request with the same key within 24 hours gets the first answer again, and nothing is sent twice. Ignored by dry runs.",
            "schema": {
              "type": "string",
              "maxLength": 255,
              "example": "order-1234-shipped"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HoldRequest"
              },
              "example": {
                "service_id": "haircut",
                "start": "2026-11-10T09:00",
                "provider_id": "maria",
                "contact": "61412345678",
                "name": "John",
                "minutes": 10
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Held.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HoldResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "f1hc2",
                  "hold": {
                    "reference": "BK-4HT9XC",
                    "status": "held",
                    "service_id": "haircut",
                    "provider_id": "maria",
                    "contact": "61412345678",
                    "name": "John",
                    "start": "2026-11-09T22:00:00.000Z",
                    "end": "2026-11-09T22:30:00.000Z",
                    "start_local": "2026-11-10T09:00",
                    "end_local": "2026-11-10T09:30",
                    "expires": "2026-11-09T04:10:00.000Z",
                    "source": "api"
                  },
                  "note": "The time is kept until hold.expires: nobody else can book it."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "booking_not_enabled",
          "booking_slot_taken",
          "idempotency_key_reused",
          "idempotency_request_in_progress",
          "idempotency_request_interrupted",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_booking",
          "invalid_idempotency_key",
          "invalid_json",
          "invalid_number",
          "invalid_number_in_url",
          "invalid_service",
          "invalid_start",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "sandbox_key",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "hold_booking_slot",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/bookings/holds/{reference}": {
      "delete": {
        "tags": [
          "Calendar"
        ],
        "operationId": "releaseBookingHold",
        "summary": "Release a held time",
        "description": "Scope: `bookings:manage`. Not with a sandbox key. Frees the time at once. Releasing a time that was already released answers 200 again; one that expired or was booked answers 409 `hold_expired`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "reference",
            "in": "path",
            "required": true,
            "description": "The hold's reference, as POST /bookings/holds answered.",
            "schema": {
              "type": "string",
              "example": "BK-4HT9XC"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Released.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HoldReleaseResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "f2hr3",
                  "released": true,
                  "hold": {
                    "reference": "BK-4HT9XC",
                    "status": "released",
                    "service_id": "haircut",
                    "provider_id": "maria",
                    "contact": "61412345678",
                    "name": "John",
                    "start": "2026-11-09T22:00:00.000Z",
                    "end": "2026-11-09T22:30:00.000Z",
                    "start_local": "2026-11-10T09:00",
                    "end_local": "2026-11-10T09:30",
                    "expires": "2026-11-09T04:10:00.000Z",
                    "source": "api"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "booking_not_enabled",
          "hold_expired",
          "hold_not_found",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "sandbox_key",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/calling/settings": {
      "get": {
        "tags": [
          "Calling"
        ],
        "operationId": "getCallSettings",
        "summary": "WhatsApp calling settings",
        "description": "Meta's settings of the number: calling on or off, call icon, call hours, call-back permission, SIP.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "include_sip_credentials",
            "in": "query",
            "required": false,
            "description": "true: the SIP password too (never for a sandbox key).",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The settings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallSettingsResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "c1g2s",
                  "settings": {
                    "calling": {
                      "status": "ENABLED",
                      "call_icon_visibility": "DEFAULT",
                      "callback_permission_status": "ENABLED",
                      "call_hours": {
                        "status": "ENABLED",
                        "timezone_id": "Europe/Berlin",
                        "weekly_operating_hours": [
                          {
                            "day_of_week": "MONDAY",
                            "open_time": "0900",
                            "close_time": "1700"
                          }
                        ]
                      },
                      "sip": {
                        "status": "DISABLED"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-needs": "Meta enablement: Calling (portfolio messaging limit 2,000+, the app subscribed to the calls field)",
        "x-a2e-scope": "calls:manage",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_number_in_url",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "get_call_settings"
      },
      "patch": {
        "tags": [
          "Calling"
        ],
        "operationId": "updateCallSettings",
        "summary": "Change the calling settings",
        "description": "Passed to Meta as {\"calling\": {...}}; status in upper case.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "Saved at WhatsApp.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallSettingsUpdateResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "c2h3t",
                  "updated": [
                    "status",
                    "call_icon_visibility"
                  ],
                  "calling": {
                    "status": "ENABLED",
                    "call_icon_visibility": "DEFAULT"
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-needs": "Meta enablement: Calling (portfolio messaging limit 2,000+, the app subscribed to the calls field)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CallSettingsUpdate"
              },
              "example": {
                "calling": {
                  "status": "ENABLED",
                  "call_icon_visibility": "DEFAULT"
                }
              }
            }
          }
        },
        "x-a2e-scope": "calls:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_call_settings",
          "invalid_cursor",
          "invalid_json",
          "invalid_number_in_url",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "nothing_to_change",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "sandbox_key",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null
      }
    },
    "/v1/{number}/calls": {
      "post": {
        "tags": [
          "Calling"
        ],
        "operationId": "manageCall",
        "summary": "Start, answer, reject or end a WhatsApp call",
        "description": "Meta's call actions with your SDP. Answer an incoming call within 30 to 60 s. Business-initiated calls need the contact's permission and are billed per minute.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "Taken by WhatsApp.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "c3i4u",
                  "action": "accept",
                  "call_id": "wacid.HBgLMTY1MDU1NTEyMzQVAgARGCBBQkNERUY"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-needs": "Meta enablement: Calling (portfolio messaging limit 2,000+, the app subscribed to the calls field)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CallRequest"
              },
              "example": {
                "action": "accept",
                "call_id": "wacid.HBgLMTY1MDU1NTEyMzQVAgARGCBBQkNERUY",
                "session": {
                  "sdp_type": "answer",
                  "sdp": "v=0\r\no=- 4611731400430051336 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n..."
                }
              }
            }
          }
        },
        "x-a2e-scope": "calls:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_call_request",
          "invalid_cursor",
          "invalid_json",
          "invalid_number_in_url",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "sandbox_key",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null
      }
    },
    "/v1/{number}/calls/permissions/{contact}": {
      "get": {
        "tags": [
          "Calling"
        ],
        "operationId": "getCallPermission",
        "summary": "May the number call this contact",
        "description": "The contact's call permission and how many calls or permission requests are left.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "contact",
            "in": "path",
            "required": true,
            "description": "The contact's number with country code, digits only, or their business-scoped user id.",
            "schema": {
              "type": "string",
              "example": "61412345678"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The permission.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallPermissionResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "c4j5v",
                  "contact": "61412345678",
                  "permission": {
                    "status": "temporary",
                    "expires_at": "2026-11-13T01:00:00.000Z"
                  },
                  "actions": [
                    {
                      "action_name": "start_call",
                      "can_perform_action": true,
                      "limits": [
                        {
                          "time_period": "PT24H",
                          "max_allowed": 100,
                          "current_usage": 2
                        }
                      ]
                    },
                    {
                      "action_name": "send_call_permission_request",
                      "can_perform_action": false,
                      "limits": [
                        {
                          "time_period": "P1D",
                          "max_allowed": 1,
                          "current_usage": 1,
                          "limit_expiration_time": 1794013200
                        }
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-needs": "Meta enablement: Calling (portfolio messaging limit 2,000+, the app subscribed to the calls field)",
        "x-a2e-scope": "calls:manage",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_number_in_url",
          "invalid_phone",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "get_call_permission"
      }
    },
    "/v1/{number}/flows": {
      "get": {
        "tags": [
          "Flows"
        ],
        "operationId": "listFlows",
        "summary": "List WhatsApp Flows",
        "description": "Every flow of the WhatsApp Business Account: id, name, status, categories, validation errors. This number's Bookings Flows also have `key`, `can_send` and `booking_flow` (POST /flows/{key}/send sends them); the first page adds the Bookings Flows not uploaded yet (no id). Needs 'messages:read' or 'bookings:manage'.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1 to 100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "next_cursor of the previous answer.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The flows.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowListResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "f1lst",
                  "flows": [
                    {
                      "id": "1234567890123456",
                      "name": "appointment_booking",
                      "status": "DRAFT",
                      "categories": [
                        "APPOINTMENT_BOOKING"
                      ],
                      "validation_errors": []
                    },
                    {
                      "id": "1234567890123457",
                      "name": "feedback",
                      "status": "PUBLISHED",
                      "categories": [
                        "SURVEY"
                      ],
                      "validation_errors": []
                    },
                    {
                      "id": "1234567890123458",
                      "name": "Appointment booking - +61 2 9876 5432",
                      "status": "PUBLISHED",
                      "categories": [
                        "APPOINTMENT_BOOKING"
                      ],
                      "validation_errors": [],
                      "key": "booking",
                      "can_send": true,
                      "booking_flow": {
                        "key": "booking",
                        "name": "Appointment booking",
                        "kind": "booking",
                        "enabled": true,
                        "is_default": true,
                        "trigger_keywords": [],
                        "id": "1234567890123458",
                        "status": "published",
                        "can_send": true,
                        "health": "AVAILABLE",
                        "last_published_at": "2026-11-06T00:00:00Z",
                        "updated_at": "2026-11-06T00:00:00.000Z"
                      }
                    }
                  ],
                  "next_cursor": null,
                  "count": 3,
                  "enabled": true,
                  "note": "A Flow with a key is one of this number's Bookings Flows: POST /v1/{number}/flows/{key}/send sends it to a contact inside their 24 hour window (can_send), and its trigger words send it."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read|bookings:manage",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "flow_blocked_by_integrity",
          "flow_rejected",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_limit",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "list_flows",
        "x-a2e-needs": null
      },
      "post": {
        "tags": [
          "Flows"
        ],
        "operationId": "createFlow",
        "summary": "Create a flow (draft, or published at once)",
        "description": "Needs 'templates:manage'. A draft; with flow_json and publish: true it is published at once (cannot be undone). WABA-wide: every number on this WhatsApp Business Account shares its flows.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FlowCreateRequest"
              },
              "example": {
                "name": "appointment_booking",
                "categories": [
                  "APPOINTMENT_BOOKING"
                ],
                "flow_json": {
                  "version": "7.2",
                  "screens": [
                    {
                      "id": "WELCOME",
                      "title": "Welcome",
                      "terminal": true,
                      "success": true,
                      "data": {},
                      "layout": {
                        "type": "SingleColumnLayout",
                        "children": [
                          {
                            "type": "TextHeading",
                            "text": "Book a visit"
                          },
                          {
                            "type": "Footer",
                            "label": "Done",
                            "on-click-action": {
                              "name": "complete",
                              "payload": {}
                            }
                          }
                        ]
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created (validation_errors: what to fix before publishing).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowCreateResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "f1new",
                  "flow": {
                    "id": "1234567890123456",
                    "name": "appointment_booking",
                    "status": "DRAFT"
                  },
                  "validation_errors": [],
                  "note": "The flow belongs to the whole WhatsApp Business Account: every number on it can send it."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "The request or the media file is too large. Possible error.code values: request_too_large, media_too_large, approval_body_too_large, test_event_too_large, flow_json_too_large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-webhook-events": [
          "flow.status_changed"
        ],
        "x-a2e-scope": "templates:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "flow_blocked_by_integrity",
          "flow_json_too_large",
          "flow_name_taken",
          "flow_not_found",
          "flow_rejected",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_flow_categories",
          "invalid_flow_field",
          "invalid_flow_id",
          "invalid_flow_json",
          "invalid_flow_name",
          "invalid_json",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "sandbox_key",
          "service_not_live",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit"
        ],
        "x-a2e-mcp-tool": "create_flow",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/flows/{id}": {
      "get": {
        "tags": [
          "Flows"
        ],
        "operationId": "getFlow",
        "summary": "One flow: status, validation errors, health",
        "description": "Status, categories, validation errors, Flow JSON version, endpoint, and whether it can be sent (health_status).",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The flow's id (digits).",
            "schema": {
              "type": "string",
              "example": "1234567890123456"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The flow.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowDetailResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "f1get",
                  "flow": {
                    "id": "1234567890123456",
                    "name": "appointment_booking",
                    "status": "DRAFT",
                    "categories": [
                      "APPOINTMENT_BOOKING"
                    ],
                    "validation_errors": [],
                    "json_version": "7.2",
                    "health_status": {
                      "can_send_message": "AVAILABLE",
                      "entities": [
                        {
                          "entity_type": "FLOW",
                          "id": "1234567890123456",
                          "can_send_message": "AVAILABLE"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "flow_blocked_by_integrity",
          "flow_not_found",
          "flow_rejected",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_flow_id",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "get_flow",
        "x-a2e-needs": null
      },
      "patch": {
        "tags": [
          "Flows"
        ],
        "operationId": "updateFlow",
        "summary": "Change a flow's name, categories or endpoint",
        "description": "Needs 'templates:manage'. The Flow JSON: PUT /flows/{id}/json. A published flow goes back to DRAFT until you publish it again; messages already sent keep the old version. WABA-wide: every number on this WhatsApp Business Account shares its flows.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The flow's id (digits).",
            "schema": {
              "type": "string",
              "example": "1234567890123456"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FlowUpdateRequest"
              },
              "example": {
                "name": "appointment_booking_v2"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Changed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowUpdateResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "f1upd",
                  "flow_id": "1234567890123456",
                  "changed": [
                    "name"
                  ],
                  "note": "The flow was PUBLISHED: it is a DRAFT again until you publish it (POST /flows/1234567890123456/publish); messages already sent keep the old version."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "templates:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "flow_blocked_by_integrity",
          "flow_name_taken",
          "flow_not_editable",
          "flow_not_found",
          "flow_rejected",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_flow_categories",
          "invalid_flow_field",
          "invalid_flow_id",
          "invalid_flow_name",
          "invalid_json",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "nothing_to_change",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "sandbox_key",
          "service_not_live",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "update_flow",
        "x-a2e-needs": null
      },
      "delete": {
        "tags": [
          "Flows"
        ],
        "operationId": "deleteFlow",
        "summary": "Delete a draft flow",
        "description": "Needs 'templates:manage'. Drafts only; deprecate a published flow instead. WABA-wide: every number on this WhatsApp Business Account shares its flows.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The flow's id (digits).",
            "schema": {
              "type": "string",
              "example": "1234567890123456"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowDeleteResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "f1del",
                  "deleted": "1234567890123456",
                  "name": "appointment_booking"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "templates:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "flow_blocked_by_integrity",
          "flow_not_deletable",
          "flow_not_found",
          "flow_rejected",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_flow_id",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "sandbox_key",
          "service_not_live",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "delete_flow",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/flows/{id}/json": {
      "get": {
        "tags": [
          "Flows"
        ],
        "operationId": "getFlowJson",
        "summary": "A flow's Flow JSON",
        "description": "The flow.json WhatsApp keeps for the flow.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The flow's id (digits).",
            "schema": {
              "type": "string",
              "example": "1234567890123456"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The Flow JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowJsonResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "f1jsn",
                  "flow_id": "1234567890123456",
                  "flow_json": {
                    "version": "7.2",
                    "screens": [
                      {
                        "id": "WELCOME",
                        "title": "Welcome",
                        "terminal": true,
                        "success": true,
                        "data": {},
                        "layout": {
                          "type": "SingleColumnLayout",
                          "children": [
                            {
                              "type": "TextHeading",
                              "text": "Book a visit"
                            },
                            {
                              "type": "Footer",
                              "label": "Done",
                              "on-click-action": {
                                "name": "complete",
                                "payload": {}
                              }
                            }
                          ]
                        }
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "flow_blocked_by_integrity",
          "flow_json_download_failed",
          "flow_json_not_found",
          "flow_not_found",
          "flow_rejected",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_flow_id",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "get_flow_json",
        "x-a2e-needs": null
      },
      "put": {
        "tags": [
          "Flows"
        ],
        "operationId": "updateFlowJson",
        "summary": "Replace a flow's Flow JSON",
        "description": "Needs 'templates:manage'. The body is the Flow JSON (or {\"flow_json\": {...}}), max 10 MB; the answer lists WhatsApp's validation errors. A published flow goes back to DRAFT until you publish it again; messages already sent keep the old version. WABA-wide: every number on this WhatsApp Business Account shares its flows.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The flow's id (digits).",
            "schema": {
              "type": "string",
              "example": "1234567890123456"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              },
              "example": {
                "version": "7.2",
                "screens": [
                  {
                    "id": "WELCOME",
                    "title": "Welcome",
                    "terminal": true,
                    "success": true,
                    "data": {},
                    "layout": {
                      "type": "SingleColumnLayout",
                      "children": [
                        {
                          "type": "TextHeading",
                          "text": "Book a visit"
                        },
                        {
                          "type": "Footer",
                          "label": "Done",
                          "on-click-action": {
                            "name": "complete",
                            "payload": {}
                          }
                        }
                      ]
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Taken (check validation_errors).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowJsonUploadResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "f1put",
                  "flow_id": "1234567890123456",
                  "validation_errors": [],
                  "note": "WhatsApp found no errors. Publish with POST /flows/1234567890123456/publish (cannot be undone)."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "The request or the media file is too large. Possible error.code values: request_too_large, media_too_large, approval_body_too_large, test_event_too_large, flow_json_too_large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "templates:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "flow_blocked_by_integrity",
          "flow_json_too_large",
          "flow_not_editable",
          "flow_not_found",
          "flow_rejected",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_flow_id",
          "invalid_flow_json",
          "invalid_json",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "sandbox_key",
          "service_not_live",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "update_flow_json",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/flows/{id}/publish": {
      "post": {
        "tags": [
          "Flows"
        ],
        "operationId": "publishFlow",
        "summary": "Publish a flow (cannot be undone)",
        "description": "Needs 'templates:manage'. A draft without validation errors. Afterwards it cannot be deleted (deprecate it instead); a change puts it back to DRAFT until published again. WABA-wide: every number on this WhatsApp Business Account shares its flows.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The flow's id (digits).",
            "schema": {
              "type": "string",
              "example": "1234567890123456"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Published.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowStateResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "f1pub",
                  "flow_id": "1234567890123456",
                  "name": "appointment_booking",
                  "previous_status": "DRAFT",
                  "status": "PUBLISHED",
                  "note": "Published for every number on this WhatsApp Business Account. It cannot be deleted (deprecate it instead). Changing its name, categories, endpoint or Flow JSON puts it back to DRAFT until you publish again; messages already sent keep the old version."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-webhook-events": [
          "flow.status_changed"
        ],
        "x-a2e-scope": "templates:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "flow_blocked_by_integrity",
          "flow_cannot_publish",
          "flow_not_found",
          "flow_not_published",
          "flow_rejected",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_flow_id",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "sandbox_key",
          "service_not_live",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit"
        ],
        "x-a2e-mcp-tool": "publish_flow",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/flows/{id}/deprecate": {
      "post": {
        "tags": [
          "Flows"
        ],
        "operationId": "deprecateFlow",
        "summary": "Deprecate a published flow (cannot be undone)",
        "description": "Needs 'templates:manage'. It can no longer be sent or opened. WABA-wide: every number on this WhatsApp Business Account shares its flows.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The flow's id (digits).",
            "schema": {
              "type": "string",
              "example": "1234567890123456"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deprecated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowStateResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "f1dep",
                  "flow_id": "1234567890123456",
                  "name": "appointment_booking",
                  "previous_status": "PUBLISHED",
                  "status": "DEPRECATED",
                  "note": "Deprecated: it can no longer be sent or opened, on every number of this WhatsApp Business Account. This cannot be undone."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-webhook-events": [
          "flow.status_changed"
        ],
        "x-a2e-scope": "templates:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "flow_blocked_by_integrity",
          "flow_cannot_publish",
          "flow_not_found",
          "flow_not_published",
          "flow_rejected",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_flow_id",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "sandbox_key",
          "service_not_live",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit"
        ],
        "x-a2e-mcp-tool": "deprecate_flow",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/flows/{id}/preview": {
      "get": {
        "tags": [
          "Flows"
        ],
        "operationId": "getFlowPreview",
        "summary": "A public preview link of a flow (30 days)",
        "description": "Anyone with the link can open it, also in an iframe. A new link: POST.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The flow's id (digits).",
            "schema": {
              "type": "string",
              "example": "1234567890123456"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The link.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowPreviewResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "f1prv",
                  "flow_id": "1234567890123456",
                  "preview_url": "https://business.facebook.com/wa/manage/flows/1234567890123456/preview/?token=b9d6a1c2",
                  "expires_at": "2026-12-06T01:00:00+0000",
                  "note": "Anyone with the link can see the flow until it expires (30 days). Add &interactive=true to try it."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "flow_blocked_by_integrity",
          "flow_not_found",
          "flow_rejected",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_flow_field",
          "invalid_flow_id",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "get_flow_preview",
        "x-a2e-needs": null
      },
      "post": {
        "tags": [
          "Flows"
        ],
        "operationId": "renewFlowPreview",
        "summary": "A new preview link of a flow (the old one stops working)",
        "description": "Needs 'templates:manage'. Meta's preview.invalidate(true): the old link stops working at once.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The flow's id (digits).",
            "schema": {
              "type": "string",
              "example": "1234567890123456"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The new link.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowPreviewResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "f1prn",
                  "flow_id": "1234567890123456",
                  "preview_url": "https://business.facebook.com/wa/manage/flows/1234567890123456/preview/?token=e4f7c3a9",
                  "expires_at": "2026-12-06T01:00:00+0000",
                  "note": "A new link; the old one no longer works. Anyone with the link can see the flow until it expires (30 days). Add &interactive=true to try it."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "templates:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "flow_blocked_by_integrity",
          "flow_not_found",
          "flow_rejected",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_flow_id",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "sandbox_key",
          "service_not_live",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "renew_flow_preview",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/flows/encryption-key": {
      "get": {
        "tags": [
          "Flows"
        ],
        "operationId": "getFlowEncryptionKey",
        "summary": "The number's public key for flows with a data endpoint",
        "description": "This number only (each number has its own key). signature_status MISMATCH: set the key again. set_by: bookings when it is the key Bookings made for its Flows.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "The key, or null.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowEncryptionKeyResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "f2key",
                  "public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx...\n-----END PUBLIC KEY-----",
                  "signature_status": "VALID",
                  "set_by": "other",
                  "note": "This number's key (each number has its own)."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      },
      "put": {
        "tags": [
          "Flows"
        ],
        "operationId": "setFlowEncryptionKey",
        "summary": "Set the number's public key for flow endpoints",
        "description": "Needs 'templates:manage'. A 2048-bit RSA public key, PEM; a private key is refused unsent. This number only. 409 `encryption_key_managed` while Bookings has its key for the number (one key per number at WhatsApp).",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FlowEncryptionKeyRequest"
              },
              "example": {
                "public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx...\n-----END PUBLIC KEY-----"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Set.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlowEncryptionKeySetResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "f2set",
                  "note": "Set for this number only (each number of the WhatsApp Business Account has its own). Your endpoint decrypts with the private key."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "templates:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "encryption_key_managed",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_number_in_url",
          "invalid_public_key",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "sandbox_key",
          "service_not_live",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/messages/read": {
      "post": {
        "tags": [
          "Messages"
        ],
        "operationId": "markMessageRead",
        "summary": "Mark a received message as read, optionally typing",
        "description": "Blue ticks on a message the contact sent (and the earlier ones of the chat), up to 30 days old; `typing` also shows the typing indicator for up to 25 seconds. Free: not counted, no 24 hour window. Meta's own body on POST /messages works too.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MarkReadRequest"
              },
              "example": {
                "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgASGBQzQUZCMTY0MDc2MUYwNzBDNTY5MAA=",
                "typing": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Marked as read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarkReadResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "k2rdq",
                  "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgASGBQzQUZCMTY0MDc2MUYwNzBDNTY5MAA=",
                  "status": "read",
                  "typing_indicator": true
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:send",
        "x-a2e-sandbox": "simulated",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_json",
          "invalid_number_in_url",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "message_too_old",
          "messaging_limit_restricted",
          "missing_api_key",
          "missing_message_id",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "mark_read",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/marketing": {
      "get": {
        "tags": [
          "Messages"
        ],
        "operationId": "getMarketingStatus",
        "summary": "Where marketing templates go: Cloud API or Marketing Messages API",
        "description": "The route setting (messages.marketing_route), the route a marketing template takes now, WhatsApp's onboarding status and the account's Cloud API switch. `?refresh=true` asks WhatsApp now (otherwise up to 1 hour old).",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "refresh",
            "in": "query",
            "required": false,
            "description": "true: ask WhatsApp now.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketingStatusResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "q8mkt",
                  "marketing": {
                    "route": "auto",
                    "effective_route": "mm_api",
                    "onboarding_status": "ONBOARDED",
                    "cloud_api_marketing_disabled": false,
                    "checked_at": "2026-11-06T01:00:00Z"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_number_in_url",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "marketing_status_lookup_failed",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "get_marketing_status",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/blocked": {
      "get": {
        "tags": [
          "Contacts"
        ],
        "operationId": "listBlockedUsers",
        "summary": "WhatsApp users this number blocked",
        "description": "WhatsApp's own block list of the number (not the Do Not Call list). Page with `next_cursor`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many (1 to 200, default 50).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The next_cursor of the previous answer, unchanged. Leave out for the first page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The blocked users.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlockedListResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "l3blk",
                  "blocked": [
                    {
                      "wa_id": "61412345678"
                    },
                    {
                      "wa_id": "61498765432"
                    }
                  ],
                  "count": 2,
                  "next_cursor": "QVFIUkpVTXl4dE9Ed1"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_limit",
          "invalid_number_in_url",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "list_blocked_users",
        "x-a2e-needs": null
      },
      "post": {
        "tags": [
          "Contacts"
        ],
        "operationId": "blockUsers",
        "summary": "Block WhatsApp users",
        "description": "They cannot message the number and it cannot message them. Up to 1000 per call; only users who wrote in the last 24 hours.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BlockUsersRequest"
              },
              "example": {
                "users": [
                  "61412345678",
                  "AU.13491208655302741918"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "All blocked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlockUsersResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "b1lkp",
                  "blocked": [
                    {
                      "input": "+61412345678",
                      "wa_id": "61412345678"
                    }
                  ]
                }
              }
            }
          },
          "207": {
            "description": "Some blocked, some not (failed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlockUsersResponse"
                },
                "example": {
                  "success": false,
                  "request_id": "b1lkq",
                  "blocked": [
                    {
                      "input": "+61412345678",
                      "wa_id": "61412345678"
                    }
                  ],
                  "failed": [
                    {
                      "input": "AU.13491208655302741918",
                      "error": {
                        "code": "outside_24h_window",
                        "message": "Re-engagement required: User has not messaged in the last 24 hours",
                        "how_to_fix": "WhatsApp says the contact's 24 hour window is closed. ...",
                        "whatsapp_code": 131047
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_json",
          "invalid_number_in_url",
          "invalid_users",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "sandbox_key",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-scope": "contacts:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "block_users",
        "x-a2e-needs": null
      },
      "delete": {
        "tags": [
          "Contacts"
        ],
        "operationId": "unblockUsers",
        "summary": "Unblock WhatsApp users",
        "description": "Same body as blocking.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BlockUsersRequest"
              },
              "example": {
                "users": [
                  "61412345678"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "All unblocked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlockUsersResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "u2lkr",
                  "unblocked": [
                    {
                      "input": "+61412345678",
                      "wa_id": "61412345678"
                    }
                  ]
                }
              }
            }
          },
          "207": {
            "description": "Some unblocked, some not (failed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlockUsersResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_json",
          "invalid_number_in_url",
          "invalid_users",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "sandbox_key",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-scope": "contacts:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "unblock_users",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/contact-book/{bsuid}": {
      "get": {
        "tags": [
          "Contacts"
        ],
        "operationId": "getContactBookEntry",
        "summary": "Is a phone number on file for a business-scoped user id",
        "description": "WhatsApp's contact book (per business portfolio) keeps the numbers of users the business talked to, so webhooks include them. Never returns the number.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "bsuid",
            "in": "path",
            "required": true,
            "description": "The business-scoped user id (from_user_id of a message.received event), eg US.13491208655302741918. Parent ids (.ENT.) are refused.",
            "schema": {
              "type": "string",
              "example": "US.13491208655302741918"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Present or not.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactBookResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "c4bok",
                  "bsuid": "US.13491208655302741918",
                  "present": true
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "contact_book_error",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_bsuid",
          "invalid_cursor",
          "invalid_number_in_url",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "check_contact_book",
        "x-a2e-needs": null
      },
      "delete": {
        "tags": [
          "Contacts"
        ],
        "operationId": "deleteContactBookEntry",
        "summary": "Remove a business-scoped user id from the contact book",
        "description": "Later webhooks may then leave the number out (unless the user writes again).",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "bsuid",
            "in": "path",
            "required": true,
            "description": "The business-scoped user id (from_user_id of a message.received event), eg US.13491208655302741918. Parent ids (.ENT.) are refused.",
            "schema": {
              "type": "string",
              "example": "US.13491208655302741918"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Removed (deleted false: there was no entry).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactBookResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "c5bod",
                  "bsuid": "US.13491208655302741918",
                  "deleted": true
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "contact_book_error",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_bsuid",
          "invalid_cursor",
          "invalid_number_in_url",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "sandbox_key",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-scope": "contacts:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "delete_contact_book_entry",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/health": {
      "get": {
        "tags": [
          "Number"
        ],
        "operationId": "getNumberHealth",
        "summary": "Number health: can it send, quality, limit, name status",
        "description": "WhatsApp's health_status and the number's fields (quality, messaging limit, throughput, display name review, account mode). Kept 60 s.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "The health.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NumberHealthResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "h7q2m",
                  "health": {
                    "can_send_message": "AVAILABLE",
                    "entities": [
                      {
                        "entity_type": "PHONE_NUMBER",
                        "id": "106540352242922",
                        "can_send_message": "AVAILABLE"
                      },
                      {
                        "entity_type": "WABA",
                        "id": "102290129340398",
                        "can_send_message": "AVAILABLE"
                      }
                    ],
                    "display_phone_number": "+49 76659 348270",
                    "verified_name": "Lucky Shrub",
                    "quality_rating": "GREEN",
                    "messaging_limit": "TIER_2K",
                    "throughput": "STANDARD",
                    "status": "CONNECTED",
                    "name_status": "APPROVED",
                    "code_verification_status": "VERIFIED",
                    "account_mode": "LIVE",
                    "is_official_business_account": false,
                    "coexistence": false
                  },
                  "fetched_at": "2026-11-06T01:00:00.000Z"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_number_in_url",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "get_number_health",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/settings/identity-check": {
      "put": {
        "tags": [
          "Number"
        ],
        "operationId": "setIdentityCheck",
        "summary": "Turn WhatsApp's identity change check on or off",
        "description": "On: webhooks carry identity_key_hash, and a send with recipient_identity_key_hash is only delivered while it matches (else failed, code 137000).",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "Saved at WhatsApp.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdentityCheckResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "i2k7d",
                  "identity_check": {
                    "enabled": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IdentityCheckRequest"
              },
              "example": {
                "enabled": true
              }
            }
          }
        },
        "x-a2e-scope": "settings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_json",
          "invalid_number_in_url",
          "invalid_setting",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "sandbox_key",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/profile": {
      "get": {
        "tags": [
          "Number"
        ],
        "operationId": "getBusinessProfile",
        "summary": "The WhatsApp business profile",
        "description": "About, address, description, email, websites, vertical and the photo link, as WhatsApp users see them.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "The profile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessProfileResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "p4m1x",
                  "profile": {
                    "about": "Plants and flowers, delivered",
                    "address": "1 Garden Lane, Berlin",
                    "description": "Family florist since 1998.",
                    "email": "hello@luckyshrub.example",
                    "profile_picture_url": "https://pps.whatsapp.net/v/t61.24694-24/123_n.jpg",
                    "websites": [
                      "https://luckyshrub.example"
                    ],
                    "vertical": "RETAIL"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_number_in_url",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "get_profile",
        "x-a2e-needs": null
      },
      "patch": {
        "tags": [
          "Number"
        ],
        "operationId": "updateBusinessProfile",
        "summary": "Change the WhatsApp business profile",
        "description": "Fields left out stay as they are. Meta's own body (with messaging_product, profile_picture_handle) works unchanged.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "Changed at WhatsApp.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessProfileUpdateResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "p5n2y",
                  "updated": [
                    "about",
                    "websites"
                  ],
                  "profile": {
                    "about": "Plants and flowers, delivered same day",
                    "websites": [
                      "https://luckyshrub.example",
                      "https://luckyshrub.example/shop"
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessProfileUpdate"
              },
              "example": {
                "about": "Plants and flowers, delivered same day",
                "websites": [
                  "https://luckyshrub.example",
                  "https://luckyshrub.example/shop"
                ]
              }
            }
          }
        },
        "x-a2e-scope": "settings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_json",
          "invalid_number_in_url",
          "invalid_profile",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "nothing_to_change",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "sandbox_key",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "update_profile",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/profile/photo": {
      "put": {
        "tags": [
          "Number"
        ],
        "operationId": "setProfilePhoto",
        "summary": "Change the profile photo from a public link",
        "description": "app2email downloads the image (JPG or PNG, up to 5 MB; 640x640 px suggested) and uploads it to WhatsApp.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "Changed at WhatsApp.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfilePhotoResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "f8a3c",
                  "updated": [
                    "photo"
                  ],
                  "link": "https://luckyshrub.example/logo.png"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "The request or the media file is too large. Possible error.code values: request_too_large, media_too_large, approval_body_too_large, test_event_too_large, flow_json_too_large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProfilePhotoRequest"
              },
              "example": {
                "link": "https://luckyshrub.example/logo.png"
              }
            }
          }
        },
        "x-a2e-scope": "settings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_json",
          "invalid_media_link",
          "invalid_number_in_url",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_download_failed",
          "media_too_large",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "missing_url",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "profile_photo_failed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "sandbox_key",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_sample_media_failed",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "set_profile_photo",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/profile/display-name": {
      "put": {
        "tags": [
          "Number"
        ],
        "operationId": "setDisplayName",
        "summary": "Submit a new display name for Meta's review",
        "description": "Answer 202. GET /health shows new_name_status. After approval, number.updated (change display_name, next_step reconnect): press Reconnect on the dashboard within 14 days.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "202": {
            "description": "Submitted for review.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DisplayNameResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "d1s9w",
                  "display_name": {
                    "current": "Lucky Shrub",
                    "requested": "Lucky Shrub Florist",
                    "status": "PENDING_REVIEW"
                  },
                  "next_step": "wait_for_review",
                  "note": "When Meta approves the name, the number.updated event (change display_name, next_step reconnect) is sent: then press Reconnect on the dashboard within 14 days."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DisplayNameRequest"
              },
              "example": {
                "name": "Lucky Shrub Florist"
              }
            }
          }
        },
        "x-a2e-scope": "settings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_display_name",
          "invalid_json",
          "invalid_number_in_url",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "sandbox_key",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "set_display_name",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/profile/official-business-account": {
      "get": {
        "tags": [
          "Number"
        ],
        "operationId": "getOfficialBusinessAccount",
        "summary": "Official Business Account (blue tick) status",
        "description": "The state of the number's Official Business Account request.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "The status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OfficialBusinessAccountResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "o2b5a",
                  "official_business_account": {
                    "status": "UNDER_REVIEW",
                    "status_message": "Your request is being reviewed."
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_number_in_url",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      },
      "post": {
        "tags": [
          "Number"
        ],
        "operationId": "requestOfficialBusinessAccount",
        "summary": "Request an Official Business Account (blue tick)",
        "description": "Answer 202. Meta decides on notability; supporting_links: 5 to 10 articles about the business.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "202": {
            "description": "Submitted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OfficialBusinessAccountResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "o3c6b",
                  "official_business_account": {
                    "status": "PENDING",
                    "status_message": "Request submitted."
                  },
                  "tracking_id": "98765432101234"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OfficialBusinessAccountRequest"
              },
              "example": {
                "business_website_url": "https://luckyshrub.example",
                "primary_country_of_operation": "DE",
                "primary_language": "de",
                "supporting_links": [
                  "https://news.example/a",
                  "https://news.example/b",
                  "https://press.example/c",
                  "https://magazine.example/d",
                  "https://blog.example/e"
                ]
              }
            }
          }
        },
        "x-a2e-scope": "settings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_json",
          "invalid_number_in_url",
          "invalid_oba_request",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "sandbox_key",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/profile/india-compliance": {
      "get": {
        "tags": [
          "Number"
        ],
        "operationId": "getIndiaCompliance",
        "summary": "India business compliance information",
        "description": "The legal entity, grievance officer and customer care contacts (numbers in India).",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "The information (null: none).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IndiaComplianceResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "c7i1n",
                  "india_compliance": {
                    "entity_name": "Lucky Shrub Pvt Ltd",
                    "entity_type": "PRIVATE_COMPANY",
                    "grievance_officer_details": {
                      "name": "A. Rao",
                      "email": "grievance@luckyshrub.example",
                      "mobile_number": "+919812345678"
                    },
                    "customer_care_details": {
                      "email": "care@luckyshrub.example",
                      "landline_number": "+912212345678"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_number_in_url",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      },
      "put": {
        "tags": [
          "Number"
        ],
        "operationId": "setIndiaCompliance",
        "summary": "Set the India business compliance information",
        "description": "Replaces it. Needed for numbers that message users in India.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "Saved at WhatsApp.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IndiaComplianceResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "c8j2o",
                  "india_compliance": {
                    "entity_name": "Lucky Shrub Pvt Ltd",
                    "entity_type": "PRIVATE_COMPANY",
                    "grievance_officer_details": {
                      "name": "A. Rao",
                      "email": "grievance@luckyshrub.example",
                      "mobile_number": "+919812345678"
                    },
                    "customer_care_details": {
                      "email": "care@luckyshrub.example",
                      "landline_number": "+912212345678"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IndiaCompliance"
              },
              "example": {
                "entity_name": "Lucky Shrub Pvt Ltd",
                "entity_type": "PRIVATE_COMPANY",
                "grievance_officer_details": {
                  "name": "A. Rao",
                  "email": "grievance@luckyshrub.example",
                  "mobile_number": "+919812345678"
                },
                "customer_care_details": {
                  "email": "care@luckyshrub.example",
                  "landline_number": "+912212345678"
                }
              }
            }
          }
        },
        "x-a2e-scope": "settings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_compliance_info",
          "invalid_cursor",
          "invalid_json",
          "invalid_number_in_url",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "sandbox_key",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/username": {
      "get": {
        "tags": [
          "Number"
        ],
        "operationId": "getUsername",
        "summary": "The business username",
        "description": "status none: the number has no username.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "The username.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsernameResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "u1n4m",
                  "username": "luckyshrub",
                  "status": "approved"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_number_in_url",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "get_username",
        "x-a2e-needs": null
      },
      "put": {
        "tags": [
          "Number"
        ],
        "operationId": "setUsername",
        "summary": "Adopt or change the business username",
        "description": "3 to 35 characters of a-z, 0-9, '.', '_', with a letter. At most 2 changes in 14 days (422 username_change_limit).",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "Taken by WhatsApp.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsernameResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "u2o5n",
                  "username": "luckyshrub",
                  "status": "reserved"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UsernameRequest"
              },
              "example": {
                "username": "luckyshrub"
              }
            }
          }
        },
        "x-a2e-needs": "Meta enablement: business usernames (a higher messaging limit)",
        "x-a2e-scope": "settings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_json",
          "invalid_number_in_url",
          "invalid_username",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "sandbox_key",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "set_username"
      },
      "delete": {
        "tags": [
          "Number"
        ],
        "operationId": "deleteUsername",
        "summary": "Remove the business username",
        "description": "Removing does not reset the 14-day change limit.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "Removed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsernameDeleteResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "u3p6o",
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "settings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_number_in_url",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "sandbox_key",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/username/suggestions": {
      "get": {
        "tags": [
          "Number"
        ],
        "operationId": "getUsernameSuggestions",
        "summary": "Usernames reserved for the business",
        "description": "Reserved names have a higher chance of approval.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "The reserved names.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsernameSuggestionsResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "u4q7p",
                  "suggestions": [
                    "luckyshrub",
                    "lucky.shrub"
                  ],
                  "count": 2
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_number_in_url",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/settings/conversation-starters": {
      "get": {
        "tags": [
          "Number"
        ],
        "operationId": "getConversationStarters",
        "summary": "Ice breakers, commands and welcome message",
        "description": "What WhatsApp users see when they open a chat or type '/'.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "The conversation starters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationStartersResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "s1t8q",
                  "conversation_starters": {
                    "prompts": [
                      "Track my order",
                      "Opening hours"
                    ],
                    "commands": [
                      {
                        "name": "order",
                        "description": "Where is my order?"
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_number_in_url",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "get_conversation_starters",
        "x-a2e-needs": null
      },
      "put": {
        "tags": [
          "Number"
        ],
        "operationId": "setConversationStarters",
        "summary": "Set ice breakers, commands or the welcome message",
        "description": "Replaces the parts given. A tap or a command arrives as a normal text message (forwarded by email as usual).",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "Saved at WhatsApp.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationStartersResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "s2u9r",
                  "conversation_starters": {
                    "prompts": [
                      "Track my order",
                      "Opening hours"
                    ],
                    "commands": [
                      {
                        "name": "order",
                        "description": "Where is my order?"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConversationStarters"
              },
              "example": {
                "prompts": [
                  "Track my order",
                  "Opening hours"
                ],
                "commands": [
                  {
                    "name": "order",
                    "description": "Where is my order?"
                  }
                ]
              }
            }
          }
        },
        "x-a2e-scope": "settings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_conversation_starters",
          "invalid_cursor",
          "invalid_json",
          "invalid_number_in_url",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "nothing_to_change",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "sandbox_key",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "set_conversation_starters",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/qr-codes": {
      "get": {
        "tags": [
          "Number"
        ],
        "operationId": "listQrCodes",
        "summary": "QR codes and short links",
        "description": "Up to 2,000 per number. Codes never expire; WhatsApp gives no scan counts.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "image",
            "in": "query",
            "required": false,
            "description": "Also give each code's image link (qr_image_url) in this format.",
            "schema": {
              "type": "string",
              "enum": [
                "svg",
                "png"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many (1 to 200, default 50).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The next_cursor of the previous answer.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The codes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QrCodeListResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "q1r2s",
                  "qr_codes": [
                    {
                      "code": "4O4YGZEG3RIVE1",
                      "prefilled_message": "Hi, I saw your poster",
                      "deep_link_url": "https://wa.me/message/4O4YGZEG3RIVE1",
                      "qr_image_url": "https://scontent.xx.fbcdn.net/m1/v/t6/qr_4O4YGZEG3RIVE1.png"
                    }
                  ],
                  "count": 1
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_limit",
          "invalid_number_in_url",
          "invalid_setting",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "list_qr_codes",
        "x-a2e-needs": null
      },
      "post": {
        "tags": [
          "Number"
        ],
        "operationId": "createQrCode",
        "summary": "Create a QR code and wa.me short link",
        "description": "The chat opens with prefilled_message (up to 140 characters). Answer 201.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "201": {
            "description": "Made.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QrCodeResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "q2s3t",
                  "qr_code": {
                    "code": "4O4YGZEG3RIVE1",
                    "prefilled_message": "Hi, I saw your poster",
                    "deep_link_url": "https://wa.me/message/4O4YGZEG3RIVE1",
                    "qr_image_url": "https://scontent.xx.fbcdn.net/m1/v/t6/qr_4O4YGZEG3RIVE1.png"
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QrCodeCreateRequest"
              },
              "example": {
                "prefilled_message": "Hi, I saw your poster",
                "image": "png"
              }
            }
          }
        },
        "x-a2e-scope": "settings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_json",
          "invalid_number_in_url",
          "invalid_qr_code",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "sandbox_key",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "create_qr_code",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/qr-codes/{code}": {
      "get": {
        "tags": [
          "Number"
        ],
        "operationId": "getQrCode",
        "summary": "One QR code",
        "description": "With ?image=svg or png, its image link too.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "code",
            "in": "path",
            "required": true,
            "description": "The QR code's code (14 characters), as in the list.",
            "schema": {
              "type": "string",
              "example": "4O4YGZEG3RIVE1"
            }
          },
          {
            "name": "image",
            "in": "query",
            "required": false,
            "description": "Also give each code's image link (qr_image_url) in this format.",
            "schema": {
              "type": "string",
              "enum": [
                "svg",
                "png"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QrCodeResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "q3t4u",
                  "qr_code": {
                    "code": "4O4YGZEG3RIVE1",
                    "prefilled_message": "Hi, I saw your poster",
                    "deep_link_url": "https://wa.me/message/4O4YGZEG3RIVE1",
                    "qr_image_url": "https://scontent.xx.fbcdn.net/m1/v/t6/qr_4O4YGZEG3RIVE1.png"
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_number_in_url",
          "invalid_setting",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "qr_code_not_found",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      },
      "patch": {
        "tags": [
          "Number"
        ],
        "operationId": "updateQrCode",
        "summary": "Change a QR code's prefilled message",
        "description": "The code, link and image stay the same.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "code",
            "in": "path",
            "required": true,
            "description": "The QR code's code (14 characters), as in the list.",
            "schema": {
              "type": "string",
              "example": "4O4YGZEG3RIVE1"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Changed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QrCodeResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "q4u5v",
                  "qr_code": {
                    "code": "4O4YGZEG3RIVE1",
                    "prefilled_message": "Hi, I saw your new poster",
                    "deep_link_url": "https://wa.me/message/4O4YGZEG3RIVE1"
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QrCodeUpdateRequest"
              },
              "example": {
                "prefilled_message": "Hi, I saw your new poster"
              }
            }
          }
        },
        "x-a2e-scope": "settings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_json",
          "invalid_number_in_url",
          "invalid_qr_code",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "qr_code_not_found",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "sandbox_key",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "update_qr_code",
        "x-a2e-needs": null
      },
      "delete": {
        "tags": [
          "Number"
        ],
        "operationId": "deleteQrCode",
        "summary": "Delete a QR code and its short link",
        "description": "Printed codes and shared links stop working.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "code",
            "in": "path",
            "required": true,
            "description": "The QR code's code (14 characters), as in the list.",
            "schema": {
              "type": "string",
              "example": "4O4YGZEG3RIVE1"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QrCodeDeleteResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "q5v6w",
                  "deleted": true,
                  "code": "4O4YGZEG3RIVE1"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "settings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_number_in_url",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "qr_code_not_found",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "sandbox_key",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "delete_qr_code",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/settings/commerce": {
      "get": {
        "tags": [
          "Number"
        ],
        "operationId": "getCommerceSettings",
        "summary": "Cart and catalog icon on or off",
        "description": "WhatsApp's defaults: cart on, catalog icon hidden.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "The settings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceSettingsResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "m1c2a",
                  "commerce": {
                    "cart_enabled": true,
                    "catalog_visible": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_number_in_url",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      },
      "put": {
        "tags": [
          "Number"
        ],
        "operationId": "setCommerceSettings",
        "summary": "Turn the cart or the catalog icon on or off",
        "description": "One or both. Meta's is_cart_enabled / is_catalog_visible work too.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "Saved at WhatsApp.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommerceSettingsResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "m2d3b",
                  "commerce": {
                    "catalog_visible": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommerceSettings"
              },
              "example": {
                "catalog_visible": true
              }
            }
          }
        },
        "x-a2e-scope": "settings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_json",
          "invalid_number_in_url",
          "invalid_setting",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "nothing_to_change",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "sandbox_key",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/catalog": {
      "get": {
        "tags": [
          "Number"
        ],
        "operationId": "getCatalog",
        "summary": "The connected product catalog",
        "description": "Connected to the WhatsApp Business Account, so to every number on it. null: none.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "The catalog.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "g1h2i",
                  "catalog": {
                    "id": "1043215907766185",
                    "name": "Lucky Shrub plants"
                  },
                  "connected": true
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_number_in_url",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      },
      "put": {
        "tags": [
          "Number"
        ],
        "operationId": "connectCatalog",
        "summary": "Connect a product catalog",
        "description": "A catalog from Commerce Manager; the WABA-wide link for product messages.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "Connected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "g2i3j",
                  "catalog": {
                    "id": "1043215907766185"
                  },
                  "connected": true
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CatalogRequest"
              },
              "example": {
                "catalog_id": "1043215907766185"
              }
            }
          }
        },
        "x-a2e-scope": "settings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_catalog_id",
          "invalid_cursor",
          "invalid_json",
          "invalid_number_in_url",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "sandbox_key",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/partner": {
      "get": {
        "tags": [
          "Partner"
        ],
        "operationId": "getPartner",
        "summary": "The partner account",
        "description": "Status, site, Stripe connection, trial for new numbers, default redirect.",
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "The partner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "pa1xk",
                  "partner": {
                    "id": 12,
                    "status": "active",
                    "slug": "acme",
                    "brand_name": "Acme Messaging",
                    "site_url": "https://acme.app2email.com",
                    "custom_domain": null,
                    "domain_status": "none",
                    "fee_percent": 20,
                    "stripe": {
                      "connected": true,
                      "charges_enabled": true,
                      "test_mode": false,
                      "currency": "usd"
                    },
                    "trial": {
                      "enabled": true,
                      "messages": 50,
                      "days": 30
                    },
                    "redirect_url": "https://crm.example.com/whatsapp/connected",
                    "created": "2026-11-04T10:00:00Z"
                  },
                  "key": {
                    "id": "pk_Hc4dR8sLm2Qv9Xw1",
                    "name": "CRM",
                    "scopes": [
                      "partner:read",
                      "partner:manage",
                      "clients:manage",
                      "numbers:manage",
                      "keys:manage",
                      "billing:read",
                      "webhooks:manage"
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "partner:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "missing_api_key",
          "partner_closed",
          "partner_service_unavailable",
          "rate_limited",
          "route_not_found"
        ],
        "x-a2e-mcp-tool": null,
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      },
      "patch": {
        "tags": [
          "Partner"
        ],
        "operationId": "updatePartner",
        "summary": "Change the partner settings",
        "description": "The trial for new client numbers and the default onboarding redirect. Branding, domain, pricing and Stripe stay on /reseller.",
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Changed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "pa2yl",
                  "partner": {
                    "id": 12,
                    "status": "active",
                    "slug": "acme",
                    "brand_name": "Acme Messaging",
                    "site_url": "https://acme.app2email.com",
                    "custom_domain": null,
                    "domain_status": "none",
                    "fee_percent": 20,
                    "stripe": {
                      "connected": true,
                      "charges_enabled": true,
                      "test_mode": false,
                      "currency": "usd"
                    },
                    "trial": {
                      "enabled": true,
                      "messages": 100,
                      "days": 14
                    },
                    "redirect_url": "https://crm.example.com/whatsapp/connected",
                    "created": "2026-11-04T10:00:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "partner:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_json",
          "invalid_partner_settings",
          "invalid_redirect_url",
          "missing_api_key",
          "nothing_to_change",
          "partner_closed",
          "partner_service_unavailable",
          "partner_suspended",
          "rate_limited",
          "route_not_found",
          "unsupported_content_type"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PartnerUpdateRequest"
              },
              "example": {
                "redirect_url": "https://crm.example.com/whatsapp/connected",
                "trial": {
                  "enabled": true,
                  "messages": 100,
                  "days": 14
                }
              }
            }
          }
        },
        "x-a2e-mcp-tool": null,
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      }
    },
    "/v1/partner/clients": {
      "get": {
        "tags": [
          "Partner"
        ],
        "operationId": "listPartnerClients",
        "summary": "Clients",
        "description": "Your clients with their numbers. Filter by status or q (e-mail, name).",
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "active or suspended.",
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "suspended"
              ]
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Part of the e-mail address or name.",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1 to 200.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Skip this many.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The clients.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerClientsResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "pc1zm",
                  "clients": [
                    {
                      "id": "k3x9q2m7v8w1r4t",
                      "email": "ann@example.com",
                      "name": "Ann's Bakery",
                      "status": "active",
                      "created": "2026-11-05T08:00:00Z",
                      "numbers": [
                        "4976659348270"
                      ],
                      "numbers_count": 1
                    }
                  ],
                  "count": 1,
                  "total": 1,
                  "offset": 0,
                  "limit": 50
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "partner:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_limit",
          "invalid_status",
          "missing_api_key",
          "partner_closed",
          "partner_service_unavailable",
          "rate_limited",
          "route_not_found"
        ],
        "x-a2e-mcp-tool": null,
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      },
      "post": {
        "tags": [
          "Partner"
        ],
        "operationId": "createPartnerClient",
        "summary": "Create a client",
        "description": "A login on your site, no password yet. send_invite (default): your invitation e-mail with a single-use 24 h link to choose a password and connect WhatsApp. One per e-mail address every 5 s; 100 a day.",
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Made.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerClientCreated"
                },
                "example": {
                  "success": true,
                  "request_id": "pc3bo",
                  "client": {
                    "id": "k3x9q2m7v8w1r4t",
                    "email": "ann@example.com",
                    "name": "Ann's Bakery",
                    "status": "active",
                    "created": "2026-11-06T09:00:00.000Z",
                    "numbers": [],
                    "numbers_count": 0
                  },
                  "invite": {
                    "sent": true,
                    "expires": "2026-11-07T09:00:00Z",
                    "message": "The client got your invitation e-mail. Its link works once, for 24 hours."
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "clients:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "client_exists",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_client_request",
          "invalid_contact_email",
          "invalid_json",
          "invalid_onboarding_request",
          "invalid_redirect_url",
          "missing_api_key",
          "partner_closed",
          "partner_service_unavailable",
          "partner_suspended",
          "rate_limited",
          "route_not_found",
          "too_many_invites",
          "unsupported_content_type"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PartnerClientCreateRequest"
              },
              "example": {
                "email": "ann@example.com",
                "name": "Ann's Bakery",
                "send_invite": true,
                "state": "crm-lead-4711"
              }
            }
          }
        },
        "x-a2e-mcp-tool": null,
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      }
    },
    "/v1/partner/clients/{client_id}": {
      "get": {
        "tags": [
          "Partner"
        ],
        "operationId": "getPartnerClient",
        "summary": "One client",
        "description": "The client and its numbers.",
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "parameters": [
          {
            "name": "client_id",
            "in": "path",
            "required": true,
            "description": "The client's id (from GET /v1/partner/clients).",
            "schema": {
              "type": "string",
              "example": "k3x9q2m7v8w1r4t"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The client.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerClientResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "pc2an",
                  "client": {
                    "id": "k3x9q2m7v8w1r4t",
                    "email": "ann@example.com",
                    "name": "Ann's Bakery",
                    "status": "active",
                    "created": "2026-11-05T08:00:00Z",
                    "numbers": [
                      "4976659348270"
                    ],
                    "numbers_count": 1
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "partner:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "client_not_found",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "missing_api_key",
          "partner_closed",
          "partner_service_unavailable",
          "rate_limited",
          "route_not_found"
        ],
        "x-a2e-mcp-tool": null,
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      },
      "patch": {
        "tags": [
          "Partner"
        ],
        "operationId": "updatePartnerClient",
        "summary": "Change a client",
        "description": "name (logins of your site only), status: suspended logs the client out of your site.",
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "parameters": [
          {
            "name": "client_id",
            "in": "path",
            "required": true,
            "description": "The client's id (from GET /v1/partner/clients).",
            "schema": {
              "type": "string",
              "example": "k3x9q2m7v8w1r4t"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Changed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerClientUpdated"
                },
                "example": {
                  "success": true,
                  "request_id": "pc4cp",
                  "client": {
                    "id": "k3x9q2m7v8w1r4t",
                    "email": "ann@example.com",
                    "name": "Ann's Bakery",
                    "status": "suspended",
                    "created": "2026-11-05T08:00:00Z",
                    "numbers": [
                      "4976659348270"
                    ],
                    "numbers_count": 1
                  },
                  "changes": [
                    "status"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "clients:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "client_not_editable",
          "client_not_found",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_client_request",
          "invalid_json",
          "invalid_status",
          "missing_api_key",
          "nothing_to_change",
          "partner_closed",
          "partner_service_unavailable",
          "partner_suspended",
          "rate_limited",
          "route_not_found",
          "unsupported_content_type"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PartnerClientUpdateRequest"
              },
              "example": {
                "status": "suspended"
              }
            }
          }
        },
        "x-a2e-mcp-tool": null,
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      }
    },
    "/v1/partner/clients/{client_id}/usage": {
      "get": {
        "tags": [
          "Partner"
        ],
        "operationId": "getPartnerClientUsage",
        "summary": "Usage of a client",
        "description": "This billing month, per number of the client, and the totals.",
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "parameters": [
          {
            "name": "client_id",
            "in": "path",
            "required": true,
            "description": "The client's id (from GET /v1/partner/clients).",
            "schema": {
              "type": "string",
              "example": "k3x9q2m7v8w1r4t"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The usage.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerClientUsageResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "pu2gt",
                  "client_id": "k3x9q2m7v8w1r4t",
                  "numbers": [
                    {
                      "number": "4976659348270",
                      "client_id": "k3x9q2m7v8w1r4t",
                      "plan": "standard_2000",
                      "service_status": "LIVE",
                      "billing_period": {
                        "start": "2026-11-01T00:00:00Z",
                        "end": "2026-12-01T00:00:00Z"
                      },
                      "plan_messages": {
                        "whatsapp_sent": 400,
                        "emails_sent": 12,
                        "total_sent": 412,
                        "limit": 2000,
                        "left": 1588
                      },
                      "messages_received_this_billing_month": 230
                    }
                  ],
                  "totals": {
                    "total_sent": 412,
                    "whatsapp_sent": 400,
                    "emails_sent": 12,
                    "messages_received": 230
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "billing:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "client_not_found",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "missing_api_key",
          "partner_closed",
          "partner_service_unavailable",
          "rate_limited",
          "route_not_found"
        ],
        "x-a2e-mcp-tool": null,
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      }
    },
    "/v1/partner/numbers": {
      "get": {
        "tags": [
          "Partner"
        ],
        "operationId": "listPartnerNumbers",
        "summary": "Numbers of your clients",
        "description": "Status, plan and features, messages used, current subscription. client_id: one client's.",
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "parameters": [
          {
            "name": "client_id",
            "in": "query",
            "required": false,
            "description": "Only this client's numbers.",
            "schema": {
              "type": "string",
              "example": "k3x9q2m7v8w1r4t"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The numbers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerNumbersResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "pn1dq",
                  "numbers": [
                    {
                      "number": "4976659348270",
                      "display_number": "+49 7665 9348270",
                      "name": "Ann's Bakery",
                      "client_id": "k3x9q2m7v8w1r4t",
                      "status": "live",
                      "service_status": "LIVE",
                      "plan": "standard_2000",
                      "features": [
                        "api",
                        "templates",
                        "broadcast"
                      ],
                      "api_allowed": true,
                      "plan_messages": {
                        "total_sent": 412,
                        "limit": 2000
                      },
                      "billing_period_end": "2026-12-01T00:00:00Z",
                      "renewal_enabled": true,
                      "subscription": {
                        "id": 4211,
                        "tier_id": "growth",
                        "tier_name": "Growth",
                        "interval": "month",
                        "messages_per_month": 2000,
                        "price": {
                          "amount_minor": 4900,
                          "currency": "usd"
                        },
                        "status": "active",
                        "source": "stripe",
                        "cancel_at_period_end": false,
                        "current_period_start": "2026-11-01T00:00:00Z",
                        "current_period_end": "2026-12-01T00:00:00Z",
                        "is_current": true,
                        "canceled_at": null,
                        "ended_reason": null,
                        "test_mode": false,
                        "client_id": "k3x9q2m7v8w1r4t"
                      }
                    }
                  ],
                  "count": 1
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "partner:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "client_not_found",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "missing_api_key",
          "partner_closed",
          "partner_service_unavailable",
          "rate_limited",
          "route_not_found"
        ],
        "x-a2e-mcp-tool": null,
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      }
    },
    "/v1/partner/numbers/{number}": {
      "get": {
        "tags": [
          "Partner"
        ],
        "operationId": "getPartnerNumber",
        "summary": "One number",
        "description": "Status, plan and features, messages used, current subscription.",
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "parameters": [
          {
            "name": "number",
            "in": "path",
            "required": true,
            "description": "A number of one of your clients: country code first, digits only.",
            "schema": {
              "type": "string",
              "example": "4976659348270",
              "pattern": "^[0-9]{8,15}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The number.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerNumberResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "pn2er",
                  "number": {
                    "number": "4976659348270",
                    "display_number": "+49 7665 9348270",
                    "name": "Ann's Bakery",
                    "client_id": "k3x9q2m7v8w1r4t",
                    "status": "live",
                    "service_status": "LIVE",
                    "plan": "standard_2000",
                    "features": [
                      "api",
                      "templates",
                      "broadcast"
                    ],
                    "api_allowed": true,
                    "plan_messages": {
                      "total_sent": 412,
                      "limit": 2000
                    },
                    "billing_period_end": "2026-12-01T00:00:00Z",
                    "renewal_enabled": true,
                    "subscription": {
                      "id": 4211,
                      "tier_id": "growth",
                      "tier_name": "Growth",
                      "interval": "month",
                      "messages_per_month": 2000,
                      "price": {
                        "amount_minor": 4900,
                        "currency": "usd"
                      },
                      "status": "active",
                      "source": "stripe",
                      "cancel_at_period_end": false,
                      "current_period_start": "2026-11-01T00:00:00Z",
                      "current_period_end": "2026-12-01T00:00:00Z",
                      "is_current": true,
                      "canceled_at": null,
                      "ended_reason": null,
                      "test_mode": false,
                      "client_id": "k3x9q2m7v8w1r4t"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "partner:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_number_in_url",
          "missing_api_key",
          "number_not_found",
          "partner_closed",
          "partner_service_unavailable",
          "rate_limited",
          "route_not_found"
        ],
        "x-a2e-mcp-tool": null,
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      }
    },
    "/v1/partner/numbers/{number}/usage": {
      "get": {
        "tags": [
          "Partner"
        ],
        "operationId": "getPartnerNumberUsage",
        "summary": "Usage of a number",
        "description": "Sent (WhatsApp + e-mail) against the plan's limit, and received, this billing month.",
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "parameters": [
          {
            "name": "number",
            "in": "path",
            "required": true,
            "description": "A number of one of your clients: country code first, digits only.",
            "schema": {
              "type": "string",
              "example": "4976659348270",
              "pattern": "^[0-9]{8,15}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The usage.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerNumberUsageResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "pu1fs",
                  "usage": {
                    "number": "4976659348270",
                    "client_id": "k3x9q2m7v8w1r4t",
                    "plan": "standard_2000",
                    "service_status": "LIVE",
                    "billing_period": {
                      "start": "2026-11-01T00:00:00Z",
                      "end": "2026-12-01T00:00:00Z"
                    },
                    "plan_messages": {
                      "whatsapp_sent": 400,
                      "emails_sent": 12,
                      "total_sent": 412,
                      "limit": 2000,
                      "left": 1588
                    },
                    "messages_received_this_billing_month": 230
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "billing:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_number_in_url",
          "missing_api_key",
          "number_not_found",
          "partner_closed",
          "partner_service_unavailable",
          "rate_limited",
          "route_not_found"
        ],
        "x-a2e-mcp-tool": null,
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      }
    },
    "/v1/partner/numbers/{number}/keys": {
      "get": {
        "tags": [
          "Partner"
        ],
        "operationId": "listPartnerNumberKeys",
        "summary": "Keys of a number",
        "description": "Name, permissions, sandbox, last use. Never the keys themselves.",
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "parameters": [
          {
            "name": "number",
            "in": "path",
            "required": true,
            "description": "A number of one of your clients: country code first, digits only.",
            "schema": {
              "type": "string",
              "example": "4976659348270",
              "pattern": "^[0-9]{8,15}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The keys.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerNumberKeysResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "pk1hu",
                  "number": "4976659348270",
                  "keys": [
                    {
                      "id": 812,
                      "name": "CRM",
                      "prefix": "a2e_",
                      "first4": "ZDQ3",
                      "last4": "Sgn1",
                      "scopes": [
                        "messages:send",
                        "messages:read"
                      ],
                      "ip_allow": [],
                      "created": "2026-11-06T09:10:00Z",
                      "last_used": null,
                      "expires": null,
                      "sandbox": false,
                      "daily_cap": 0,
                      "approval_above": 0
                    }
                  ],
                  "count": 1
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "keys:manage",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_number_in_url",
          "missing_api_key",
          "number_not_found",
          "partner_closed",
          "partner_service_unavailable",
          "rate_limited",
          "route_not_found"
        ],
        "x-a2e-mcp-tool": null,
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      },
      "post": {
        "tags": [
          "Partner"
        ],
        "operationId": "createPartnerNumberKey",
        "summary": "Create a key for a client's number",
        "description": "The dashboard's key, for /v1/{number}/... and the messaging MCP. Shown once. Sandbox unless \"sandbox\": false. The number must be LIVE on a plan with the API (409 number_not_live + Retry-After); at most 10 keys per number.",
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "parameters": [
          {
            "name": "number",
            "in": "path",
            "required": true,
            "description": "A number of one of your clients: country code first, digits only.",
            "schema": {
              "type": "string",
              "example": "4976659348270",
              "pattern": "^[0-9]{8,15}$"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "The key (shown once).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountNumberKeyCreated"
                },
                "example": {
                  "success": true,
                  "request_id": "pk2iv",
                  "api_key": "a2e_ZDQ3Y191c2VyXzQ5NzY2NTkzNDgyNzBfMTc2MjQwMDAwMDAwMA.Ex4mpl3S1gn1",
                  "key": {
                    "id": 812,
                    "name": "CRM",
                    "prefix": "a2e_",
                    "first4": "ZDQ3",
                    "last4": "Sgn1",
                    "scopes": [
                      "messages:send",
                      "messages:read"
                    ],
                    "ip_allow": [],
                    "created": "2026-11-06T09:10:00Z",
                    "last_used": null,
                    "expires": null,
                    "sandbox": false,
                    "daily_cap": 0,
                    "approval_above": 0
                  },
                  "number": "4976659348270",
                  "message": "The key is shown only this once. Send it as Authorization: Bearer <api_key> to https://api.app2email.com/v1/4976659348270/... or https://api.app2email.com/mcp."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "keys:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_json",
          "invalid_key_request",
          "invalid_number_in_url",
          "key_limit_reached",
          "key_limits_unavailable",
          "missing_api_key",
          "number_not_found",
          "number_not_live",
          "partner_closed",
          "partner_service_unavailable",
          "partner_suspended",
          "rate_limited",
          "route_not_found",
          "unsupported_content_type"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountNumberKeyRequest"
              },
              "example": {
                "name": "CRM",
                "scopes": "send",
                "sandbox": false
              }
            }
          }
        },
        "x-a2e-mcp-tool": null,
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      }
    },
    "/v1/partner/numbers/{number}/keys/{key_id}": {
      "delete": {
        "tags": [
          "Partner"
        ],
        "operationId": "revokePartnerNumberKey",
        "summary": "Revoke a key of a client's number",
        "description": "Calls with it fail within 10 seconds. Also while suspended.",
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "parameters": [
          {
            "name": "number",
            "in": "path",
            "required": true,
            "description": "A number of one of your clients: country code first, digits only.",
            "schema": {
              "type": "string",
              "example": "4976659348270",
              "pattern": "^[0-9]{8,15}$"
            }
          },
          {
            "name": "key_id",
            "in": "path",
            "required": true,
            "description": "The key's id (from the list).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "example": 812
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountRevokeResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "pk3jw",
                  "revoked": true,
                  "key_id": 812,
                  "number": "4976659348270",
                  "message": "Revoked. The API refuses the key within 10 seconds."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "keys:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_number_in_url",
          "key_not_found",
          "missing_api_key",
          "number_not_found",
          "partner_closed",
          "partner_service_unavailable",
          "rate_limited",
          "route_not_found"
        ],
        "x-a2e-mcp-tool": null,
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      }
    },
    "/v1/partner/onboarding-links": {
      "post": {
        "tags": [
          "Partner"
        ],
        "operationId": "createOnboardingLink",
        "summary": "Onboarding link for a new or existing client",
        "description": "Single use, 24 h, signed, on your site. The person signs up or in, connects WhatsApp, presses Finish, and lands on redirect_url with ?client=<client id>&numbers=<number,...>&state=<state>.",
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "The link.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnboardingLinkResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "po1kx",
                  "link": {
                    "id": "ol_Q7pX2mLw9Rk4Tz1bH3cV5n",
                    "url": "https://acme.app2email.com/onboard/ol_Q7pX2mLw9Rk4Tz1bH3cV5n.1762506000.fQ2kLm9Rt4Zx7Cv1Bn8Mw0",
                    "expires": "2026-11-07T09:00:00Z",
                    "client_id": null,
                    "email": "ben@example.com",
                    "state": "crm-lead-4712",
                    "redirect_url": "https://crm.example.com/whatsapp/connected"
                  },
                  "message": "Give the url to the person. It works once, for 24 hours, on your site only."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "clients:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "client_not_found",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_contact_email",
          "invalid_json",
          "invalid_onboarding_request",
          "invalid_redirect_url",
          "missing_api_key",
          "partner_closed",
          "partner_service_unavailable",
          "partner_suspended",
          "rate_limited",
          "route_not_found",
          "too_many_invites",
          "unsupported_content_type"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OnboardingLinkRequest"
              },
              "example": {
                "email": "ben@example.com",
                "name": "Ben's Garage",
                "state": "crm-lead-4712",
                "redirect_url": "https://crm.example.com/whatsapp/connected"
              }
            }
          }
        },
        "x-a2e-mcp-tool": null,
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      }
    },
    "/v1/partner/payments": {
      "get": {
        "tags": [
          "Partner"
        ],
        "operationId": "listPartnerPayments",
        "summary": "Client payments",
        "description": "Your Stripe ledger with app2email's fee, newest first, with totals per currency. This site's Stripe mode only.",
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "From this date (ISO 8601).",
            "schema": {
              "type": "string",
              "example": "2026-11-01"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "Before this date.",
            "schema": {
              "type": "string",
              "example": "2026-12-01"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1 to 500.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The payments.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerPaymentsResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "pp1ly",
                  "mode": "live",
                  "payments": [
                    {
                      "id": 901,
                      "client_id": "k3x9q2m7v8w1r4t",
                      "number_id": 3120,
                      "subscription_id": 4211,
                      "description": "Growth - 2,000 messages / month",
                      "amount_minor": 4900,
                      "refunded_minor": 0,
                      "application_fee_minor": 980,
                      "net_minor": 3920,
                      "currency": "usd",
                      "status": "paid",
                      "billing_reason": "subscription_cycle",
                      "period_start": "2026-11-01T00:00:00Z",
                      "period_end": "2026-12-01T00:00:00Z",
                      "paid_at": "2026-11-01T00:03:12Z",
                      "stripe_invoice_id": "in_1QxY2zAbCdEfGh",
                      "test_mode": false
                    }
                  ],
                  "count": 1,
                  "totals": [
                    {
                      "currency": "usd",
                      "count": 1,
                      "gross_minor": 4900,
                      "fee_minor": 980,
                      "refunded_minor": 0,
                      "net_minor": 3920
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "billing:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_limit",
          "invalid_time",
          "missing_api_key",
          "partner_closed",
          "partner_service_unavailable",
          "rate_limited",
          "route_not_found"
        ],
        "x-a2e-mcp-tool": null,
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      }
    },
    "/v1/partner/subscriptions": {
      "get": {
        "tags": [
          "Partner"
        ],
        "operationId": "listPartnerSubscriptions",
        "summary": "Client plans",
        "description": "Every plan of your clients' numbers, newest first. current=true: the plans in force.",
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "parameters": [
          {
            "name": "current",
            "in": "query",
            "required": false,
            "description": "true or false.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "client_id",
            "in": "query",
            "required": false,
            "description": "Only this client's.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1 to 500.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The plans.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerSubscriptionsResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "ps1mz",
                  "mode": "live",
                  "subscriptions": [
                    {
                      "id": 4211,
                      "tier_id": "growth",
                      "tier_name": "Growth",
                      "interval": "month",
                      "messages_per_month": 2000,
                      "price": {
                        "amount_minor": 4900,
                        "currency": "usd"
                      },
                      "status": "active",
                      "source": "stripe",
                      "cancel_at_period_end": false,
                      "current_period_start": "2026-11-01T00:00:00Z",
                      "current_period_end": "2026-12-01T00:00:00Z",
                      "is_current": true,
                      "canceled_at": null,
                      "ended_reason": null,
                      "test_mode": false,
                      "client_id": "k3x9q2m7v8w1r4t",
                      "number": "4976659348270"
                    }
                  ],
                  "count": 1
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "billing:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "client_not_found",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_limit",
          "invalid_status",
          "missing_api_key",
          "partner_closed",
          "partner_service_unavailable",
          "rate_limited",
          "route_not_found"
        ],
        "x-a2e-mcp-tool": null,
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      }
    },
    "/v1/partner/webhooks": {
      "get": {
        "tags": [
          "Partner"
        ],
        "operationId": "listPartnerWebhooks",
        "summary": "Partner webhooks",
        "description": "Your webhooks with their last delivery. Every event of every client number, plus the partner events (client.*, subscription.*, trial.*, ...).",
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "The webhooks.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhooksResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "wh1na",
                  "events_available": [
                    "message.status",
                    "message.received",
                    "message.failed",
                    "number.updated",
                    "client.created",
                    "subscription.renewed",
                    "..."
                  ],
                  "webhooks": [
                    {
                      "id": "wh_a1b2c3d4e5f6g7h8",
                      "url": "https://crm.example.com/app2email/partner-events",
                      "events": [
                        "message.status",
                        "message.received",
                        "message.failed",
                        "number.updated",
                        "client.created",
                        "subscription.renewed",
                        "..."
                      ],
                      "secret": "whsec_3Fq9LmZ2xT8pW1rK7vB4nD6sH0jC5yA9",
                      "created": "2026-11-06T09:00:00.000Z",
                      "active": true,
                      "format": "app2email",
                      "last_delivery": {
                        "at": "2026-11-06T09:05:00.000Z",
                        "ok": true,
                        "result": "HTTP 200 in 142 ms"
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "webhooks:manage",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "missing_api_key",
          "partner_closed",
          "partner_service_unavailable",
          "rate_limited",
          "route_not_found"
        ],
        "x-a2e-mcp-tool": null,
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      },
      "post": {
        "tags": [
          "Partner"
        ],
        "operationId": "createPartnerWebhook",
        "summary": "Add a partner webhook",
        "description": "Every event goes to every webhook (filter by type). Signed like a number's webhooks (X-App2email-Signature, X-Hub-Signature-256). At most 5. \"format\": \"meta\" is not available here.",
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Added. Keep the secret.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "wh2ob",
                  "webhook": {
                    "id": "wh_a1b2c3d4e5f6g7h8",
                    "url": "https://crm.example.com/app2email/partner-events",
                    "events": [
                      "message.status",
                      "message.received",
                      "message.failed",
                      "number.updated",
                      "client.created",
                      "subscription.renewed",
                      "..."
                    ],
                    "secret": "whsec_3Fq9LmZ2xT8pW1rK7vB4nD6sH0jC5yA9",
                    "created": "2026-11-06T09:00:00.000Z",
                    "active": true,
                    "format": "app2email",
                    "last_delivery": {
                      "at": "2026-11-06T09:05:00.000Z",
                      "ok": true,
                      "result": "HTTP 200 in 142 ms"
                    }
                  },
                  "note": "Keep the secret: check each event's X-App2email-Signature (or X-Hub-Signature-256) header with it. To try the URL now: POST https://api.app2email.com/v1/partner/webhooks/wh_a1b2c3d4e5f6g7h8/test"
                }
              }
            }
          },
          "200": {
            "description": "This URL had a webhook already: it is on again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "wh3pc",
                  "webhook": {
                    "id": "wh_a1b2c3d4e5f6g7h8",
                    "url": "https://crm.example.com/app2email/partner-events",
                    "events": [
                      "message.status",
                      "message.received",
                      "message.failed",
                      "number.updated",
                      "client.created",
                      "subscription.renewed",
                      "..."
                    ],
                    "secret": "whsec_3Fq9LmZ2xT8pW1rK7vB4nD6sH0jC5yA9",
                    "created": "2026-11-06T09:00:00.000Z",
                    "active": true,
                    "format": "app2email",
                    "last_delivery": {
                      "at": "2026-11-06T09:05:00.000Z",
                      "ok": true,
                      "result": "HTTP 200 in 142 ms"
                    }
                  },
                  "note": "This URL already had a webhook: it is on. The id and secret are unchanged."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "webhooks:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_json",
          "invalid_webhook_format",
          "invalid_webhook_headers",
          "invalid_webhook_url",
          "missing_api_key",
          "missing_url",
          "partner_closed",
          "partner_service_unavailable",
          "partner_suspended",
          "rate_limited",
          "route_not_found",
          "too_many_webhooks",
          "unsupported_content_type"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookRequest"
              },
              "example": {
                "url": "https://crm.example.com/app2email/partner-events",
                "headers": {
                  "Authorization": "Basic dXNlcjpwYXNz"
                }
              }
            }
          }
        },
        "x-a2e-mcp-tool": null,
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      }
    },
    "/v1/partner/webhooks/{id}": {
      "patch": {
        "tags": [
          "Partner"
        ],
        "operationId": "updatePartnerWebhook",
        "summary": "Change a partner webhook",
        "description": "url, active (true turns a switched-off webhook on), headers.",
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The webhook's id.",
            "schema": {
              "type": "string",
              "example": "wh_a1b2c3d4e5f6g7h8"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Changed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "wh4qd",
                  "webhook": {
                    "id": "wh_a1b2c3d4e5f6g7h8",
                    "url": "https://crm.example.com/app2email/partner-events",
                    "events": [
                      "message.status",
                      "message.received",
                      "message.failed",
                      "number.updated",
                      "client.created",
                      "subscription.renewed",
                      "..."
                    ],
                    "secret": "whsec_3Fq9LmZ2xT8pW1rK7vB4nD6sH0jC5yA9",
                    "created": "2026-11-06T09:00:00.000Z",
                    "active": true,
                    "format": "app2email",
                    "last_delivery": {
                      "at": "2026-11-06T09:05:00.000Z",
                      "ok": true,
                      "result": "HTTP 200 in 142 ms"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "webhooks:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_json",
          "invalid_webhook_format",
          "invalid_webhook_headers",
          "invalid_webhook_url",
          "missing_api_key",
          "nothing_to_change",
          "partner_closed",
          "partner_service_unavailable",
          "partner_suspended",
          "rate_limited",
          "route_not_found",
          "unsupported_content_type",
          "webhook_not_found",
          "webhook_url_in_use"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPatchRequest"
              },
              "example": {
                "active": true
              }
            }
          }
        },
        "x-a2e-mcp-tool": null,
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      },
      "delete": {
        "tags": [
          "Partner"
        ],
        "operationId": "deletePartnerWebhook",
        "summary": "Delete a partner webhook",
        "description": "No more events go to it. Also while suspended.",
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The webhook's id.",
            "schema": {
              "type": "string",
              "example": "wh_a1b2c3d4e5f6g7h8"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeleteResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "wh5re",
                  "deleted": "wh_a1b2c3d4e5f6g7h8"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "webhooks:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "missing_api_key",
          "partner_closed",
          "partner_service_unavailable",
          "rate_limited",
          "route_not_found",
          "webhook_not_found"
        ],
        "x-a2e-mcp-tool": null,
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      }
    },
    "/v1/partner/webhooks/{id}/test": {
      "post": {
        "tags": [
          "Partner"
        ],
        "operationId": "testPartnerWebhook",
        "summary": "Send a test event to a partner webhook",
        "description": "No body: a ping. {\"type\": \"subscription.renewed\"}: that event's sample. {\"event\": {...}}: that event as given. 30 an hour.",
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The webhook's id.",
            "schema": {
              "type": "string",
              "example": "wh_a1b2c3d4e5f6g7h8"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "How the URL answered.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookTestResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "wh6sf",
                  "delivered": true,
                  "http_status": 200,
                  "response_ms": 142,
                  "error": null,
                  "response_body": "{\"ok\":true}",
                  "sent_headers": {
                    "Content-Type": "application/json; charset=utf-8",
                    "X-App2email-Event": "client.created",
                    "X-App2email-Delivery": "evt_Pa3k9m2Lw8Rt5Yp1Zs01",
                    "X-App2email-Signature": "t=1762419600,v1=5f2c...",
                    "X-App2email-Test": "true"
                  },
                  "sent_event": {
                    "id": "evt_Pa3k9m2Lw8Rt5Yp1Zs01",
                    "type": "client.created",
                    "created": "2026-11-06T09:00:00.000Z",
                    "number": "",
                    "data": {
                      "client": {
                        "id": "k3x9q2m7v8w1r4t",
                        "email": "ann@example.com",
                        "name": "Ann's Bakery",
                        "status": "active",
                        "created": "2026-11-05T08:00:00Z",
                        "numbers": [
                          "4976659348270"
                        ],
                        "numbers_count": 1
                      },
                      "source": "partner_api",
                      "timestamp": "2026-11-06T09:00:00.000Z"
                    },
                    "test": true
                  },
                  "sent_body": "{\"id\":\"evt_Pa3k9m2Lw8Rt5Yp1Zs01\",\"type\":\"client.created\",...}"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "The request or the media file is too large. Possible error.code values: request_too_large, media_too_large, approval_body_too_large, test_event_too_large, flow_json_too_large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "webhooks:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_events",
          "invalid_json",
          "invalid_test_event",
          "missing_api_key",
          "partner_closed",
          "partner_service_unavailable",
          "partner_suspended",
          "rate_limited",
          "route_not_found",
          "test_event_too_large",
          "too_many_tests",
          "unsupported_content_type",
          "webhook_not_found"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookTestRequest"
              },
              "example": {
                "type": "client.created"
              }
            }
          }
        },
        "x-a2e-mcp-tool": null,
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      }
    },
    "/v1/partner/webhooks/{id}/rotate-secret": {
      "post": {
        "tags": [
          "Partner"
        ],
        "operationId": "rotatePartnerWebhookSecret",
        "summary": "New signing secret for a partner webhook",
        "description": "keep_old_for_hours 1-24: the old secret signs too until then.",
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The webhook's id.",
            "schema": {
              "type": "string",
              "example": "wh_a1b2c3d4e5f6g7h8"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The new secret.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "wh7tg",
                  "webhook": {
                    "id": "wh_a1b2c3d4e5f6g7h8",
                    "url": "https://crm.example.com/app2email/partner-events",
                    "events": [
                      "message.status",
                      "message.received",
                      "message.failed",
                      "number.updated",
                      "client.created",
                      "subscription.renewed",
                      "..."
                    ],
                    "secret": "whsec_9Zx8Wv7Ut6Sr5Qp4On3Ml2Kj1Ih0Gf9Ed",
                    "created": "2026-11-06T09:00:00.000Z",
                    "active": true,
                    "format": "app2email",
                    "last_delivery": {
                      "at": "2026-11-06T09:05:00.000Z",
                      "ok": true,
                      "result": "HTTP 200 in 142 ms"
                    },
                    "previous_secret_until": "2026-11-07T09:00:00.000Z"
                  },
                  "note": "Events are signed with the new secret from now on, and with the old one too until 2026-11-07T09:00:00.000Z."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "webhooks:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_json",
          "invalid_keep_old_for_hours",
          "missing_api_key",
          "partner_closed",
          "partner_service_unavailable",
          "partner_suspended",
          "rate_limited",
          "route_not_found",
          "unsupported_content_type",
          "webhook_not_found"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookRotateRequest"
              },
              "example": {
                "keep_old_for_hours": 24
              }
            }
          }
        },
        "x-a2e-mcp-tool": null,
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      }
    },
    "/v1/partner/webhooks/{id}/deliveries": {
      "get": {
        "tags": [
          "Partner"
        ],
        "operationId": "listPartnerWebhookDeliveries",
        "summary": "Deliveries of a partner webhook",
        "description": "The last 100 of 7 days, every attempt.",
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The webhook's id.",
            "schema": {
              "type": "string",
              "example": "wh_a1b2c3d4e5f6g7h8"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1 to 100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "failed or delivered.",
            "schema": {
              "type": "string",
              "enum": [
                "failed",
                "delivered"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The deliveries.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveriesResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "wh8uh",
                  "deliveries": [
                    {
                      "event_id": "evt_Pa3k9m2Lw8Rt5Yp1Zs01",
                      "type": "client.created",
                      "created": "2026-11-06T09:00:00.000Z",
                      "delivered": false,
                      "next_attempt_at": "2026-11-06T09:01:10.000Z",
                      "attempts": [
                        {
                          "at": "2026-11-06T09:00:00.000Z",
                          "ok": false,
                          "http_status": 503,
                          "ms": 2001,
                          "error": "the URL answered HTTP 503"
                        }
                      ]
                    }
                  ],
                  "note": "The last 100 deliveries of the last 7 days."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "webhooks:manage",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_status",
          "missing_api_key",
          "partner_closed",
          "partner_service_unavailable",
          "rate_limited",
          "route_not_found",
          "webhook_not_found"
        ],
        "x-a2e-mcp-tool": null,
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      }
    },
    "/v1/partner/webhooks/{id}/deliveries/{event_id}": {
      "get": {
        "tags": [
          "Partner"
        ],
        "operationId": "getPartnerWebhookDelivery",
        "summary": "One delivery of a partner webhook",
        "description": "Every attempt and the event as sent.",
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The webhook's id.",
            "schema": {
              "type": "string",
              "example": "wh_a1b2c3d4e5f6g7h8"
            }
          },
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "description": "The event's id (from the deliveries).",
            "schema": {
              "type": "string",
              "example": "evt_Pa3k9m2Lw8Rt5Yp1Zs01"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "wh9vi",
                  "delivery": {
                    "event_id": "evt_Pa3k9m2Lw8Rt5Yp1Zs01",
                    "type": "client.created",
                    "created": "2026-11-06T09:00:00.000Z",
                    "delivered": true,
                    "attempts": [
                      {
                        "at": "2026-11-06T09:00:00.000Z",
                        "ok": true,
                        "http_status": 200,
                        "ms": 142
                      }
                    ],
                    "event_body": {
                      "id": "evt_Pa3k9m2Lw8Rt5Yp1Zs01",
                      "type": "client.created",
                      "created": "2026-11-06T09:00:00.000Z",
                      "number": "",
                      "data": {
                        "client": {
                          "id": "k3x9q2m7v8w1r4t",
                          "email": "ann@example.com",
                          "name": "Ann's Bakery",
                          "status": "active",
                          "created": "2026-11-05T08:00:00Z",
                          "numbers": [
                            "4976659348270"
                          ],
                          "numbers_count": 1
                        },
                        "source": "partner_api",
                        "timestamp": "2026-11-06T09:00:00.000Z"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "webhooks:manage",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "delivery_not_found",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "missing_api_key",
          "partner_closed",
          "partner_service_unavailable",
          "rate_limited",
          "route_not_found",
          "webhook_not_found"
        ],
        "x-a2e-mcp-tool": null,
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      }
    },
    "/v1/partner/webhooks/{id}/deliveries/{event_id}/redeliver": {
      "post": {
        "tags": [
          "Partner"
        ],
        "operationId": "redeliverPartnerWebhookEvent",
        "summary": "Send a stored event again to a partner webhook",
        "description": "Same event id and body.",
        "security": [
          {
            "PartnerKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The webhook's id.",
            "schema": {
              "type": "string",
              "example": "wh_a1b2c3d4e5f6g7h8"
            }
          },
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "description": "The event's id (from the deliveries).",
            "schema": {
              "type": "string",
              "example": "evt_Pa3k9m2Lw8Rt5Yp1Zs01"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "How the URL answered.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookRedeliverResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "whawj",
                  "delivered": true,
                  "http_status": 200,
                  "response_ms": 180,
                  "error": null
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "webhooks:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "delivery_in_progress",
          "delivery_not_found",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_json",
          "missing_api_key",
          "partner_closed",
          "partner_service_unavailable",
          "partner_suspended",
          "rate_limited",
          "route_not_found",
          "unsupported_content_type",
          "webhook_not_found"
        ],
        "x-a2e-mcp-tool": null,
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      }
    },
    "/v1/account/webhooks": {
      "get": {
        "tags": [
          "Account management"
        ],
        "operationId": "listAccountWebhooks",
        "summary": "Account webhooks",
        "description": "The account's webhooks with their last delivery. Every event of the account's numbers that can use the API (a plan with the API, LIVE); for every number also number.created, number.ready, number.disconnected, number.reconnected, trial.*, plan.limit_reached, api_key.*.",
        "security": [
          {
            "AccountKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "The webhooks.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhooksResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "wh1na",
                  "events_available": [
                    "message.status",
                    "message.received",
                    "message.failed",
                    "number.updated",
                    "client.created",
                    "subscription.renewed",
                    "..."
                  ],
                  "webhooks": [
                    {
                      "id": "wh_a1b2c3d4e5f6g7h8",
                      "url": "https://hooks.example.com/app2email/account",
                      "events": [
                        "message.status",
                        "message.received",
                        "message.failed",
                        "number.updated",
                        "client.created",
                        "subscription.renewed",
                        "..."
                      ],
                      "secret": "whsec_3Fq9LmZ2xT8pW1rK7vB4nD6sH0jC5yA9",
                      "created": "2026-11-06T09:00:00.000Z",
                      "active": true,
                      "format": "app2email",
                      "last_delivery": {
                        "at": "2026-11-06T09:05:00.000Z",
                        "ok": true,
                        "result": "HTTP 200 in 142 ms"
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "webhooks:manage",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_not_confirmed",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "missing_api_key",
          "partner_closed",
          "partner_service_unavailable",
          "rate_limited",
          "route_not_found"
        ],
        "x-a2e-mcp-tool": null,
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      },
      "post": {
        "tags": [
          "Account management"
        ],
        "operationId": "createAccountWebhook",
        "summary": "Add an account webhook",
        "description": "Every event goes to every webhook (filter by type). Signed like a number's webhooks (X-App2email-Signature, X-Hub-Signature-256). At most 5. \"format\": \"meta\" is not available here.",
        "security": [
          {
            "AccountKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Added. Keep the secret.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "wh2ob",
                  "webhook": {
                    "id": "wh_a1b2c3d4e5f6g7h8",
                    "url": "https://hooks.example.com/app2email/account",
                    "events": [
                      "message.status",
                      "message.received",
                      "message.failed",
                      "number.updated",
                      "client.created",
                      "subscription.renewed",
                      "..."
                    ],
                    "secret": "whsec_3Fq9LmZ2xT8pW1rK7vB4nD6sH0jC5yA9",
                    "created": "2026-11-06T09:00:00.000Z",
                    "active": true,
                    "format": "app2email",
                    "last_delivery": {
                      "at": "2026-11-06T09:05:00.000Z",
                      "ok": true,
                      "result": "HTTP 200 in 142 ms"
                    }
                  },
                  "note": "Keep the secret: check each event's X-App2email-Signature (or X-Hub-Signature-256) header with it. To try the URL now: POST https://api.app2email.com/v1/account/webhooks/wh_a1b2c3d4e5f6g7h8/test"
                }
              }
            }
          },
          "200": {
            "description": "This URL had a webhook already: it is on again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "wh3pc",
                  "webhook": {
                    "id": "wh_a1b2c3d4e5f6g7h8",
                    "url": "https://hooks.example.com/app2email/account",
                    "events": [
                      "message.status",
                      "message.received",
                      "message.failed",
                      "number.updated",
                      "client.created",
                      "subscription.renewed",
                      "..."
                    ],
                    "secret": "whsec_3Fq9LmZ2xT8pW1rK7vB4nD6sH0jC5yA9",
                    "created": "2026-11-06T09:00:00.000Z",
                    "active": true,
                    "format": "app2email",
                    "last_delivery": {
                      "at": "2026-11-06T09:05:00.000Z",
                      "ok": true,
                      "result": "HTTP 200 in 142 ms"
                    }
                  },
                  "note": "This URL already had a webhook: it is on. The id and secret are unchanged."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "webhooks:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_not_confirmed",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_json",
          "invalid_webhook_format",
          "invalid_webhook_headers",
          "invalid_webhook_url",
          "missing_api_key",
          "missing_url",
          "partner_closed",
          "partner_service_unavailable",
          "rate_limited",
          "route_not_found",
          "too_many_webhooks",
          "unsupported_content_type"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookRequest"
              },
              "example": {
                "url": "https://hooks.example.com/app2email/account",
                "headers": {
                  "Authorization": "Basic dXNlcjpwYXNz"
                }
              }
            }
          }
        },
        "x-a2e-mcp-tool": null,
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      }
    },
    "/v1/account/webhooks/{id}": {
      "patch": {
        "tags": [
          "Account management"
        ],
        "operationId": "updateAccountWebhook",
        "summary": "Change an account webhook",
        "description": "url, active (true turns a switched-off webhook on), headers.",
        "security": [
          {
            "AccountKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The webhook's id.",
            "schema": {
              "type": "string",
              "example": "wh_a1b2c3d4e5f6g7h8"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Changed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "wh4qd",
                  "webhook": {
                    "id": "wh_a1b2c3d4e5f6g7h8",
                    "url": "https://hooks.example.com/app2email/account",
                    "events": [
                      "message.status",
                      "message.received",
                      "message.failed",
                      "number.updated",
                      "client.created",
                      "subscription.renewed",
                      "..."
                    ],
                    "secret": "whsec_3Fq9LmZ2xT8pW1rK7vB4nD6sH0jC5yA9",
                    "created": "2026-11-06T09:00:00.000Z",
                    "active": true,
                    "format": "app2email",
                    "last_delivery": {
                      "at": "2026-11-06T09:05:00.000Z",
                      "ok": true,
                      "result": "HTTP 200 in 142 ms"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "webhooks:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_not_confirmed",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_json",
          "invalid_webhook_format",
          "invalid_webhook_headers",
          "invalid_webhook_url",
          "missing_api_key",
          "nothing_to_change",
          "partner_closed",
          "partner_service_unavailable",
          "rate_limited",
          "route_not_found",
          "unsupported_content_type",
          "webhook_not_found",
          "webhook_url_in_use"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPatchRequest"
              },
              "example": {
                "active": true
              }
            }
          }
        },
        "x-a2e-mcp-tool": null,
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      },
      "delete": {
        "tags": [
          "Account management"
        ],
        "operationId": "deleteAccountWebhook",
        "summary": "Delete an account webhook",
        "description": "No more events go to it.",
        "security": [
          {
            "AccountKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The webhook's id.",
            "schema": {
              "type": "string",
              "example": "wh_a1b2c3d4e5f6g7h8"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeleteResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "wh5re",
                  "deleted": "wh_a1b2c3d4e5f6g7h8"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "webhooks:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_not_confirmed",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "missing_api_key",
          "partner_closed",
          "partner_service_unavailable",
          "rate_limited",
          "route_not_found",
          "webhook_not_found"
        ],
        "x-a2e-mcp-tool": null,
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      }
    },
    "/v1/account/webhooks/{id}/test": {
      "post": {
        "tags": [
          "Account management"
        ],
        "operationId": "testAccountWebhook",
        "summary": "Send a test event to an account webhook",
        "description": "No body: a ping. {\"type\": \"subscription.renewed\"}: that event's sample. {\"event\": {...}}: that event as given. 30 an hour.",
        "security": [
          {
            "AccountKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The webhook's id.",
            "schema": {
              "type": "string",
              "example": "wh_a1b2c3d4e5f6g7h8"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "How the URL answered.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookTestResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "wh6sf",
                  "delivered": true,
                  "http_status": 200,
                  "response_ms": 142,
                  "error": null,
                  "response_body": "{\"ok\":true}",
                  "sent_headers": {
                    "Content-Type": "application/json; charset=utf-8",
                    "X-App2email-Event": "message.status",
                    "X-App2email-Delivery": "evt_Pa3k9m2Lw8Rt5Yp1Zs01",
                    "X-App2email-Signature": "t=1762419600,v1=5f2c...",
                    "X-App2email-Test": "true"
                  },
                  "sent_event": {
                    "id": "evt_Pa3k9m2Lw8Rt5Yp1Zs01",
                    "type": "message.status",
                    "created": "2026-11-06T09:00:00.000Z",
                    "number": "4976659348270",
                    "data": {
                      "message_id": "wamid.HBgLNDk3NjY1OTM0ODI3MBUCABEYEjQ1",
                      "to": "61412345678",
                      "status": "delivered",
                      "timestamp": "2026-11-06T09:00:00.000Z"
                    },
                    "test": true
                  },
                  "sent_body": "{\"id\":\"evt_Pa3k9m2Lw8Rt5Yp1Zs01\",\"type\":\"message.status\",...}"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "The request or the media file is too large. Possible error.code values: request_too_large, media_too_large, approval_body_too_large, test_event_too_large, flow_json_too_large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "webhooks:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_not_confirmed",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_events",
          "invalid_json",
          "invalid_test_event",
          "missing_api_key",
          "partner_closed",
          "partner_service_unavailable",
          "rate_limited",
          "route_not_found",
          "test_event_too_large",
          "too_many_tests",
          "unsupported_content_type",
          "webhook_not_found"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookTestRequest"
              },
              "example": {
                "type": "message.status"
              }
            }
          }
        },
        "x-a2e-mcp-tool": null,
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      }
    },
    "/v1/account/webhooks/{id}/rotate-secret": {
      "post": {
        "tags": [
          "Account management"
        ],
        "operationId": "rotateAccountWebhookSecret",
        "summary": "New signing secret for an account webhook",
        "description": "keep_old_for_hours 1-24: the old secret signs too until then.",
        "security": [
          {
            "AccountKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The webhook's id.",
            "schema": {
              "type": "string",
              "example": "wh_a1b2c3d4e5f6g7h8"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The new secret.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "wh7tg",
                  "webhook": {
                    "id": "wh_a1b2c3d4e5f6g7h8",
                    "url": "https://hooks.example.com/app2email/account",
                    "events": [
                      "message.status",
                      "message.received",
                      "message.failed",
                      "number.updated",
                      "client.created",
                      "subscription.renewed",
                      "..."
                    ],
                    "secret": "whsec_9Zx8Wv7Ut6Sr5Qp4On3Ml2Kj1Ih0Gf9Ed",
                    "created": "2026-11-06T09:00:00.000Z",
                    "active": true,
                    "format": "app2email",
                    "last_delivery": {
                      "at": "2026-11-06T09:05:00.000Z",
                      "ok": true,
                      "result": "HTTP 200 in 142 ms"
                    },
                    "previous_secret_until": "2026-11-07T09:00:00.000Z"
                  },
                  "note": "Events are signed with the new secret from now on, and with the old one too until 2026-11-07T09:00:00.000Z."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "webhooks:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_not_confirmed",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_json",
          "invalid_keep_old_for_hours",
          "missing_api_key",
          "partner_closed",
          "partner_service_unavailable",
          "rate_limited",
          "route_not_found",
          "unsupported_content_type",
          "webhook_not_found"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookRotateRequest"
              },
              "example": {
                "keep_old_for_hours": 24
              }
            }
          }
        },
        "x-a2e-mcp-tool": null,
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      }
    },
    "/v1/account/webhooks/{id}/deliveries": {
      "get": {
        "tags": [
          "Account management"
        ],
        "operationId": "listAccountWebhookDeliveries",
        "summary": "Deliveries of an account webhook",
        "description": "The last 100 of 7 days, every attempt.",
        "security": [
          {
            "AccountKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The webhook's id.",
            "schema": {
              "type": "string",
              "example": "wh_a1b2c3d4e5f6g7h8"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1 to 100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "failed or delivered.",
            "schema": {
              "type": "string",
              "enum": [
                "failed",
                "delivered"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The deliveries.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveriesResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "wh8uh",
                  "deliveries": [
                    {
                      "event_id": "evt_Pa3k9m2Lw8Rt5Yp1Zs01",
                      "type": "message.status",
                      "created": "2026-11-06T09:00:00.000Z",
                      "delivered": false,
                      "next_attempt_at": "2026-11-06T09:01:10.000Z",
                      "attempts": [
                        {
                          "at": "2026-11-06T09:00:00.000Z",
                          "ok": false,
                          "http_status": 503,
                          "ms": 2001,
                          "error": "the URL answered HTTP 503"
                        }
                      ]
                    }
                  ],
                  "note": "The last 100 deliveries of the last 7 days."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "webhooks:manage",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_not_confirmed",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_status",
          "missing_api_key",
          "partner_closed",
          "partner_service_unavailable",
          "rate_limited",
          "route_not_found",
          "webhook_not_found"
        ],
        "x-a2e-mcp-tool": null,
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      }
    },
    "/v1/account/webhooks/{id}/deliveries/{event_id}": {
      "get": {
        "tags": [
          "Account management"
        ],
        "operationId": "getAccountWebhookDelivery",
        "summary": "One delivery of an account webhook",
        "description": "Every attempt and the event as sent.",
        "security": [
          {
            "AccountKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The webhook's id.",
            "schema": {
              "type": "string",
              "example": "wh_a1b2c3d4e5f6g7h8"
            }
          },
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "description": "The event's id (from the deliveries).",
            "schema": {
              "type": "string",
              "example": "evt_Pa3k9m2Lw8Rt5Yp1Zs01"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "wh9vi",
                  "delivery": {
                    "event_id": "evt_Pa3k9m2Lw8Rt5Yp1Zs01",
                    "type": "message.status",
                    "created": "2026-11-06T09:00:00.000Z",
                    "delivered": true,
                    "attempts": [
                      {
                        "at": "2026-11-06T09:00:00.000Z",
                        "ok": true,
                        "http_status": 200,
                        "ms": 142
                      }
                    ],
                    "event_body": {
                      "id": "evt_Pa3k9m2Lw8Rt5Yp1Zs01",
                      "type": "message.status",
                      "created": "2026-11-06T09:00:00.000Z",
                      "number": "4976659348270",
                      "data": {
                        "message_id": "wamid.HBgLNDk3NjY1OTM0ODI3MBUCABEYEjQ1",
                        "to": "61412345678",
                        "status": "delivered",
                        "timestamp": "2026-11-06T09:00:00.000Z"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "webhooks:manage",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_not_confirmed",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "delivery_not_found",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "missing_api_key",
          "partner_closed",
          "partner_service_unavailable",
          "rate_limited",
          "route_not_found",
          "webhook_not_found"
        ],
        "x-a2e-mcp-tool": null,
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      }
    },
    "/v1/account/webhooks/{id}/deliveries/{event_id}/redeliver": {
      "post": {
        "tags": [
          "Account management"
        ],
        "operationId": "redeliverAccountWebhookEvent",
        "summary": "Send a stored event again to an account webhook",
        "description": "Same event id and body.",
        "security": [
          {
            "AccountKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The webhook's id.",
            "schema": {
              "type": "string",
              "example": "wh_a1b2c3d4e5f6g7h8"
            }
          },
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "description": "The event's id (from the deliveries).",
            "schema": {
              "type": "string",
              "example": "evt_Pa3k9m2Lw8Rt5Yp1Zs01"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "How the URL answered.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookRedeliverResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "whawj",
                  "delivered": true,
                  "http_status": 200,
                  "response_ms": 180,
                  "error": null
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "webhooks:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "account_deactivated",
          "account_not_confirmed",
          "account_service_error",
          "account_service_unavailable",
          "api_key_expired",
          "api_key_revoked",
          "delivery_in_progress",
          "delivery_not_found",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_json",
          "missing_api_key",
          "partner_closed",
          "partner_service_unavailable",
          "rate_limited",
          "route_not_found",
          "unsupported_content_type",
          "webhook_not_found"
        ],
        "x-a2e-mcp-tool": null,
        "x-a2e-webhook-events": [],
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/payments": {
      "get": {
        "tags": [
          "Payments"
        ],
        "operationId": "listPayments",
        "summary": "The payments, newest first",
        "description": "Scope: `bookings:manage` (or `messages:read`). The payments of appointments, package purchases and payment requests. Filter by `booking` (id or reference), `contact`, `status` and `kind`. Page with `next_cursor`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "booking",
            "in": "query",
            "required": false,
            "description": "Only this appointment's payments (id or BK- reference).",
            "schema": {
              "type": "string",
              "example": "BK-7Q3M2A"
            }
          },
          {
            "name": "contact",
            "in": "query",
            "required": false,
            "description": "Only this customer's payments.",
            "schema": {
              "type": "string",
              "example": "61412345678"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only this status.",
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "paid",
                "partly_refunded",
                "refunded",
                "failed",
                "expired",
                "cancelled"
              ]
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "description": "Only this kind.",
            "schema": {
              "type": "string",
              "enum": [
                "booking",
                "request",
                "package"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many (1 to 200, default 50).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The next_cursor of the previous answer, unchanged. Leave out for the first page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The payments.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentsResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "p1ls2",
                  "payments": [
                    {
                      "id": 15,
                      "kind": "booking",
                      "status": "paid",
                      "provider": "stripe",
                      "amount": 40.0,
                      "amount_label": "$40.00",
                      "full_label": "$40.00",
                      "discount_label": "",
                      "coupon_code": "",
                      "currency": "USD",
                      "refunded": 0.0,
                      "refunded_label": "",
                      "description": "Haircut",
                      "contact": "61412345678",
                      "payer_name": "John Smith",
                      "appointment_id": 42,
                      "booking_reference": "BK-7Q3M2A",
                      "package_purchase_id": null,
                      "checkout_url": "",
                      "link_url": "",
                      "last_error": "",
                      "paid": "2026-11-11T01:15:00.000Z",
                      "refunded_at": null,
                      "created": "2026-11-11T01:10:00.000Z"
                    }
                  ],
                  "next_cursor": null,
                  "count": 1,
                  "currency": "USD"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage|messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "booking_not_enabled",
          "booking_not_found",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_limit",
          "invalid_number",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "list_payments",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/payments/{id}": {
      "get": {
        "tags": [
          "Payments"
        ],
        "operationId": "getPayment",
        "summary": "One payment",
        "description": "Scope: `bookings:manage` (or `messages:read`). No provider key or secret is ever in the answer.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The payment's id.",
            "schema": {
              "type": "string",
              "example": "15"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The payment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "p2gt3",
                  "payment": {
                    "id": 15,
                    "kind": "booking",
                    "status": "paid",
                    "provider": "stripe",
                    "amount": 40.0,
                    "amount_label": "$40.00",
                    "full_label": "$40.00",
                    "discount_label": "",
                    "coupon_code": "",
                    "currency": "USD",
                    "refunded": 0.0,
                    "refunded_label": "",
                    "description": "Haircut",
                    "contact": "61412345678",
                    "payer_name": "John Smith",
                    "appointment_id": 42,
                    "booking_reference": "BK-7Q3M2A",
                    "package_purchase_id": null,
                    "checkout_url": "",
                    "link_url": "",
                    "last_error": "",
                    "paid": "2026-11-11T01:15:00.000Z",
                    "refunded_at": null,
                    "created": "2026-11-11T01:10:00.000Z"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage|messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "booking_not_enabled",
          "booking_not_found",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_coupon",
          "invalid_number_in_url",
          "invalid_payment",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "package_not_found",
          "payment_not_found",
          "payment_provider_error",
          "payments_not_connected",
          "plan_not_allowed",
          "rate_limited",
          "refund_not_possible",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/payments/links": {
      "post": {
        "x-a2e-webhook-events": [
          "payment.paid"
        ],
        "tags": [
          "Payments"
        ],
        "operationId": "createPaymentLink",
        "summary": "Ask a customer to pay an amount",
        "description": "Scope: `bookings:manage`. Not with a sandbox key. Makes a one-off payment request and the page where the customer pays (the business's own Stripe or PayPal). With `send` true and the customer inside their 24 hour window they also get it on WhatsApp with a Pay button; otherwise send the `url` yourself. 409 `payments_not_connected` when no provider is connected. `payment.paid` is sent when it is paid. Send an `Idempotency-Key` header to retry safely: the same key and body within 24 hours gets the first answer again (an error does not use the key up).",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A unique value for this message or list (eg a UUID). The same request with the same key within 24 hours gets the first answer again, and nothing is sent twice. Ignored by dry runs.",
            "schema": {
              "type": "string",
              "maxLength": 255,
              "example": "order-1234-shipped"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentLinkRequest"
              },
              "example": {
                "contact": "61412345678",
                "amount": 40,
                "description": "Deposit for your colour",
                "booking_id": "BK-7Q3M2A",
                "send": true
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Made.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentLinkResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "p3lk4",
                  "payment": {
                    "id": 15,
                    "kind": "request",
                    "status": "pending",
                    "provider": "stripe",
                    "amount": 40.0,
                    "amount_label": "$40.00",
                    "full_label": "$40.00",
                    "discount_label": "",
                    "coupon_code": "",
                    "currency": "USD",
                    "refunded": 0.0,
                    "refunded_label": "",
                    "description": "Haircut",
                    "contact": "61412345678",
                    "payer_name": "John Smith",
                    "appointment_id": 42,
                    "booking_reference": "BK-7Q3M2A",
                    "package_purchase_id": null,
                    "checkout_url": "",
                    "link_url": "https://www.app2email.com/book/k3XbQ9rTzP2m",
                    "last_error": "",
                    "paid": null,
                    "refunded_at": null,
                    "created": "2026-11-11T01:10:00.000Z"
                  },
                  "url": "https://www.app2email.com/book/k3XbQ9rTzP2m",
                  "sent": true,
                  "note": "The customer was sent the pay link on WhatsApp."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "booking_not_enabled",
          "booking_not_found",
          "idempotency_key_reused",
          "idempotency_request_in_progress",
          "idempotency_request_interrupted",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_coupon",
          "invalid_idempotency_key",
          "invalid_json",
          "invalid_number",
          "invalid_number_in_url",
          "invalid_payment",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "package_not_found",
          "payment_not_found",
          "payment_provider_error",
          "payments_not_connected",
          "plan_not_allowed",
          "rate_limited",
          "refund_not_possible",
          "sandbox_key",
          "service_not_live"
        ],
        "x-a2e-mcp-tool": "request_payment",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/payments/{id}/refund": {
      "post": {
        "x-a2e-webhook-events": [
          "booking.refunded"
        ],
        "tags": [
          "Payments"
        ],
        "operationId": "refundPayment",
        "summary": "Refund a payment, in full or a part",
        "description": "Scope: `bookings:manage`. Not with a sandbox key. Sends real money back through the business's own provider; it cannot be undone. `amount` is a part in the payment's currency; left out, everything that is left. A full refund of an appointment's payment sets its `payment.status` to refunded. `booking.refunded` is sent. 409 `refund_not_possible`, 502 `payment_provider_error`. Send an `Idempotency-Key` header to retry safely: the same key and body within 24 hours gets the first answer again (an error does not use the key up).",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The payment's id.",
            "schema": {
              "type": "string",
              "example": "15"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A unique value for this message or list (eg a UUID). The same request with the same key within 24 hours gets the first answer again, and nothing is sent twice. Ignored by dry runs.",
            "schema": {
              "type": "string",
              "maxLength": 255,
              "example": "order-1234-shipped"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefundRequest"
              },
              "example": {
                "amount": 10
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Refunded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "p4rf5",
                  "payment": {
                    "id": 15,
                    "kind": "booking",
                    "status": "partly_refunded",
                    "provider": "stripe",
                    "amount": 40.0,
                    "amount_label": "$40.00",
                    "full_label": "$40.00",
                    "discount_label": "",
                    "coupon_code": "",
                    "currency": "USD",
                    "refunded": 10.0,
                    "refunded_label": "$10.00",
                    "description": "Haircut",
                    "contact": "61412345678",
                    "payer_name": "John Smith",
                    "appointment_id": 42,
                    "booking_reference": "BK-7Q3M2A",
                    "package_purchase_id": null,
                    "checkout_url": "",
                    "link_url": "",
                    "last_error": "",
                    "paid": "2026-11-11T01:15:00.000Z",
                    "refunded_at": null,
                    "created": "2026-11-11T01:10:00.000Z"
                  },
                  "note": "Refunded through the payment provider. booking.refunded is sent."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "booking_not_enabled",
          "booking_not_found",
          "idempotency_key_reused",
          "idempotency_request_in_progress",
          "idempotency_request_interrupted",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_coupon",
          "invalid_idempotency_key",
          "invalid_number_in_url",
          "invalid_payment",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "package_not_found",
          "payment_not_found",
          "payment_provider_error",
          "payments_not_connected",
          "plan_not_allowed",
          "rate_limited",
          "refund_not_possible",
          "sandbox_key",
          "service_not_live"
        ],
        "x-a2e-mcp-tool": "refund_payment",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/bookings/{id}/payment": {
      "post": {
        "x-a2e-webhook-events": [],
        "tags": [
          "Payments"
        ],
        "operationId": "setBookingPayment",
        "summary": "Record a payment taken outside app2email",
        "description": "Scope: `bookings:manage`. Not with a sandbox key. The business's own record: `paid` (cash, a terminal), `waived` (nothing to pay) or `due` (still expected). Nothing is charged or refunded; online payments are recorded by the provider. The booking's `payment` shows the result.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The booking's id, or its reference (BK-XXXXXX).",
            "schema": {
              "type": "string",
              "example": "BK-7Q3M2A"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BookingPaymentStatusRequest"
              },
              "example": {
                "status": "paid"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Recorded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "p5bs6",
                  "booking": {
                    "id": 42,
                    "reference": "BK-7Q3M2A",
                    "status": "confirmed",
                    "payment": {
                      "status": "paid",
                      "due": 0.0,
                      "paid": 0.0,
                      "currency": "USD"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "booking_not_enabled",
          "booking_not_found",
          "bsuid_not_supported",
          "call_permission_required",
          "display_name_not_approved",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_number_in_url",
          "invalid_payment",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_upload_error",
          "messaging_limit_restricted",
          "missing_api_key",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "refund_not_possible",
          "register_limit_reached",
          "required_parameter_missing",
          "sandbox_key",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_paused",
          "template_text_too_long",
          "too_many_messages_to_recipient",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/bookings/packages": {
      "get": {
        "tags": [
          "Payments"
        ],
        "operationId": "listPackages",
        "summary": "The prepaid packages on sale",
        "description": "Scope: `bookings:manage` (or `messages:read`). The enabled packages of the business (config.payments.packages) with their price and the services they cover. Customers buy them on the online booking page; POST /bookings/packages/grant gives one without a payment.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "The packages.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PackagesResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "p6pk7",
                  "packages": [
                    {
                      "id": "ten-pack",
                      "name": "10 sessions",
                      "description": "",
                      "sessions": 10,
                      "price_amount": 400.0,
                      "price_label": "$400.00",
                      "valid_days": 365,
                      "services": []
                    }
                  ],
                  "count": 1,
                  "currency": "USD"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage|messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "booking_not_enabled",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/bookings/packages/purchases": {
      "get": {
        "tags": [
          "Payments"
        ],
        "operationId": "listPackagePurchases",
        "summary": "The packages customers hold",
        "description": "Scope: `bookings:manage` (or `messages:read`). Purchases and grants, newest first. `status=live` = active with sessions left.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "contact",
            "in": "query",
            "required": false,
            "description": "Only this customer's.",
            "schema": {
              "type": "string",
              "example": "61412345678"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "live, or one status.",
            "schema": {
              "type": "string",
              "enum": [
                "live",
                "pending",
                "active",
                "used_up",
                "expired",
                "refunded",
                "cancelled"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many (1 to 200, default 50).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The purchases.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PackagePurchasesResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "p7pp8",
                  "purchases": [
                    {
                      "id": 5,
                      "contact": "61412345678",
                      "contact_name": "John Smith",
                      "package_id": "ten-pack",
                      "package_name": "10 sessions",
                      "services": [],
                      "sessions_total": 10,
                      "sessions_used": 2,
                      "sessions_left": 8,
                      "expires": "2027-11-11T01:15:00.000Z",
                      "status": "active",
                      "payment_id": 17,
                      "created": "2026-11-11T01:15:00.000Z"
                    }
                  ],
                  "count": 1
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage|messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "booking_not_enabled",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_limit",
          "invalid_number",
          "invalid_number_in_url",
          "invalid_status",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/bookings/packages/grant": {
      "post": {
        "x-a2e-webhook-events": [
          "package.purchased"
        ],
        "tags": [
          "Payments"
        ],
        "operationId": "grantPackage",
        "summary": "Give a customer a package without a payment",
        "description": "Scope: `bookings:manage`. Not with a sandbox key. Makes an active purchase of a package on sale (`sessions` overrides its session count). `package.purchased` is sent with `granted: true`. Send an `Idempotency-Key` header to retry safely: the same key and body within 24 hours gets the first answer again (an error does not use the key up).",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A unique value for this message or list (eg a UUID). The same request with the same key within 24 hours gets the first answer again, and nothing is sent twice. Ignored by dry runs.",
            "schema": {
              "type": "string",
              "maxLength": 255,
              "example": "order-1234-shipped"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PackageGrantRequest"
              },
              "example": {
                "contact": "61412345678",
                "package_id": "ten-pack",
                "name": "John"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Granted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PackageGrantResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "p8pg9",
                  "purchase": {
                    "id": 5,
                    "contact": "61412345678",
                    "contact_name": "John Smith",
                    "package_id": "ten-pack",
                    "package_name": "10 sessions",
                    "services": [],
                    "sessions_total": 10,
                    "sessions_used": 2,
                    "sessions_left": 8,
                    "expires": "2027-11-11T01:15:00.000Z",
                    "status": "active",
                    "payment_id": 17,
                    "created": "2026-11-11T01:15:00.000Z"
                  },
                  "note": "Granted. package.purchased is sent."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "booking_not_enabled",
          "booking_not_found",
          "idempotency_key_reused",
          "idempotency_request_in_progress",
          "idempotency_request_interrupted",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_coupon",
          "invalid_idempotency_key",
          "invalid_json",
          "invalid_number",
          "invalid_number_in_url",
          "invalid_payment",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "package_not_found",
          "payment_not_found",
          "payment_provider_error",
          "payments_not_connected",
          "plan_not_allowed",
          "rate_limited",
          "refund_not_possible",
          "sandbox_key",
          "service_not_live"
        ],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/bookings/customers": {
      "get": {
        "tags": [
          "Payments"
        ],
        "operationId": "listBookingCustomers",
        "summary": "The customers with appointments",
        "description": "Scope: `bookings:manage` (or `messages:read`). The people who have appointments, newest activity first, with visits, no-shows, upcoming count, packages left and the total paid. `q` searches name, e-mail and number; `tag` filters by a contact tag. Page with `next_cursor`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Name, e-mail or number contains this.",
            "schema": {
              "type": "string",
              "example": "smith"
            }
          },
          {
            "name": "tag",
            "in": "query",
            "required": false,
            "description": "Only contacts with this tag.",
            "schema": {
              "type": "string",
              "example": "vip"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "recent (default), name or visits.",
            "schema": {
              "type": "string",
              "enum": [
                "recent",
                "name",
                "visits"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many (1 to 200, default 50).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The next_cursor of the previous answer, unchanged. Leave out for the first page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The customers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomersResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "c1cl0",
                  "customers": [
                    {
                      "contact": "61412345678",
                      "name": "John Smith",
                      "email": "john@example.com",
                      "tags": [
                        "vip"
                      ],
                      "visits": 6,
                      "no_shows": 0,
                      "upcoming": 1,
                      "last_visit": "2026-10-20T23:00:00.000Z",
                      "next_start": "2026-11-12T23:00:00.000Z",
                      "packages_left": 8,
                      "total_paid_label": "$240.00"
                    }
                  ],
                  "next_cursor": null,
                  "count": 1
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage|messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "booking_not_enabled",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_limit",
          "invalid_number_in_url",
          "invalid_range",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/bookings/customers/{contact}": {
      "get": {
        "tags": [
          "Payments"
        ],
        "operationId": "getCustomerProfile",
        "summary": "A customer's whole profile",
        "description": "Scope: `bookings:manage` (or `messages:read`). Contact details and tags, upcoming and past appointments, internal notes and reminders, packages, payments, stats and the last 20 messages: one call for an agent that is about to talk to the customer.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "contact",
            "in": "path",
            "required": true,
            "description": "The customer: number with country code, or business-scoped user id.",
            "schema": {
              "type": "string",
              "example": "61412345678"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The profile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerProfile"
                },
                "example": {
                  "success": true,
                  "request_id": "c2cg1",
                  "customer": {
                    "contact": "61412345678",
                    "name": "John Smith",
                    "email": "john@example.com",
                    "tags": [
                      "vip"
                    ]
                  },
                  "stats": {
                    "visits": 6,
                    "no_shows": 0,
                    "cancellations": 1,
                    "total_paid_label": "$240.00"
                  },
                  "upcoming": [],
                  "past": [],
                  "notes": [
                    {
                      "id": 7,
                      "contact": "61412345678",
                      "appointment_id": 42,
                      "booking_reference": "BK-7Q3M2A",
                      "body": "Prefers the window seat.",
                      "author": "API key Planner",
                      "author_kind": "api",
                      "pinned": false,
                      "remind_at": null,
                      "created": "2026-11-11T01:12:09.000Z",
                      "updated": "2026-11-11T01:12:09.000Z"
                    }
                  ],
                  "reminders": [],
                  "packages": [
                    {
                      "id": 5,
                      "contact": "61412345678",
                      "contact_name": "John Smith",
                      "package_id": "ten-pack",
                      "package_name": "10 sessions",
                      "services": [],
                      "sessions_total": 10,
                      "sessions_used": 2,
                      "sessions_left": 8,
                      "expires": "2027-11-11T01:15:00.000Z",
                      "status": "active",
                      "payment_id": 17,
                      "created": "2026-11-11T01:15:00.000Z"
                    }
                  ],
                  "payments": [
                    {
                      "id": 15,
                      "kind": "booking",
                      "status": "paid",
                      "provider": "stripe",
                      "amount": 40.0,
                      "amount_label": "$40.00",
                      "full_label": "$40.00",
                      "discount_label": "",
                      "coupon_code": "",
                      "currency": "USD",
                      "refunded": 0.0,
                      "refunded_label": "",
                      "description": "Haircut",
                      "contact": "61412345678",
                      "payer_name": "John Smith",
                      "appointment_id": 42,
                      "booking_reference": "BK-7Q3M2A",
                      "package_purchase_id": null,
                      "checkout_url": "",
                      "link_url": "",
                      "last_error": "",
                      "paid": "2026-11-11T01:15:00.000Z",
                      "refunded_at": null,
                      "created": "2026-11-11T01:10:00.000Z"
                    }
                  ],
                  "messages": [
                    {
                      "direction": "in",
                      "text": "Can I move Friday?",
                      "time": "2026-11-10T22:00:00.000Z"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage|messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "booking_not_enabled",
          "contact_not_found",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "get_customer_profile",
        "x-a2e-needs": null
      },
      "patch": {
        "x-a2e-webhook-events": [],
        "tags": [
          "Payments"
        ],
        "operationId": "updateCustomer",
        "summary": "Change a customer's name, e-mail, tags or fields",
        "description": "Scope: `bookings:manage`. Not with a sandbox key. Updates the contact record (made when there is none). The e-mail also goes onto the customer's upcoming confirmed appointments so their e-mails reach the new address.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "contact",
            "in": "path",
            "required": true,
            "description": "The customer: number with country code, or business-scoped user id.",
            "schema": {
              "type": "string",
              "example": "61412345678"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerPatchRequest"
              },
              "example": {
                "email": "john.new@example.com",
                "tags": [
                  "vip",
                  "colour"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Changed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "c3cu2",
                  "customer": {
                    "contact": "61412345678",
                    "name": "John Smith",
                    "email": "john.new@example.com",
                    "tags": [
                      "vip",
                      "colour"
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "booking_not_enabled",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_contacts",
          "invalid_json",
          "invalid_number",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "nothing_to_change",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "sandbox_key",
          "service_not_live"
        ],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      },
      "delete": {
        "x-a2e-webhook-events": [
          "booking.customer.erased"
        ],
        "tags": [
          "Payments"
        ],
        "operationId": "eraseCustomerBookingData",
        "summary": "Erase a customer's booking data",
        "description": "Scope: `bookings:manage`. Not with a sandbox key. For a privacy request. Future confirmed appointments are cancelled without a message (reason \"data erased\"); every appointment of the customer loses their number, name, e-mail, notes and answers (the row stays, anonymised, so reports still count it); their notes, links, holds and poll votes are deleted; package purchases and payments keep amounts and dates but lose the customer. The contact record and the conversation are kept: `DELETE /contacts/{identity}?booking_data=erase` removes the contact too. `booking.customer.erased` is sent. It cannot be undone.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "contact",
            "in": "path",
            "required": true,
            "description": "The customer: number with country code, or business-scoped user id.",
            "schema": {
              "type": "string",
              "example": "61412345678"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erased.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerEraseResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "c4ce3",
                  "erased": true,
                  "counts": {
                    "appointments": 4,
                    "cancelled": 1,
                    "notes": 2,
                    "links": 1,
                    "holds": 0,
                    "votes": 0,
                    "packages": 0,
                    "payments": 1
                  },
                  "note": "The customer's appointments, notes, links, holds and poll votes were erased or anonymised."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "approval_body_too_large",
          "background_start_failed",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "booking_not_enabled",
          "broadcast_cancelled",
          "bsuid_not_supported",
          "call_permission_required",
          "caption_not_supported",
          "caption_too_long",
          "daily_cap_reached",
          "display_name_not_approved",
          "duplicate_recipients",
          "free_form_single_recipient",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_base64",
          "invalid_callback_data",
          "invalid_components",
          "invalid_contacts_message",
          "invalid_cursor",
          "invalid_identity_key_hash",
          "invalid_interactive",
          "invalid_location",
          "invalid_marketing_api",
          "invalid_media_link",
          "invalid_number",
          "invalid_number_in_url",
          "invalid_reaction",
          "invalid_recipients",
          "invalid_reply_to",
          "invalid_send_at",
          "invalid_to",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_download_failed",
          "media_too_large",
          "media_type_not_allowed",
          "media_upload_error",
          "media_upload_failed",
          "message_too_old",
          "messaging_limit_restricted",
          "missing_api_key",
          "missing_interactive",
          "missing_media",
          "missing_message_id",
          "missing_template_language",
          "missing_template_name",
          "missing_text",
          "monthly_cap_reached",
          "monthly_limit_reached",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "rate_limited",
          "reaction_too_old",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_not_opted_in",
          "recipient_opted_out",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "sandbox_key",
          "schedule_failed",
          "segment_and_recipients",
          "segment_empty",
          "segment_not_found",
          "send_at_in_past",
          "send_at_too_far",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_language_not_found",
          "template_lookup_failed",
          "template_not_approved",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_parameters_invalid",
          "template_paused",
          "template_sample_media_failed",
          "template_text_too_long",
          "text_too_long",
          "to_and_recipients",
          "too_many_messages_to_recipient",
          "too_many_recipients",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "voice_needs_ogg_opus",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-mcp-tool": "erase_customer_data",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/bookings/polls": {
      "get": {
        "tags": [
          "Payments"
        ],
        "operationId": "listPolls",
        "summary": "The meeting polls",
        "description": "Scope: `bookings:manage` (or `messages:read`). Newest first, with options, votes and status.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only this status.",
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "closed",
                "booked"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many (1 to 100, default 50).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The polls.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PollsResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "q1pl4",
                  "polls": [
                    {
                      "id": 12,
                      "title": "Team planning",
                      "description": "",
                      "service_id": "consultation",
                      "provider_id": "",
                      "duration_min": 60,
                      "options": [
                        {
                          "id": "a",
                          "start": "2026-11-11T23:00:00.000Z",
                          "end": "2026-11-12T00:00:00.000Z",
                          "start_local": "2026-11-12T10:00",
                          "end_local": "2026-11-12T11:00",
                          "votes": 2,
                          "voters": [
                            "Sam",
                            "Alex"
                          ]
                        },
                        {
                          "id": "b",
                          "start": "2026-11-12T03:00:00.000Z",
                          "end": "2026-11-12T04:00:00.000Z",
                          "start_local": "2026-11-12T14:00",
                          "end_local": "2026-11-12T15:00",
                          "votes": 1,
                          "voters": [
                            "Sam"
                          ]
                        }
                      ],
                      "votes": [
                        {
                          "name": "Sam",
                          "contact": "61412345678",
                          "email": null,
                          "choices": [
                            "a",
                            "b"
                          ],
                          "comment": "",
                          "created": "2026-11-11T02:00:00.000Z"
                        }
                      ],
                      "contact": "",
                      "contact_name": "",
                      "status": "open",
                      "chosen_option": "",
                      "appointment_id": null,
                      "url": "https://www.app2email.com/book/pQ4rT7uV9wXy",
                      "closes": "2026-11-12T00:00:00.000Z",
                      "created": "2026-11-11T01:00:00.000Z"
                    }
                  ],
                  "count": 1
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage|messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "booking_not_enabled",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_limit",
          "invalid_number_in_url",
          "invalid_status",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      },
      "post": {
        "tags": [
          "Payments"
        ],
        "operationId": "createPoll",
        "summary": "Offer several times and let people vote",
        "description": "Scope: `bookings:manage`. Not with a sandbox key. 2 to 10 possible start times (each free now; the business's rule: inside the opening hours), a title, a service or a length. The times are not held. Share the `url`: people open it and vote. Pick the winner with POST /bookings/polls/{id}/book. `poll.voted` is sent for each vote. Send an `Idempotency-Key` header to retry safely: the same key and body within 24 hours gets the first answer again (an error does not use the key up).",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A unique value for this message or list (eg a UUID). The same request with the same key within 24 hours gets the first answer again, and nothing is sent twice. Ignored by dry runs.",
            "schema": {
              "type": "string",
              "maxLength": 255,
              "example": "order-1234-shipped"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PollCreateRequest"
              },
              "example": {
                "title": "Team planning",
                "service_id": "consultation",
                "options": [
                  "2026-11-12T10:00",
                  "2026-11-12T14:00",
                  "2026-11-13T09:00"
                ],
                "closes_at": "2026-11-12T00:00:00Z"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Made.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PollResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "q2pc5",
                  "poll": {
                    "id": 12,
                    "title": "Team planning",
                    "description": "",
                    "service_id": "consultation",
                    "provider_id": "",
                    "duration_min": 60,
                    "options": [
                      {
                        "id": "a",
                        "start": "2026-11-11T23:00:00.000Z",
                        "end": "2026-11-12T00:00:00.000Z",
                        "start_local": "2026-11-12T10:00",
                        "end_local": "2026-11-12T11:00",
                        "votes": 2,
                        "voters": [
                          "Sam",
                          "Alex"
                        ]
                      },
                      {
                        "id": "b",
                        "start": "2026-11-12T03:00:00.000Z",
                        "end": "2026-11-12T04:00:00.000Z",
                        "start_local": "2026-11-12T14:00",
                        "end_local": "2026-11-12T15:00",
                        "votes": 1,
                        "voters": [
                          "Sam"
                        ]
                      }
                    ],
                    "votes": [
                      {
                        "name": "Sam",
                        "contact": "61412345678",
                        "email": null,
                        "choices": [
                          "a",
                          "b"
                        ],
                        "comment": "",
                        "created": "2026-11-11T02:00:00.000Z"
                      }
                    ],
                    "contact": "",
                    "contact_name": "",
                    "status": "open",
                    "chosen_option": "",
                    "appointment_id": null,
                    "url": "https://www.app2email.com/book/pQ4rT7uV9wXy",
                    "closes": "2026-11-12T00:00:00.000Z",
                    "created": "2026-11-11T01:00:00.000Z"
                  },
                  "url": "https://www.app2email.com/book/pQ4rT7uV9wXy",
                  "note": "Share the url: people open it and vote. The times are not held."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "booking_not_enabled",
          "booking_slot_taken",
          "idempotency_key_reused",
          "idempotency_request_in_progress",
          "idempotency_request_interrupted",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_idempotency_key",
          "invalid_json",
          "invalid_number",
          "invalid_number_in_url",
          "invalid_poll",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "poll_not_found",
          "rate_limited",
          "sandbox_key",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "create_meeting_poll",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/bookings/polls/{id}": {
      "get": {
        "tags": [
          "Payments"
        ],
        "operationId": "getPoll",
        "summary": "One poll with its votes",
        "description": "Scope: `bookings:manage` (or `messages:read`). The options with their vote counts and voters, and every vote with the voter's name, number and comment.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The poll's id.",
            "schema": {
              "type": "string",
              "example": "12"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The poll.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PollResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "q3pg6",
                  "poll": {
                    "id": 12,
                    "title": "Team planning",
                    "description": "",
                    "service_id": "consultation",
                    "provider_id": "",
                    "duration_min": 60,
                    "options": [
                      {
                        "id": "a",
                        "start": "2026-11-11T23:00:00.000Z",
                        "end": "2026-11-12T00:00:00.000Z",
                        "start_local": "2026-11-12T10:00",
                        "end_local": "2026-11-12T11:00",
                        "votes": 2,
                        "voters": [
                          "Sam",
                          "Alex"
                        ]
                      },
                      {
                        "id": "b",
                        "start": "2026-11-12T03:00:00.000Z",
                        "end": "2026-11-12T04:00:00.000Z",
                        "start_local": "2026-11-12T14:00",
                        "end_local": "2026-11-12T15:00",
                        "votes": 1,
                        "voters": [
                          "Sam"
                        ]
                      }
                    ],
                    "votes": [
                      {
                        "name": "Sam",
                        "contact": "61412345678",
                        "email": null,
                        "choices": [
                          "a",
                          "b"
                        ],
                        "comment": "",
                        "created": "2026-11-11T02:00:00.000Z"
                      }
                    ],
                    "contact": "",
                    "contact_name": "",
                    "status": "open",
                    "chosen_option": "",
                    "appointment_id": null,
                    "url": "https://www.app2email.com/book/pQ4rT7uV9wXy",
                    "closes": "2026-11-12T00:00:00.000Z",
                    "created": "2026-11-11T01:00:00.000Z"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage|messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "booking_not_enabled",
          "booking_slot_taken",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "invalid_poll",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "poll_not_found",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/bookings/polls/{id}/close": {
      "post": {
        "tags": [
          "Payments"
        ],
        "operationId": "closePoll",
        "summary": "Close a poll to new votes",
        "description": "Scope: `bookings:manage`. Not with a sandbox key. No more votes. `poll.closed` is sent with status `closed`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The poll's id.",
            "schema": {
              "type": "string",
              "example": "12"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Closed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PollResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "q4pk7",
                  "poll": {
                    "id": 12,
                    "title": "Team planning",
                    "description": "",
                    "service_id": "consultation",
                    "provider_id": "",
                    "duration_min": 60,
                    "options": [
                      {
                        "id": "a",
                        "start": "2026-11-11T23:00:00.000Z",
                        "end": "2026-11-12T00:00:00.000Z",
                        "start_local": "2026-11-12T10:00",
                        "end_local": "2026-11-12T11:00",
                        "votes": 2,
                        "voters": [
                          "Sam",
                          "Alex"
                        ]
                      },
                      {
                        "id": "b",
                        "start": "2026-11-12T03:00:00.000Z",
                        "end": "2026-11-12T04:00:00.000Z",
                        "start_local": "2026-11-12T14:00",
                        "end_local": "2026-11-12T15:00",
                        "votes": 1,
                        "voters": [
                          "Sam"
                        ]
                      }
                    ],
                    "votes": [
                      {
                        "name": "Sam",
                        "contact": "61412345678",
                        "email": null,
                        "choices": [
                          "a",
                          "b"
                        ],
                        "comment": "",
                        "created": "2026-11-11T02:00:00.000Z"
                      }
                    ],
                    "contact": "",
                    "contact_name": "",
                    "status": "closed",
                    "chosen_option": "",
                    "appointment_id": null,
                    "url": "https://www.app2email.com/book/pQ4rT7uV9wXy",
                    "closes": "2026-11-12T00:00:00.000Z",
                    "created": "2026-11-11T01:00:00.000Z"
                  },
                  "note": "Closed: no more votes. poll.closed is sent."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "booking_not_enabled",
          "booking_slot_taken",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "invalid_poll",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "poll_not_found",
          "rate_limited",
          "sandbox_key",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [
          "poll.closed"
        ],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/bookings/polls/{id}/book": {
      "post": {
        "x-a2e-webhook-events": [
          "poll.closed"
        ],
        "tags": [
          "Payments"
        ],
        "operationId": "bookPoll",
        "summary": "Pick the winning time",
        "description": "Scope: `bookings:manage`. Not with a sandbox key. The option is checked like a business booking (409 `booking_slot_taken` when it is not free any more). With a main contact an appointment is made for them (source dashboard; the normal WhatsApp confirmation unless `notify` is false); without one the time is blocked in the calendar under the poll's title. The poll becomes `booked` and `poll.closed` is sent with the chosen option. Send an `Idempotency-Key` header to retry safely: the same key and body within 24 hours gets the first answer again (an error does not use the key up).",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The poll's id.",
            "schema": {
              "type": "string",
              "example": "12"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A unique value for this message or list (eg a UUID). The same request with the same key within 24 hours gets the first answer again, and nothing is sent twice. Ignored by dry runs.",
            "schema": {
              "type": "string",
              "maxLength": 255,
              "example": "order-1234-shipped"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PollBookRequest"
              },
              "example": {
                "option_id": "a",
                "notify": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Booked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PollBookResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "q5pb8",
                  "poll": {
                    "id": 12,
                    "title": "Team planning",
                    "description": "",
                    "service_id": "consultation",
                    "provider_id": "",
                    "duration_min": 60,
                    "options": [
                      {
                        "id": "a",
                        "start": "2026-11-11T23:00:00.000Z",
                        "end": "2026-11-12T00:00:00.000Z",
                        "start_local": "2026-11-12T10:00",
                        "end_local": "2026-11-12T11:00",
                        "votes": 2,
                        "voters": [
                          "Sam",
                          "Alex"
                        ]
                      },
                      {
                        "id": "b",
                        "start": "2026-11-12T03:00:00.000Z",
                        "end": "2026-11-12T04:00:00.000Z",
                        "start_local": "2026-11-12T14:00",
                        "end_local": "2026-11-12T15:00",
                        "votes": 1,
                        "voters": [
                          "Sam"
                        ]
                      }
                    ],
                    "votes": [
                      {
                        "name": "Sam",
                        "contact": "61412345678",
                        "email": null,
                        "choices": [
                          "a",
                          "b"
                        ],
                        "comment": "",
                        "created": "2026-11-11T02:00:00.000Z"
                      }
                    ],
                    "contact": "",
                    "contact_name": "",
                    "status": "booked",
                    "chosen_option": "a",
                    "appointment_id": null,
                    "url": "https://www.app2email.com/book/pQ4rT7uV9wXy",
                    "closes": "2026-11-12T00:00:00.000Z",
                    "created": "2026-11-11T01:00:00.000Z"
                  },
                  "booking": null,
                  "block": null,
                  "note": "The time is blocked in the calendar (the poll has no contact)."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not JSON. Possible error.code values: unsupported_content_type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "bookings:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "approval_body_too_large",
          "background_start_failed",
          "block_list_busy",
          "block_list_full",
          "block_users_error",
          "block_users_failed",
          "booking_not_enabled",
          "booking_slot_taken",
          "broadcast_cancelled",
          "bsuid_not_supported",
          "call_permission_required",
          "caption_not_supported",
          "caption_too_long",
          "daily_cap_reached",
          "display_name_not_approved",
          "duplicate_recipients",
          "free_form_single_recipient",
          "idempotency_key_reused",
          "idempotency_request_in_progress",
          "idempotency_request_interrupted",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_base64",
          "invalid_callback_data",
          "invalid_components",
          "invalid_contacts_message",
          "invalid_cursor",
          "invalid_idempotency_key",
          "invalid_identity_key_hash",
          "invalid_interactive",
          "invalid_json",
          "invalid_location",
          "invalid_marketing_api",
          "invalid_media_link",
          "invalid_number_in_url",
          "invalid_poll",
          "invalid_reaction",
          "invalid_recipients",
          "invalid_reply_to",
          "invalid_send_at",
          "invalid_to",
          "ip_not_allowed",
          "marketing_disabled_on_cloud_api",
          "marketing_per_user_limit",
          "media_download_error",
          "media_download_failed",
          "media_too_large",
          "media_type_not_allowed",
          "media_upload_error",
          "media_upload_failed",
          "message_too_old",
          "messaging_limit_restricted",
          "missing_api_key",
          "missing_interactive",
          "missing_media",
          "missing_message_id",
          "missing_template_language",
          "missing_template_name",
          "missing_text",
          "monthly_cap_reached",
          "monthly_limit_reached",
          "number_already_verified",
          "number_not_found",
          "outside_24h_window",
          "parameter_value_invalid",
          "plan_not_allowed",
          "poll_not_found",
          "rate_limited",
          "reaction_too_old",
          "recipient_identity_changed",
          "recipient_in_experiment",
          "recipient_is_sender",
          "recipient_not_allowed",
          "recipient_not_opted_in",
          "recipient_opted_out",
          "recipient_stopped_marketing",
          "recipient_unreachable",
          "register_limit_reached",
          "required_parameter_missing",
          "sandbox_key",
          "schedule_failed",
          "segment_and_recipients",
          "segment_empty",
          "segment_not_found",
          "send_at_in_past",
          "send_at_too_far",
          "service_not_live",
          "template_disabled",
          "template_format_policy",
          "template_language_not_found",
          "template_lookup_failed",
          "template_not_approved",
          "template_not_found",
          "template_not_marketing",
          "template_parameter_count_mismatch",
          "template_parameter_format_mismatch",
          "template_parameter_invalid",
          "template_parameters_invalid",
          "template_paused",
          "template_sample_media_failed",
          "template_text_too_long",
          "text_too_long",
          "to_and_recipients",
          "too_many_messages_to_recipient",
          "too_many_recipients",
          "unsupported_message_type",
          "username_account_not_linked",
          "username_change_limit",
          "username_not_available",
          "username_not_eligible",
          "username_taken",
          "voice_needs_ogg_opus",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_maintenance",
          "whatsapp_number_not_registered",
          "whatsapp_parameter_error",
          "whatsapp_payment_issue",
          "whatsapp_rate_limit",
          "whatsapp_unavailable"
        ],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/templates/delete": {
      "post": {
        "tags": [
          "Templates"
        ],
        "operationId": "deleteTemplates",
        "summary": "Delete several templates at once (all or nothing)",
        "description": "Needs 'templates:manage'. names (every language) or ids, at most 100 languages; one bad id deletes nothing. WABA-wide: every number on this WhatsApp Business Account uses the same templates.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplateBulkDeleteRequest"
              },
              "example": {
                "names": [
                  "summer_sale",
                  "old_promo"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateBulkDeleteResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "t3blk",
                  "deleted": [
                    {
                      "name": "summer_sale",
                      "language": "en",
                      "id": "1234567891"
                    },
                    {
                      "name": "old_promo",
                      "language": "en",
                      "id": "1234567892"
                    },
                    {
                      "name": "old_promo",
                      "language": "de",
                      "id": "1234567893"
                    }
                  ],
                  "note": "Deleted on the whole WhatsApp Business Account. An approved template's name and language can be used again after 30 days."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-webhook-events": [
          "template.status_changed"
        ],
        "x-a2e-scope": "templates:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_json",
          "invalid_number_in_url",
          "invalid_template_ids",
          "invalid_template_name",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "sandbox_key",
          "service_not_live",
          "template_delete_failed",
          "template_lookup_failed",
          "template_name_reserved",
          "template_not_found",
          "too_many_templates",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit"
        ],
        "x-a2e-mcp-tool": "delete_templates",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/templates/{name}/archive": {
      "post": {
        "tags": [
          "Templates"
        ],
        "operationId": "archiveTemplate",
        "summary": "Archive a template (deleted by WhatsApp after 28 days)",
        "description": "Needs 'templates:manage'. Every language, or ?language=. Only APPROVED or REJECTED templates; unarchive within 28 days to keep it. WABA-wide: every number on this WhatsApp Business Account uses the same templates.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "The template's name.",
            "schema": {
              "type": "string",
              "example": "order_update"
            }
          },
          {
            "name": "language",
            "in": "query",
            "required": false,
            "description": "Only this language. Default: every language.",
            "schema": {
              "type": "string",
              "example": "en"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Archived (failed lists the languages WhatsApp refused).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateArchiveResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "t4arc",
                  "name": "summer_sale",
                  "archived": [
                    {
                      "language": "en",
                      "id": "1234567891"
                    }
                  ],
                  "failed": [],
                  "note": "Archived on the whole WhatsApp Business Account. WhatsApp deletes archived templates 28 days after archiving; unarchive before then to keep them."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-webhook-events": [
          "template.status_changed"
        ],
        "x-a2e-scope": "templates:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "sandbox_key",
          "service_not_live",
          "template_archive_failed",
          "template_language_not_found",
          "template_language_required",
          "template_lookup_failed",
          "template_name_reserved",
          "template_not_found",
          "template_unarchive_failed",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit"
        ],
        "x-a2e-mcp-tool": "archive_template",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/templates/{name}/unarchive": {
      "post": {
        "tags": [
          "Templates"
        ],
        "operationId": "unarchiveTemplate",
        "summary": "Unarchive a template",
        "description": "Needs 'templates:manage'. Back to its previous status. Within 28 days of archiving. WABA-wide: every number on this WhatsApp Business Account uses the same templates.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "The template's name.",
            "schema": {
              "type": "string",
              "example": "order_update"
            }
          },
          {
            "name": "language",
            "in": "query",
            "required": false,
            "description": "Only this language. Default: every language.",
            "schema": {
              "type": "string",
              "example": "en"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Unarchived.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateArchiveResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "t4una",
                  "name": "summer_sale",
                  "unarchived": [
                    {
                      "language": "en",
                      "id": "1234567891"
                    }
                  ],
                  "failed": [],
                  "note": "Unarchived: back to their previous status (or APPROVED) on the whole WhatsApp Business Account."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-webhook-events": [
          "template.status_changed"
        ],
        "x-a2e-scope": "templates:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "sandbox_key",
          "service_not_live",
          "template_archive_failed",
          "template_language_not_found",
          "template_language_required",
          "template_lookup_failed",
          "template_name_reserved",
          "template_not_found",
          "template_unarchive_failed",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit"
        ],
        "x-a2e-mcp-tool": "unarchive_template",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/templates/{name}/compare": {
      "get": {
        "tags": [
          "Templates"
        ],
        "operationId": "compareTemplates",
        "summary": "Compare two templates: block rate, sends, top block reason",
        "description": "Both templates of this account, each sent at least 1,000 times in the period.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "The template's name.",
            "schema": {
              "type": "string",
              "example": "order_update"
            }
          },
          {
            "name": "with",
            "in": "query",
            "required": true,
            "description": "The other template's name.",
            "schema": {
              "type": "string",
              "example": "summer_sale_v2"
            }
          },
          {
            "name": "language",
            "in": "query",
            "required": false,
            "description": "The template's language (eg en, en_US). Needed when the template has several.",
            "schema": {
              "type": "string",
              "example": "en"
            }
          },
          {
            "name": "with_language",
            "in": "query",
            "required": false,
            "description": "The other template's language.",
            "schema": {
              "type": "string",
              "example": "en"
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "description": "How far back: 7, 30, 60 or 90 days.",
            "schema": {
              "type": "integer",
              "enum": [
                7,
                30,
                60,
                90
              ],
              "default": 30
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Meta's comparison.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateCompareResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "t5cmp",
                  "template": {
                    "name": "summer_sale",
                    "language": "en",
                    "id": "5289179717853347"
                  },
                  "with": {
                    "name": "summer_sale_v2",
                    "language": "en",
                    "id": "1533406637136032"
                  },
                  "days": 30,
                  "since": "2026-10-07T01:00:00.000Z",
                  "until": "2026-11-06T01:00:00.000Z",
                  "metrics": [
                    {
                      "metric": "BLOCK_RATE",
                      "type": "RELATIVE",
                      "order_by_relative_metric": [
                        "1533406637136032",
                        "5289179717853347"
                      ]
                    },
                    {
                      "metric": "MESSAGE_SENDS",
                      "type": "NUMBER_VALUES",
                      "number_values": [
                        {
                          "key": "5289179717853347",
                          "value": 1273
                        },
                        {
                          "key": "1533406637136032",
                          "value": 1042
                        }
                      ]
                    },
                    {
                      "metric": "TOP_BLOCK_REASON",
                      "type": "STRING_VALUES",
                      "string_values": [
                        {
                          "key": "5289179717853347",
                          "value": "UNKNOWN_BLOCK_REASON"
                        },
                        {
                          "key": "1533406637136032",
                          "value": "UNKNOWN_BLOCK_REASON"
                        }
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_compare_days",
          "invalid_cursor",
          "invalid_number_in_url",
          "invalid_template_name",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live",
          "template_compare_unavailable",
          "template_language_not_found",
          "template_language_required",
          "template_lookup_failed",
          "template_not_found",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "compare_templates",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/templates/{name}/authentication": {
      "put": {
        "tags": [
          "Templates"
        ],
        "operationId": "upsertAuthTemplate",
        "summary": "Create or update an authentication template in many languages",
        "description": "Needs 'templates:manage'. Missing languages are created, existing ones updated, in one call. Not for business-scoped user ids (131062). WABA-wide: every number on this WhatsApp Business Account uses the same templates.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "The authentication template's name.",
            "schema": {
              "type": "string",
              "example": "verify_code"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplateAuthUpsertRequest"
              },
              "example": {
                "languages": [
                  "en_US",
                  "es_ES"
                ],
                "otp_type": "COPY_CODE",
                "add_security_recommendation": true,
                "code_expiration_minutes": 10
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created or updated, per language.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateAuthUpsertResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "t8ups",
                  "name": "verify_code",
                  "category": "AUTHENTICATION",
                  "templates": [
                    {
                      "language": "en_US",
                      "id": "954638012257287",
                      "status": "APPROVED"
                    },
                    {
                      "language": "es_ES",
                      "id": "969725527415202",
                      "status": "APPROVED"
                    }
                  ],
                  "note": "Created or updated in every language listed, on the whole WhatsApp Business Account. Send it with the code as the body parameter and the copy-code button parameter."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-webhook-events": [
          "template.status_changed"
        ],
        "x-a2e-scope": "templates:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_auth_template",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_json",
          "invalid_number_in_url",
          "invalid_template_name",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "sandbox_key",
          "service_not_live",
          "template_already_exists",
          "template_limit_reached",
          "template_name_reserved",
          "template_not_editable",
          "template_rejected",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit"
        ],
        "x-a2e-mcp-tool": "upsert_auth_template",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/template-previews": {
      "get": {
        "tags": [
          "Templates"
        ],
        "operationId": "previewAuthTemplates",
        "summary": "Authentication template texts, per language",
        "description": "The fixed texts WhatsApp puts into an authentication template (body, security line, expiry footer, buttons).",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "languages",
            "in": "query",
            "required": false,
            "description": "Comma separated (eg en_US,es_ES). Default: every language.",
            "schema": {
              "type": "string",
              "example": "en_US,es_ES"
            }
          },
          {
            "name": "add_security_recommendation",
            "in": "query",
            "required": false,
            "description": "With the security line.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "code_expiration_minutes",
            "in": "query",
            "required": false,
            "description": "With the expiry footer (1 to 90).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 90
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The previews.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplatePreviewsResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "t9prv",
                  "category": "AUTHENTICATION",
                  "previews": [
                    {
                      "language": "en_US",
                      "body": "*{{1}}* is your verification code. For your security, do not share this code.",
                      "footer": "This code expires in 10 minutes.",
                      "buttons": [
                        {
                          "autofill_text": "Autofill",
                          "text": "Copy code"
                        }
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_number_in_url",
          "invalid_template_preview",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "preview_auth_templates",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/template-library": {
      "get": {
        "tags": [
          "Templates"
        ],
        "operationId": "listTemplateLibrary",
        "summary": "Meta's Template Library (pre-approved templates)",
        "description": "Utility and authentication templates written by Meta. Create one with POST /templates and library_template_name.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Words in the template.",
            "schema": {
              "type": "string",
              "example": "delivery"
            }
          },
          {
            "name": "topic",
            "in": "query",
            "required": false,
            "description": "eg ORDER_MANAGEMENT, PAYMENTS, ACCOUNT_UPDATE, CUSTOMER_FEEDBACK.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "usecase",
            "in": "query",
            "required": false,
            "description": "eg SHIPMENT_CONFIRMATION, PAYMENT_DUE_REMINDER.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "industry",
            "in": "query",
            "required": false,
            "description": "E_COMMERCE or FINANCIAL_SERVICES.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "language",
            "in": "query",
            "required": false,
            "description": "eg en_US.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "query",
            "required": false,
            "description": "A library template's name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1 to 200.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "next_cursor of the previous answer.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Library templates.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateLibraryResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "t6lib",
                  "templates": [
                    {
                      "name": "delivery_update_1",
                      "language": "en_US",
                      "category": "UTILITY",
                      "topic": "ORDER_MANAGEMENT",
                      "usecase": "DELIVERY_UPDATE",
                      "industry": [
                        "E_COMMERCE"
                      ],
                      "body": "Good news! Your order {{1}} is on its way. Track it here.",
                      "body_params": [
                        "#12345"
                      ],
                      "body_param_types": [
                        "TEXT"
                      ],
                      "buttons": [
                        {
                          "type": "URL",
                          "text": "Track order",
                          "url": "https://www.example.com/"
                        }
                      ],
                      "id": "7147013345418927"
                    }
                  ],
                  "next_cursor": null,
                  "note": "Create one with POST /v1/4976659348270/templates {\"name\", \"language\", \"category\", \"library_template_name\", \"library_template_button_inputs\"}."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_library_filter",
          "invalid_limit",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "list_template_library",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/template-insights": {
      "get": {
        "tags": [
          "Templates"
        ],
        "operationId": "getTemplateInsights",
        "summary": "Template insights: sent, delivered, read, clicked, cost",
        "description": "Per template and day (UTC), 90 days back, at most 10 template languages. Insights must be on (POST); not for EU or Japan accounts.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "templates",
            "in": "query",
            "required": true,
            "description": "Template names, comma separated.",
            "schema": {
              "type": "string",
              "example": "summer_sale"
            }
          },
          {
            "name": "language",
            "in": "query",
            "required": false,
            "description": "Only this language.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "First day, YYYY-MM-DD. Default: 6 days before until.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "description": "Last day, YYYY-MM-DD. Default: today.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "metrics",
            "in": "query",
            "required": false,
            "description": "Comma separated: sent, delivered, read, clicked, cost. Default: all.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "product",
            "in": "query",
            "required": false,
            "description": "cloud_api (default) or marketing_messages.",
            "schema": {
              "type": "string",
              "enum": [
                "cloud_api",
                "marketing_messages"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Daily numbers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateInsightsResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "t7get",
                  "since": "2026-10-31",
                  "until": "2026-11-06",
                  "product": "cloud_api",
                  "templates": [
                    {
                      "name": "summer_sale",
                      "language": "en",
                      "id": "1234567891"
                    }
                  ],
                  "data_points": [
                    {
                      "template": "summer_sale",
                      "language": "en",
                      "template_id": "1234567891",
                      "date": "2026-11-05",
                      "sent": 1200,
                      "delivered": 1150,
                      "read": 870,
                      "clicked": [
                        {
                          "type": "url_button",
                          "button_content": "Shop now",
                          "count": 96
                        }
                      ],
                      "cost": [
                        {
                          "type": "amount_spent",
                          "value": 30.12
                        },
                        {
                          "type": "cost_per_delivered",
                          "value": 0.03
                        }
                      ]
                    }
                  ],
                  "note": "Daily, UTC. Read and click counts stop changing 7 days after a message is sent. cost is left out for accounts billed through a partner's credit line."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-needs": "Meta: template insights switched on; not for EU or Japan WhatsApp accounts",
        "x-a2e-scope": "messages:read",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_insights_request",
          "invalid_number_in_url",
          "invalid_range",
          "invalid_template_language",
          "invalid_time",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "range_too_large",
          "rate_limited",
          "service_not_live",
          "template_insights_not_enabled",
          "template_insights_unavailable",
          "template_lookup_failed",
          "template_not_found",
          "too_many_templates",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "get_template_insights"
      },
      "post": {
        "tags": [
          "Templates"
        ],
        "operationId": "enableTemplateInsights",
        "summary": "Switch template insights on (cannot be undone)",
        "description": "Needs 'templates:manage' and {\"confirm\": true}. Adds link tracking and lets Meta collect anonymised chat data. WABA-wide: every number on this WhatsApp Business Account uses the same templates.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplateInsightsEnableRequest"
              },
              "example": {
                "confirm": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Switched on.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateInsightsEnableResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "t7ins",
                  "enabled": true,
                  "note": "Template insights are on for the whole WhatsApp Business Account, from now on (no data from before). This cannot be undone. Link tracking of a template's URL buttons can be turned off per template (cta_url_link_tracking_opted_out)."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published. Possible error.code values: idempotency_request_in_progress, idempotency_request_interrupted, template_already_exists, broadcast_not_cancellable, broadcast_cancelled, webhook_url_in_use, approval_already_resolved, approval_expired, segment_exists, number_already_verified, username_taken, number_not_live, key_limit_reached, key_limits_unavailable, plan_not_available, plan_already_active, booking_slot_taken, booking_cancelled, hold_expired, slug_taken, flow_not_editable, flow_not_published, flow_not_deletable, flow_name_taken, encryption_key_managed, username_not_available, client_exists, payments_not_connected, refund_not_possible, too_late, template_not_editable, template_category_locked, template_insights_not_enabled, delivery_in_progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window). Possible error.code values: template_not_approved, template_parameters_invalid, invalid_base64, invalid_media_link, media_download_failed, media_type_not_allowed, recipient_not_allowed, recipient_unreachable, template_parameter_count_mismatch, template_text_too_long, template_format_policy, template_parameter_format_mismatch, template_paused, template_disabled, template_parameter_invalid, required_parameter_missing, parameter_value_invalid, media_download_error, media_upload_error, idempotency_key_reused, invalid_webhook_url, outside_24h_window, text_too_long, caption_too_long, invalid_email, template_rejected, bsuid_not_supported, marketing_per_user_limit, recipient_in_experiment, template_not_marketing, recipient_is_sender, whatsapp_parameter_error, block_users_failed, block_list_full, username_change_limit, flow_cannot_publish, flow_rejected, reaction_too_old, message_too_old, voice_needs_ogg_opus, marketing_disabled_on_cloud_api, recipient_identity_changed, username_account_not_linked, template_limit_reached, template_insights_unavailable, template_archive_failed, template_unarchive_failed, template_compare_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "WhatsApp (Meta) returned an error or could not be reached. Possible error.code values: template_lookup_failed, media_upload_failed, template_sample_media_failed, template_delete_failed, whatsapp_error, block_users_error, account_service_error, payment_link_failed, email_not_sent, flow_json_download_failed, media_lookup_failed, media_delete_failed, marketing_status_lookup_failed, contact_book_error, profile_photo_failed, payment_provider_error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "app2email's connection to the WhatsApp account needs attention, or the request log is not available right now. Possible error.code values: whatsapp_connection_problem, whatsapp_number_not_registered, request_log_unavailable, whatsapp_unavailable, whatsapp_maintenance, block_list_busy, account_service_unavailable, partner_service_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-needs": "Meta: not for EU or Japan WhatsApp accounts",
        "x-a2e-scope": "templates:manage",
        "x-a2e-sandbox": "refused",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "sandbox_key",
          "service_not_live",
          "template_insights_confirm_required",
          "template_insights_not_enabled",
          "template_insights_unavailable",
          "whatsapp_account_locked",
          "whatsapp_account_restricted",
          "whatsapp_connection_problem",
          "whatsapp_error",
          "whatsapp_permission_missing",
          "whatsapp_rate_limit"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "enable_template_insights"
      }
    },
    "/v1/{number}/webhooks/test-url": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "testWebhookUrl",
        "summary": "Send a test event to any URL",
        "description": "One signed POST to any https URL, answered with the exact request sent and your URL's answer. No saved webhook needed. Shares the 30 tests an hour of the number (429 too_many_tests with Retry-After); 60 an hour per target host and per its IP address.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookTestUrlRequest"
              },
              "example": {
                "url": "https://hooks.example.com/app2email",
                "type": "ping"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The test was made: see result.ok and result.stage.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookTestUrlResponse"
                },
                "examples": {
                  "answered": {
                    "summary": "Your URL answered 200",
                    "value": {
                      "success": true,
                      "request_id": "t7kq2",
                      "sent": {
                        "method": "POST",
                        "url": "https://hooks.example.com/app2email",
                        "headers": {
                          "Content-Type": "application/json; charset=utf-8",
                          "User-Agent": "app2email-webhooks/1.0",
                          "X-App2email-Event": "ping",
                          "X-App2email-Delivery": "evt_Xq3k9m2Lw8Rt5Yp1Zs01",
                          "X-App2email-Signature": "t=1762390800,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd",
                          "X-Hub-Signature-256": "sha256=7d0e8a4a2a5c0b8b1a8f3f62c1d0e2b5c6f8a9e0d1c2b3a4f5e6d7c8b9a0f1e2",
                          "X-App2email-Test": "true"
                        },
                        "body": "{\"id\":\"evt_Xq3k9m2Lw8Rt5Yp1Zs01\",\"type\":\"ping\",\"created\":\"2026-11-06T01:00:00.000Z\",\"number\":\"4976659348270\",\"test\":true,\"data\":{\"webhook_id\":\"wh_test_url\",\"message\":\"Test event. If you can see this, your webhook works.\"}}",
                        "secret": "whsec_3Fq9LmZ2xT8pW1rK7vB4nD6sH0jC5yA9",
                        "secret_generated": true
                      },
                      "result": {
                        "ok": true,
                        "stage": "response",
                        "status": 200,
                        "ms": 184,
                        "headers": {
                          "Content-Type": "application/json",
                          "Date": "Fri, 06 Nov 2026 01:00:00 GMT",
                          "Server": "nginx"
                        },
                        "body": "{\"received\":true}",
                        "body_truncated": false
                      }
                    }
                  },
                  "dns": {
                    "summary": "The host name does not resolve",
                    "value": {
                      "success": true,
                      "request_id": "t7kq3",
                      "sent": {
                        "method": "POST",
                        "url": "https://hooks.example.invalid/app2email",
                        "headers": {
                          "Content-Type": "application/json; charset=utf-8",
                          "User-Agent": "app2email-webhooks/1.0",
                          "X-App2email-Event": "ping",
                          "X-App2email-Delivery": "evt_Xq3k9m2Lw8Rt5Yp1Zs01",
                          "X-App2email-Signature": "t=1762390800,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd",
                          "X-Hub-Signature-256": "sha256=7d0e8a4a2a5c0b8b1a8f3f62c1d0e2b5c6f8a9e0d1c2b3a4f5e6d7c8b9a0f1e2",
                          "X-App2email-Test": "true"
                        },
                        "body": "{\"id\":\"evt_Xq3k9m2Lw8Rt5Yp1Zs01\",\"type\":\"ping\",\"created\":\"2026-11-06T01:00:00.000Z\",\"number\":\"4976659348270\",\"test\":true,\"data\":{\"webhook_id\":\"wh_test_url\",\"message\":\"Test event. If you can see this, your webhook works.\"}}",
                        "secret": "whsec_3Fq9LmZ2xT8pW1rK7vB4nD6sH0jC5yA9",
                        "secret_generated": true
                      },
                      "result": {
                        "ok": false,
                        "stage": "dns",
                        "ms": 0,
                        "message": "the host name hooks.example.invalid does not resolve"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "The request or the media file is too large. Possible error.code values: request_too_large, media_too_large, approval_body_too_large, test_event_too_large, flow_json_too_large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "webhooks:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_events",
          "invalid_json",
          "invalid_number_in_url",
          "invalid_test_event",
          "invalid_webhook_format",
          "invalid_webhook_headers",
          "invalid_webhook_secret",
          "invalid_webhook_url",
          "ip_not_allowed",
          "missing_api_key",
          "missing_url",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live",
          "test_event_too_large",
          "too_many_tests"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "test_webhook_url",
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/webhooks/catchers": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "createWebhookCatcher",
        "summary": "Get a temporary URL that keeps what it receives",
        "description": "A URL for 1 hour that keeps up to 50 requests of up to 64 KB: use it as a webhook URL or in test-url, then read them. POST https://api.app2email.com/hooks/catch/{token} needs no key and answers 200 {\"ok\":true}; 404 unknown, 410 expired, 413 over 64 KB, 429 full. At most 3 per number at a time.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "201": {
            "description": "Made.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookCatcherCreated"
                },
                "example": {
                  "success": true,
                  "request_id": "c4tch",
                  "token": "Q7cT2mX9pLk3vB8nR1sWd4Fh6Jk0Zx2C",
                  "url": "https://api.app2email.com/hooks/catch/Q7cT2mX9pLk3vB8nR1sWd4Fh6Jk0Zx2C",
                  "created": "2026-11-06T01:00:00.000Z",
                  "expires": "2026-11-06T02:00:00.000Z",
                  "limits": {
                    "requests": 50,
                    "body_max_bytes": 65536,
                    "minutes": 60
                  },
                  "note": "Use the url as a webhook (POST .../webhooks {\"url\": ...}) or in test-url, then read what came: GET .../webhooks/catchers/Q7cT2mX9pLk3vB8nR1sWd4Fh6Jk0Zx2C?after=<last seq>."
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "webhooks:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live",
          "too_many_catchers"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "create_webhook_catcher",
        "x-a2e-needs": null
      },
      "get": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "listWebhookCatchers",
        "summary": "Your catchers",
        "description": "The number's catchers that have not expired.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          }
        ],
        "responses": {
          "200": {
            "description": "The catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookCatchersResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "c4tcl",
                  "catchers": [
                    {
                      "token": "Q7cT2mX9pLk3vB8nR1sWd4Fh6Jk0Zx2C",
                      "url": "https://api.app2email.com/hooks/catch/Q7cT2mX9pLk3vB8nR1sWd4Fh6Jk0Zx2C",
                      "created": "2026-11-06T01:00:00.000Z",
                      "expires": "2026-11-06T02:00:00.000Z",
                      "requests": 2,
                      "full": false
                    }
                  ],
                  "limits": {
                    "catchers": 3,
                    "requests": 50,
                    "body_max_bytes": 65536
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "webhooks:manage",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    },
    "/v1/{number}/webhooks/catchers/{token}": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "getWebhookCatcher",
        "summary": "What a catcher received",
        "description": "The requests, oldest first, with their headers and body. Poll with after = the last seq you have.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "token",
            "in": "path",
            "required": true,
            "description": "The catcher's token.",
            "schema": {
              "type": "string",
              "example": "Q7cT2mX9pLk3vB8nR1sWd4Fh6Jk0Zx2C"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Only the requests after this seq.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "example": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The catcher and its requests.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookCatcherResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "c4tcg",
                  "token": "Q7cT2mX9pLk3vB8nR1sWd4Fh6Jk0Zx2C",
                  "url": "https://api.app2email.com/hooks/catch/Q7cT2mX9pLk3vB8nR1sWd4Fh6Jk0Zx2C",
                  "created": "2026-11-06T01:00:00.000Z",
                  "expires": "2026-11-06T02:00:00.000Z",
                  "full": false,
                  "count": 1,
                  "requests": [
                    {
                      "seq": 1,
                      "received": "2026-11-06T01:00:03.120Z",
                      "method": "POST",
                      "headers": {
                        "Content-Type": "application/json; charset=utf-8",
                        "User-Agent": "app2email-webhooks/1.0",
                        "X-App2email-Event": "message.status",
                        "X-App2email-Delivery": "evt_Xq3k9m2Lw8Rt5Yp1Zs01",
                        "X-App2email-Signature": "t=1762390800,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd",
                        "X-Hub-Signature-256": "sha256=7d0e8a4a2a5c0b8b1a8f3f62c1d0e2b5c6f8a9e0d1c2b3a4f5e6d7c8b9a0f1e2"
                      },
                      "body": "{\"id\":\"evt_Xq3k9m2Lw8Rt5Yp1Zs01\",\"type\":\"message.status\",\"created\":\"2026-11-06T01:00:03.100Z\",\"number\":\"4976659348270\",\"data\":{\"message_id\":\"wamid.SANDBOX.k3XbQ9rTzP2mWv7a1c9eQ7cT\",\"to\":\"61412345678\",\"status\":\"delivered\",\"timestamp\":\"2026-11-06T01:00:03.000Z\",\"sent_by\":\"api\"}}",
                      "body_truncated": false
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "webhooks:manage",
        "x-a2e-sandbox": "read",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "catcher_not_found",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_cursor",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": "get_webhook_catcher",
        "x-a2e-needs": null
      },
      "delete": {
        "tags": [
          "Webhooks"
        ],
        "operationId": "deleteWebhookCatcher",
        "summary": "Delete a catcher",
        "description": "Deletes it and what it received. Its URL answers 404 from then on.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Number"
          },
          {
            "name": "token",
            "in": "path",
            "required": true,
            "description": "The catcher's token.",
            "schema": {
              "type": "string",
              "example": "Q7cT2mX9pLk3vB8nR1sWd4Fh6Jk0Zx2C"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookCatcherDeleteResponse"
                },
                "example": {
                  "success": true,
                  "request_id": "c4tcd",
                  "deleted": "Q7cT2mX9pLk3vB8nR1sWd4Fh6Jk0Zx2C"
                }
              }
            }
          },
          "400": {
            "description": "The request is malformed (missing or invalid fields, query parameters or times). Possible error.code values: invalid_number_in_url, invalid_json, unsupported_message_type, invalid_to, too_many_recipients, missing_template_name, missing_template_language, invalid_components, to_and_recipients, invalid_recipients, duplicate_recipients, invalid_idempotency_key, missing_message_id, invalid_number, missing_numbers, too_many_numbers, invalid_numbers, missing_url, invalid_events, too_many_webhooks, invalid_template_name, invalid_template_language, invalid_template_category, invalid_template_components, invalid_reply_to, free_form_single_recipient, missing_text, invalid_text, invalid_send_at, send_at_in_past, send_at_too_far, invalid_time, invalid_limit, invalid_cursor, invalid_direction, invalid_status, invalid_phone, invalid_range, range_too_large, invalid_months, invalid_media_type, missing_file, missing_media, nothing_to_change, invalid_setting, segment_and_recipients, segment_empty, invalid_owner, invalid_contacts, invalid_segment, invalid_csv, too_many_segments, missing_interactive, invalid_interactive, invalid_test_event, invalid_keep_old_for_hours, invalid_contact_email, invalid_plan, invalid_key_request, invalid_analytics_query, invalid_conversion_events, invalid_booking, invalid_service, invalid_start, invalid_block, invalid_note, invalid_link, invalid_slug, invalid_call_settings, invalid_call_request, invalid_flow_id, invalid_flow_name, invalid_flow_categories, invalid_flow_json, invalid_flow_field, invalid_public_key, invalid_media_id, invalid_location, invalid_contacts_message, invalid_reaction, invalid_callback_data, caption_not_supported, invalid_marketing_api, invalid_users, invalid_bsuid, invalid_identity_key_hash, invalid_profile, invalid_display_name, invalid_oba_request, invalid_compliance_info, invalid_username, invalid_conversation_starters, invalid_qr_code, invalid_catalog_id, invalid_client_request, invalid_onboarding_request, invalid_redirect_url, invalid_partner_settings, invalid_payment, invalid_coupon, invalid_poll, template_language_required, invalid_template_field, invalid_optimization_spec, invalid_template_ids, too_many_templates, invalid_compare_days, invalid_auth_template, invalid_template_preview, invalid_library_filter, template_insights_confirm_required, invalid_insights_request, invalid_webhook_headers, invalid_webhook_format, invalid_webhook_secret, too_many_catchers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key. Possible error.code values: missing_api_key, invalid_authorization_header, invalid_api_key, api_key_revoked, api_key_expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account. Possible error.code values: api_key_number_mismatch, insufficient_scope, ip_not_allowed, plan_not_allowed, service_not_live, recipient_opted_out, recipient_not_opted_in, template_name_reserved, whatsapp_payment_issue, whatsapp_account_locked, whatsapp_account_restricted, sandbox_key, recipient_stopped_marketing, messaging_limit_restricted, display_name_not_approved, username_not_eligible, account_not_confirmed, account_deactivated, booking_not_enabled, link_not_usable, call_permission_required, flow_blocked_by_integrity, whatsapp_permission_missing, partner_suspended, partner_closed, client_not_editable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found. Possible error.code values: number_not_found, template_not_found, template_language_not_found, message_not_found, broadcast_not_found, webhook_not_found, delivery_not_found, optin_not_found, request_not_found, conversation_not_found, contact_not_found, segment_not_found, approval_not_found, media_not_found, route_not_found, key_not_found, dataset_not_found, booking_not_found, block_not_found, note_not_found, link_not_found, hold_not_found, flow_not_found, flow_json_not_found, qr_code_not_found, client_not_found, payment_not_found, package_not_found, poll_not_found, catcher_not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait. Possible error.code values: monthly_limit_reached, too_many_messages_to_recipient, whatsapp_rate_limit, rate_limited, daily_cap_reached, monthly_cap_reached, too_many_tests, register_limit_reached, too_many_signups, media_lookups_paused, too_many_invites.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error on app2email's side. Possible error.code values: internal_error, background_start_failed, schedule_failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-a2e-scope": "webhooks:manage",
        "x-a2e-sandbox": "live",
        "x-a2e-error-codes": [
          "api_key_expired",
          "api_key_number_mismatch",
          "api_key_revoked",
          "catcher_not_found",
          "insufficient_scope",
          "internal_error",
          "invalid_api_key",
          "invalid_authorization_header",
          "invalid_number_in_url",
          "ip_not_allowed",
          "missing_api_key",
          "number_not_found",
          "plan_not_allowed",
          "rate_limited",
          "service_not_live"
        ],
        "x-a2e-webhook-events": [],
        "x-a2e-mcp-tool": null,
        "x-a2e-needs": null
      }
    }
  },
  "components": {
    "parameters": {
      "Number": {
        "name": "number",
        "in": "path",
        "required": true,
        "description": "Your app2email WhatsApp number - the number the message is sent FROM. Full number with country code, digits only.",
        "schema": {
          "type": "string",
          "pattern": "^[0-9]{8,15}$",
          "example": "4976659348270"
        }
      }
    },
    "securitySchemes": {
      "ApiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-KEY",
        "description": "Your API key from https://www.app2email.com/dashboard/apikey"
      },
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Alternative: 'Authorization: Bearer <your API key>'."
      },
      "AccountKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "An account key (a2e_acct_...) from https://www.app2email.com/dashboard/account-keys, or the management_key create_account returned."
      },
      "PartnerKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "A partner key (a2e_ptnr_...) from https://www.app2email.com/reseller/api-keys."
      }
    },
    "schemas": {
      "SendTemplateRequest": {
        "type": "object",
        "description": "A WhatsApp message in the format of WhatsApp Cloud API (Meta's exact body works unchanged): a template (type 'template', the default, any time), or within 24 hours of the contact's last message a free-form text, image, video, document, audio, sticker, location, contacts, reaction or interactive message. Meta's mark-read body {messaging_product, status: 'read', message_id, typing_indicator?} marks a message as read. Give 'to' or 'recipients' (templates only).",
        "properties": {
          "messaging_product": {
            "type": "string",
            "enum": [
              "whatsapp"
            ],
            "description": "Optional. Always 'whatsapp'."
          },
          "recipient_type": {
            "type": "string",
            "enum": [
              "individual"
            ],
            "description": "Optional. Always 'individual'."
          },
          "to": {
            "type": "string",
            "example": "61412345678",
            "description": "Recipient's WhatsApp number with country code. Digits only is best (spaces, '+', '-' are removed). Several recipients: separate the numbers with commas, eg \"61412345678,61498765432\" (semicolons and new lines work too), or send a JSON array of numbers. Each number gets its own message, and the response lists the result per number in 'results'. A free-form message (not 'template') goes to one number. A business-scoped user id (eg 61.AbC123, from from_user_id) is accepted as it is."
          },
          "recipient": {
            "type": "string",
            "example": "61.AbC123xyz",
            "description": "Optional, instead of 'to': one contact, a phone number or a business-scoped user id (BSUID). Sent to WhatsApp as 'recipient'."
          },
          "segment": {
            "type": "string",
            "example": "VIP, consented",
            "description": "Optional, app2email only, instead of 'to' / 'recipients': the id or name of a saved segment (GET /segments). Templates only. Each contact's named template parameters without a value are filled from its custom_fields ('name' from the contact's name). Recorded as a broadcast."
          },
          "type": {
            "type": "string",
            "enum": [
              "template",
              "text",
              "image",
              "video",
              "document",
              "interactive",
              "audio",
              "sticker",
              "location",
              "contacts",
              "reaction"
            ],
            "default": "template",
            "description": "'template' (default): an approved template. Otherwise a free-form message within the 24 hour window; the field of the same name holds it. Left out with status 'read': mark as read."
          },
          "interactive": {
            "$ref": "#/components/schemas/Interactive",
            "description": "type 'interactive': reply buttons, a list, or a URL button."
          },
          "template": {
            "$ref": "#/components/schemas/Template"
          },
          "text": {
            "$ref": "#/components/schemas/FreeFormText",
            "description": "type 'text': the message."
          },
          "image": {
            "$ref": "#/components/schemas/FreeFormMedia",
            "description": "type 'image': link, data+filename or id, and an optional caption."
          },
          "video": {
            "$ref": "#/components/schemas/FreeFormMedia",
            "description": "type 'video': link, data+filename or id, and an optional caption."
          },
          "document": {
            "$ref": "#/components/schemas/FreeFormMedia",
            "description": "type 'document': link, data+filename or id, and an optional caption."
          },
          "reply_to": {
            "type": "string",
            "example": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA=",
            "description": "Optional, free-form only: the message_id of one of the contact's messages, quoted by this one. Meta's 'context': {\"message_id\": ...} works too."
          },
          "send_at": {
            "type": "string",
            "format": "date-time",
            "example": "2026-11-02T09:00:00+11:00",
            "description": "Optional, templates only: send later. ISO 8601 with a time zone ('Z' or '+11:00'), 1 minute to 29 days ahead. The answer is HTTP 202 with status 'scheduled'."
          },
          "campaign_name": {
            "type": "string",
            "maxLength": 100,
            "example": "October newsletter",
            "description": "Optional, app2email only. Several numbers in 'to' (or 'recipients'): the name of the broadcast this list is recorded as (Activity Log under Broadcasts). Default \"API: <template name>\". Not used for one number."
          },
          "recipients": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Recipient"
            },
            "description": "Optional, app2email only, instead of 'to': each number with its own values. Each entry's components replace the shared template.components of the same type (a button: the same index). Every number is checked before anything is sent."
          },
          "dry_run": {
            "type": "boolean",
            "default": false,
            "description": "Optional, app2email only. true: check everything and answer with the exact WhatsApp message per number, without sending, logging or counting anything."
          },
          "background": {
            "type": "boolean",
            "default": false,
            "description": "Optional, app2email only. true: answer HTTP 202 once everything is checked and the media uploaded, then send. Progress: broadcast.status_url (GET /v1/{number}/broadcasts/{code}) or the broadcast.completed webhook event."
          },
          "audio": {
            "$ref": "#/components/schemas/AudioContent",
            "description": "type 'audio'."
          },
          "sticker": {
            "$ref": "#/components/schemas/StickerContent",
            "description": "type 'sticker'."
          },
          "location": {
            "$ref": "#/components/schemas/LocationContent",
            "description": "type 'location'."
          },
          "contacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactCard"
            },
            "description": "type 'contacts': 1 to 20 cards."
          },
          "reaction": {
            "$ref": "#/components/schemas/ReactionContent",
            "description": "type 'reaction'."
          },
          "context": {
            "type": "object",
            "properties": {
              "message_id": {
                "type": "string"
              }
            },
            "description": "Meta's form of reply_to."
          },
          "callback_data": {
            "type": "string",
            "maxLength": 512,
            "example": "order-1234",
            "description": "Optional. Sent to WhatsApp as biz_opaque_callback_data; back as data.callback_data in this message's message.status events. Meta's own field name works too."
          },
          "recipient_identity_key_hash": {
            "type": "string",
            "maxLength": 200,
            "example": "DF2lS5v2W6x=",
            "description": "Optional, one recipient (per number: in recipients[]): delivered only while the contact's identity key has this hash (message.received data.identity_key_hash); else message.failed, 137000 recipient_identity_changed. Needs PUT /settings/identity-check."
          },
          "marketing_api": {
            "type": "string",
            "enum": [
              "auto",
              "cloud_api",
              "mm_api"
            ],
            "description": "Optional, MARKETING templates: the path for this send (true = mm_api, false = cloud_api). Default: the number's setting messages.marketing_route (auto)."
          },
          "product_policy": {
            "type": "string",
            "enum": [
              "CLOUD_API_FALLBACK",
              "STRICT"
            ],
            "description": "Optional, Marketing Messages API only: STRICT = no fallback to the Cloud API. Default CLOUD_API_FALLBACK."
          },
          "message_activity_sharing": {
            "type": "boolean",
            "description": "Optional, Marketing Messages API only: share read and click activity with Meta for this message."
          },
          "status": {
            "type": "string",
            "enum": [
              "read"
            ],
            "description": "Meta's mark-read body: 'read' with message_id (no type)."
          },
          "message_id": {
            "type": "string",
            "description": "Meta's mark-read body: the received message."
          },
          "typing_indicator": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "text"
                ]
              }
            },
            "description": "Meta's mark-read body: also show the typing indicator."
          }
        }
      },
      "Recipient": {
        "type": "object",
        "required": [
          "to"
        ],
        "properties": {
          "to": {
            "type": "string",
            "example": "61412345678",
            "description": "One number, with country code."
          },
          "components": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Component"
            },
            "description": "Only what differs for this number, eg its body values. The rest comes from template.components."
          },
          "recipient_identity_key_hash": {
            "type": "string",
            "maxLength": 200,
            "description": "Optional: this contact's identity_key_hash (see the request's)."
          }
        }
      },
      "Template": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "example": "order_update",
            "description": "Exact name of an APPROVED template."
          },
          "language": {
            "$ref": "#/components/schemas/Language"
          },
          "components": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Component"
            },
            "description": "Values for the template's placeholders and media. Leave out for templates without parameters."
          }
        }
      },
      "Language": {
        "type": "object",
        "required": [
          "code"
        ],
        "description": "Required when the template exists in more than one language.",
        "properties": {
          "code": {
            "type": "string",
            "example": "en",
            "description": "Template language code, eg 'en', 'en_US', 'nl'."
          }
        }
      },
      "Component": {
        "type": "object",
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "header",
              "body",
              "button",
              "carousel",
              "limited_time_offer"
            ]
          },
          "sub_type": {
            "type": "string",
            "enum": [
              "url",
              "quick_reply",
              "copy_code",
              "flow",
              "catalog",
              "mpm",
              "spm",
              "order_details"
            ],
            "description": "Buttons only."
          },
          "index": {
            "type": "string",
            "example": "0",
            "description": "Buttons only: position of the button in the template, starting at 0."
          },
          "parameters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Parameter"
            }
          },
          "cards": {
            "type": "array",
            "description": "type 'carousel': one entry per card of the approved template, {card_index, components: [header, body, button...]}.",
            "items": {
              "type": "object",
              "properties": {
                "card_index": {
                  "type": "integer"
                },
                "components": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Component"
                  }
                }
              }
            }
          }
        }
      },
      "Parameter": {
        "type": "object",
        "required": [
          "type"
        ],
        "description": "One value. Set 'type' and the matching field, eg {\"type\":\"text\",\"text\":\"John\"} or {\"type\":\"image\",\"image\":{\"link\":\"https://...\"}}.",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "text",
              "image",
              "video",
              "document",
              "location",
              "currency",
              "date_time",
              "payload",
              "coupon_code",
              "action",
              "product",
              "limited_time_offer"
            ]
          },
          "parameter_name": {
            "type": "string",
            "description": "For templates with NAMED placeholders, eg 'first_name' for {{first_name}}."
          },
          "text": {
            "type": "string",
            "description": "type 'text'. No new lines, tabs or more than 4 spaces in a row."
          },
          "image": {
            "$ref": "#/components/schemas/Media"
          },
          "video": {
            "$ref": "#/components/schemas/Media"
          },
          "document": {
            "$ref": "#/components/schemas/Media"
          },
          "location": {
            "$ref": "#/components/schemas/Location"
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "date_time": {
            "$ref": "#/components/schemas/DateTime"
          },
          "payload": {
            "type": "string",
            "description": "type 'payload': quick reply button payload."
          },
          "coupon_code": {
            "type": "string",
            "description": "type 'coupon_code': copy code button value."
          },
          "action": {
            "type": "object",
            "additionalProperties": true,
            "description": "type 'action': flow / catalog button data, as WhatsApp Cloud API."
          },
          "product": {
            "type": "object",
            "properties": {
              "product_retailer_id": {
                "type": "string"
              },
              "catalog_id": {
                "type": "string"
              }
            },
            "description": "type 'product': a product header."
          },
          "limited_time_offer": {
            "type": "object",
            "properties": {
              "expiration_time_ms": {
                "type": "integer",
                "example": 1767225600000
              }
            },
            "description": "type 'limited_time_offer': when the offer ends (ms since 1970)."
          }
        }
      },
      "Media": {
        "type": "object",
        "description": "Give exactly one of: link, data or id. To send the template's own sample media instead, leave the header component out.",
        "properties": {
          "link": {
            "type": "string",
            "format": "uri",
            "example": "https://example.com/photo.jpg",
            "description": "Public http(s) URL. app2email downloads the file (no login, no private network addresses) and uploads it to WhatsApp."
          },
          "data": {
            "type": "string",
            "format": "byte",
            "description": "The file, base64 encoded. A 'data:<mime>;base64,' prefix is accepted."
          },
          "id": {
            "type": "string",
            "description": "A media id already uploaded to WhatsApp for this number."
          },
          "filename": {
            "type": "string",
            "example": "invoice.pdf",
            "description": "Shown to the recipient for documents. Also helps detect the file type."
          },
          "mime_type": {
            "type": "string",
            "example": "application/pdf",
            "description": "Optional. The type is detected from the file where possible."
          }
        }
      },
      "Location": {
        "type": "object",
        "required": [
          "latitude",
          "longitude"
        ],
        "properties": {
          "latitude": {
            "type": "string",
            "example": "-33.8688"
          },
          "longitude": {
            "type": "string",
            "example": "151.2093"
          },
          "name": {
            "type": "string"
          },
          "address": {
            "type": "string"
          }
        }
      },
      "Currency": {
        "type": "object",
        "properties": {
          "fallback_value": {
            "type": "string",
            "example": "$10.50"
          },
          "code": {
            "type": "string",
            "example": "USD"
          },
          "amount_1000": {
            "type": "integer",
            "example": 10500
          }
        }
      },
      "DateTime": {
        "type": "object",
        "properties": {
          "fallback_value": {
            "type": "string",
            "example": "February 25, 2026"
          }
        }
      },
      "SendMessageResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "request_id": {
            "type": "string",
            "example": "kxrkf"
          },
          "message_id": {
            "type": "string",
            "example": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA=",
            "description": "WhatsApp message id."
          },
          "status": {
            "type": "string",
            "enum": [
              "accepted",
              "partially_accepted",
              "failed",
              "queued",
              "scheduled",
              "dry_run",
              "pending_approval"
            ],
            "description": "accepted: accepted by WhatsApp (delivered/read status: GET /messages/{message_id} or the message.status webhook). partially_accepted / failed: a list where some / none were accepted. queued: background send started (HTTP 202). scheduled: 'send_at' given, sending later (HTTP 202; scheduled_for and the broadcast code). dry_run: a test, nothing sent. pending_approval: held by the key's approval gate (HTTP 202; 'approval' has the id and url)."
          },
          "sandbox": {
            "type": "boolean",
            "description": "true: a sandbox key simulated the send; nothing went to WhatsApp (message ids start with wamid.SANDBOX.)."
          },
          "approval": {
            "type": "object",
            "description": "status pending_approval only.",
            "properties": {
              "id": {
                "type": "string",
                "example": "apr_a1b2c3d4e5f6g7h8"
              },
              "url": {
                "type": "string",
                "description": "The dashboard page to approve or reject it."
              },
              "expires": {
                "type": "string",
                "format": "date-time"
              },
              "recipients": {
                "type": "integer"
              },
              "key": {
                "type": "string"
              }
            }
          },
          "summary": {
            "type": "object",
            "additionalProperties": true,
            "description": "status pending_approval only: what was held (recipients, template, text)."
          },
          "type": {
            "type": "string",
            "enum": [
              "template",
              "text",
              "image",
              "video",
              "document",
              "interactive",
              "audio",
              "sticker",
              "location",
              "contacts",
              "reaction"
            ],
            "description": "Free-form replies: the message type. Templates: 'template'."
          },
          "from": {
            "type": "string",
            "example": "4976659348270"
          },
          "to": {
            "type": "string",
            "example": "61412345678"
          },
          "window_closes_at": {
            "type": "string",
            "format": "date-time",
            "description": "Free-form replies: when the 24 hour window closes (after the contact's last message)."
          },
          "scheduled_for": {
            "type": "string",
            "format": "date-time",
            "description": "send_at only: when the send starts (UTC)."
          },
          "scheduled": {
            "type": "integer",
            "description": "send_at only: how many messages are scheduled."
          },
          "template": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "language": {
                "type": "string"
              },
              "category": {
                "type": "string"
              }
            }
          },
          "text": {
            "type": "string",
            "description": "The message text with your values filled in."
          },
          "media": {
            "type": "string",
            "description": "The header media sent, if any."
          },
          "conversation_url": {
            "type": "string",
            "description": "Conversation history page on app2email.com."
          },
          "note": {
            "type": "string"
          },
          "broadcast": {
            "type": "object",
            "description": "Several numbers in 'to' only: the broadcast this list is recorded as.",
            "properties": {
              "name": {
                "type": "string",
                "example": "October newsletter"
              },
              "code": {
                "type": "string"
              },
              "report_url": {
                "type": "string",
                "description": "The broadcast's report page on app2email.com, with delivered/read counts per number."
              },
              "status_url": {
                "type": "string",
                "description": "GET it (with your API key) for the broadcast's status and the result per number."
              }
            }
          },
          "recipients": {
            "type": "integer",
            "description": "Several numbers in 'to' only: how many different numbers were given."
          },
          "accepted": {
            "type": "integer",
            "description": "Several numbers only: how many messages WhatsApp accepted."
          },
          "failed": {
            "type": "integer",
            "description": "Several numbers only: how many were not sent (see results)."
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecipientResult"
            },
            "description": "Several numbers only: one entry per number, in the order given."
          },
          "error": {
            "$ref": "#/components/schemas/Error",
            "description": "Several numbers only, when none were sent: the first number's error."
          },
          "queued": {
            "type": "integer",
            "description": "Background send (HTTP 202): how many messages will be sent."
          },
          "skipped": {
            "type": "integer",
            "description": "Background send: how many numbers are skipped (listed in results, eg Do Not Call list)."
          },
          "dry_run": {
            "type": "boolean",
            "description": "Dry run only: true."
          },
          "would_send": {
            "type": "integer",
            "description": "Dry run only: how many messages would be sent."
          },
          "would_skip": {
            "type": "integer",
            "description": "Dry run only: how many numbers would be skipped (see results)."
          },
          "messages_left_this_month": {
            "type": "integer",
            "description": "Dry run only: messages left this billing month (the plan limit covers outgoing WhatsApp + outgoing emails)."
          },
          "broadcast_name": {
            "type": "string",
            "description": "Dry run of a list: the name the broadcast would get."
          },
          "whatsapp_status": {
            "type": "string",
            "enum": [
              "accepted",
              "held_for_quality_assessment",
              "paused"
            ],
            "description": "WhatsApp's own message_status for paced templates: held_for_quality_assessment = WhatsApp holds it while it checks the template's quality (it may be dropped later, 132015). Not app2email's approval gate."
          },
          "contacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SendContact"
            },
            "description": "WhatsApp's contacts[]: the wa_id and business-scoped user_id it resolved."
          },
          "sent_via": {
            "type": "string",
            "enum": [
              "cloud_api",
              "mm_api"
            ],
            "description": "MARKETING templates: the path used (cloud_api = /messages, mm_api = the Marketing Messages API). Dry run: the path it would take."
          },
          "whatsapp_edge": {
            "type": "string",
            "enum": [
              "messages",
              "marketing_messages"
            ],
            "description": "Dry run of a template: the WhatsApp endpoint the message would go to."
          }
        }
      },
      "RecipientResult": {
        "type": "object",
        "properties": {
          "to": {
            "type": "string",
            "example": "61412345678"
          },
          "success": {
            "type": "boolean"
          },
          "message_id": {
            "type": "string",
            "description": "WhatsApp message id, when accepted."
          },
          "status": {
            "type": "string",
            "enum": [
              "accepted"
            ]
          },
          "text": {
            "type": "string",
            "description": "This number's message text, when the numbers had different values ('recipients')."
          },
          "conversation_url": {
            "type": "string"
          },
          "error": {
            "$ref": "#/components/schemas/Error",
            "description": "Why this number was not sent, eg recipient_opted_out, monthly_limit_reached, recipient_unreachable."
          },
          "would_send": {
            "type": "boolean",
            "description": "Dry run only."
          },
          "whatsapp_message": {
            "type": "object",
            "additionalProperties": true,
            "description": "Dry run only: the exact message WhatsApp would get."
          },
          "whatsapp_status": {
            "type": "string"
          },
          "contacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SendContact"
            }
          },
          "sent_via": {
            "type": "string",
            "enum": [
              "cloud_api",
              "mm_api"
            ]
          }
        }
      },
      "MessageTimes": {
        "type": "object",
        "description": "When each step happened (ISO 8601, UTC). Steps not reached are left out.",
        "properties": {
          "submitted": {
            "type": "string",
            "format": "date-time"
          },
          "accepted": {
            "type": "string",
            "format": "date-time"
          },
          "sent": {
            "type": "string",
            "format": "date-time"
          },
          "delivered": {
            "type": "string",
            "format": "date-time"
          },
          "read": {
            "type": "string",
            "format": "date-time"
          },
          "failed": {
            "type": "string",
            "format": "date-time"
          },
          "deleted": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "MessageInfo": {
        "type": "object",
        "properties": {
          "message_id": {
            "type": "string",
            "example": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA="
          },
          "to": {
            "type": "string",
            "example": "61412345678"
          },
          "status": {
            "type": "string",
            "enum": [
              "accepted",
              "sent",
              "delivered",
              "read",
              "failed",
              "deleted",
              "queued",
              "unknown"
            ]
          },
          "error": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              }
            },
            "description": "Why it failed."
          },
          "sent_by": {
            "type": "string",
            "enum": [
              "api",
              "broadcast",
              "email_reply",
              "app2email"
            ]
          },
          "broadcast_code": {
            "type": "string",
            "description": "When the message was part of a broadcast."
          },
          "text": {
            "type": "string"
          },
          "media": {
            "type": "string"
          },
          "times": {
            "$ref": "#/components/schemas/MessageTimes"
          },
          "reply": {
            "type": "object",
            "description": "The contact's reply to this message.",
            "properties": {
              "at": {
                "type": "string",
                "format": "date-time"
              },
              "button": {
                "type": "string"
              },
              "text": {
                "type": "string"
              }
            }
          },
          "conversation_url": {
            "type": "string"
          }
        }
      },
      "MessageStatusResponse": {
        "allOf": [
          {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean",
                "example": true
              },
              "request_id": {
                "type": "string"
              }
            }
          },
          {
            "$ref": "#/components/schemas/MessageInfo"
          }
        ]
      },
      "BroadcastSummary": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "example": "k3XbQ9rTzP2mWv7a1c9e"
          },
          "name": {
            "type": "string"
          },
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "enum": [
              "scheduled",
              "inprogress",
              "completed",
              "cancelled",
              "missed",
              "interrupted",
              "pending",
              "unknown"
            ],
            "description": "scheduled: waiting for send_at. missed: the scheduled time passed while the service was down (not sent). interrupted: cut off by a restart."
          },
          "scheduled_for": {
            "type": "string",
            "format": "date-time",
            "description": "Only when status is scheduled."
          },
          "sent_by": {
            "type": "string",
            "enum": [
              "api",
              "dashboard"
            ]
          },
          "template": {
            "type": "string"
          },
          "numbers": {
            "type": "integer"
          },
          "status_url": {
            "type": "string"
          },
          "report_url": {
            "type": "string"
          }
        }
      },
      "BroadcastsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "broadcasts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BroadcastSummary"
            }
          }
        }
      },
      "BroadcastStatusResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "broadcast": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "created": {
                "type": "string",
                "format": "date-time"
              },
              "status": {
                "type": "string",
                "enum": [
                  "scheduled",
                  "inprogress",
                  "completed",
                  "cancelled",
                  "missed",
                  "interrupted",
                  "pending",
                  "unknown"
                ]
              },
              "status_notes": {
                "type": "string"
              },
              "scheduled_for": {
                "type": "string",
                "format": "date-time"
              },
              "sent_by": {
                "type": "string",
                "enum": [
                  "api",
                  "dashboard"
                ]
              },
              "template": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "language": {
                    "type": "string"
                  }
                }
              },
              "report_url": {
                "type": "string"
              }
            }
          },
          "counts": {
            "type": "object",
            "description": "Live from the messages: numbers, skipped_do_not_call, skipped_monthly_limit, posted, accepted, sent, delivered, read, failed, replied, opted_out.",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "results": {
            "type": "array",
            "description": "One per number: a MessageInfo, or {to, status: skipped|not_sent|pending, reason}.",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        }
      },
      "UsageResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "number": {
            "type": "string"
          },
          "plan": {
            "type": "string",
            "example": "standard_5000"
          },
          "service_status": {
            "type": "string",
            "example": "LIVE"
          },
          "billing_period": {
            "type": "object",
            "properties": {
              "start": {
                "type": "string",
                "format": "date-time"
              },
              "end": {
                "type": "string",
                "format": "date-time"
              }
            }
          },
          "whatsapp_messages": {
            "type": "object",
            "description": "used: WhatsApp messages sent. limit and left: the plan's, shared with outgoing email - see plan_messages.",
            "properties": {
              "used": {
                "type": "integer"
              },
              "limit": {
                "type": "integer"
              },
              "left": {
                "type": "integer"
              }
            }
          },
          "plan_messages": {
            "type": "object",
            "description": "The plan limit covers outgoing WhatsApp + outgoing emails added together.",
            "properties": {
              "whatsapp_sent": {
                "type": "integer"
              },
              "emails_sent": {
                "type": "integer"
              },
              "total_sent": {
                "type": "integer"
              },
              "limit": {
                "type": "integer"
              },
              "left": {
                "type": "integer"
              }
            }
          },
          "messages_received_this_billing_month": {
            "type": "integer"
          },
          "max_numbers_per_request": {
            "type": "integer"
          },
          "broadcasts_this_billing_month": {
            "type": "integer"
          },
          "do_not_call_list": {
            "type": "object",
            "properties": {
              "count": {
                "type": "integer"
              }
            }
          },
          "webhooks": {
            "type": "integer"
          },
          "monthly_cap": {
            "type": "integer",
            "description": "The number's own monthly cap (settings caps.monthly_messages). Left out when there is none."
          },
          "meta_pricing": {
            "$ref": "#/components/schemas/MetaPricing"
          }
        }
      },
      "DoNotCallEntry": {
        "type": "object",
        "properties": {
          "number": {
            "type": "string",
            "example": "61412345678"
          },
          "name": {
            "type": "string"
          },
          "added": {
            "type": "string",
            "format": "date-time"
          },
          "source": {
            "type": "string",
            "enum": [
              "stop_promotions",
              "whatsapp_stop",
              "manual",
              "upload",
              "api"
            ]
          },
          "note": {
            "type": "string"
          }
        }
      },
      "DoNotCallListResponse": {
        "type": "object",
        "description": "The whole list, or with ?number= whether that number is on it.",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "count": {
            "type": "integer"
          },
          "numbers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DoNotCallEntry"
            }
          },
          "number": {
            "type": "string",
            "description": "?number= only."
          },
          "on_list": {
            "type": "boolean",
            "description": "?number= only."
          },
          "entry": {
            "$ref": "#/components/schemas/DoNotCallEntry"
          }
        }
      },
      "DoNotCallAddRequest": {
        "type": "object",
        "description": "Up to 1000 numbers: strings, or objects with a name and note. Or one entry: {\"number\": ..., \"name\": ..., \"note\": ...}.",
        "properties": {
          "numbers": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            },
            "example": [
              "61412345678",
              {
                "number": "61498765432",
                "name": "Mary",
                "note": "Unsubscribed in our CRM"
              }
            ]
          },
          "number": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "DoNotCallAddResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "added": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "already_on_list": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "count": {
            "type": "integer",
            "description": "Numbers on the list now."
          }
        }
      },
      "DoNotCallRemoveResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "number": {
            "type": "string"
          },
          "removed": {
            "type": "boolean",
            "description": "false: it was not on the list."
          },
          "count": {
            "type": "integer"
          }
        }
      },
      "WebhookRequest": {
        "type": "object",
        "required": [
          "url"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "example": "https://hooks.example.com/app2email",
            "description": "Public https address that accepts POST. No redirects."
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "deprecated": true,
            "description": "Not used: every webhook gets every event. Accepted (and ignored) so older clients keep working."
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Up to 5 custom headers sent with every event, eg {\"Authorization\": \"Basic dXNlcjpwYXNz\"}. Values: printable ASCII, one line. Not allowed: Host, User-Agent, Content-*, X-App2email-*, X-Hub-*, Proxy-*, X-Forwarded-* and connection headers. Answers (also a test's sent_headers) show each value as its last 4 characters.",
            "example": {
              "Authorization": "Basic dXNlcjpwYXNz"
            }
          },
          "format": {
            "type": "string",
            "enum": [
              "app2email",
              "meta"
            ],
            "default": "app2email",
            "description": "The body format, not an event choice: every webhook still gets every event. meta: what comes from WhatsApp is sent as Meta's own webhook body ({object, entry[].changes[]}, as Meta sent it; X-App2email-Event: meta.<field>), one POST per change, instead of its events (message.*, contact.opted_out, contact.changed_number, number.*, template.status_changed, WhatsApp's handovers and marketing_resumed). app2email's own events (broadcast.completed, usage.threshold, approvals, contact changes made in app2email ...) keep the envelope. Signed the same way."
          }
        }
      },
      "WebhookPatchRequest": {
        "type": "object",
        "description": "Change any of them. Only what is given changes.",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "example": "https://hooks.example.com/app2email-v2",
            "description": "Public https address that accepts POST. No redirects."
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "deprecated": true,
            "description": "Not used: every webhook gets every event. A PATCH with only events answers 200 with the webhook unchanged."
          },
          "active": {
            "type": "boolean",
            "description": "true: turn the webhook on again (after it was switched off for failures). false: turn it off."
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Up to 5 custom headers sent with every event, eg {\"Authorization\": \"Basic dXNlcjpwYXNz\"}. Values: printable ASCII, one line. Not allowed: Host, User-Agent, Content-*, X-App2email-*, X-Hub-*, Proxy-*, X-Forwarded-* and connection headers. Answers (also a test's sent_headers) show each value as its last 4 characters. A header set to null is removed; \"headers\": null removes them all.",
            "example": {
              "Authorization": "Basic dXNlcjpwYXNz"
            }
          },
          "format": {
            "type": "string",
            "enum": [
              "app2email",
              "meta"
            ],
            "default": "app2email",
            "description": "The body format, not an event choice: every webhook still gets every event. meta: what comes from WhatsApp is sent as Meta's own webhook body ({object, entry[].changes[]}, as Meta sent it; X-App2email-Event: meta.<field>), one POST per change, instead of its events (message.*, contact.opted_out, contact.changed_number, number.*, template.status_changed, WhatsApp's handovers and marketing_resumed). app2email's own events (broadcast.completed, usage.threshold, approvals, contact changes made in app2email ...) keep the envelope. Signed the same way."
          }
        }
      },
      "Webhook": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "wh_a1b2c3d4e5f6g7h8"
          },
          "url": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Every event type: every webhook gets every event."
          },
          "secret": {
            "type": "string",
            "description": "Signs every event: X-App2email-Signature and X-Hub-Signature-256. New one from POST .../rotate-secret."
          },
          "previous_secret_until": {
            "type": "string",
            "format": "date-time",
            "description": "After rotate-secret with keep_old_for_hours: the old secret also signs (a second v1= in X-App2email-Signature) until then."
          },
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "active": {
            "type": "boolean",
            "description": "false: switched off (see disabled_reason). Turn it on with PATCH active: true."
          },
          "disabled_reason": {
            "type": "string",
            "description": "Why it is off, eg after too many failed deliveries in a row, or 'turned off by you'."
          },
          "last_delivery": {
            "type": "object",
            "properties": {
              "at": {
                "type": "string",
                "format": "date-time"
              },
              "ok": {
                "type": "boolean"
              },
              "result": {
                "type": "string"
              }
            }
          },
          "format": {
            "type": "string",
            "enum": [
              "app2email",
              "meta"
            ],
            "default": "app2email",
            "description": "The body format, not an event choice: every webhook still gets every event. meta: what comes from WhatsApp is sent as Meta's own webhook body ({object, entry[].changes[]}, as Meta sent it; X-App2email-Event: meta.<field>), one POST per change, instead of its events (message.*, contact.opted_out, contact.changed_number, number.*, template.status_changed, WhatsApp's handovers and marketing_resumed). app2email's own events (broadcast.completed, usage.threshold, approvals, contact changes made in app2email ...) keep the envelope. Signed the same way."
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "The custom headers, each value as its last 4 characters.",
            "example": {
              "Authorization": "****YXNz"
            }
          }
        }
      },
      "WebhookDelivery": {
        "type": "object",
        "description": "One event sent (or tried) to a webhook. Kept 7 days, the latest 100 per webhook.",
        "properties": {
          "event_id": {
            "type": "string",
            "example": "evt_Xq3..."
          },
          "type": {
            "type": "string",
            "example": "message.status"
          },
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "delivered": {
            "type": "boolean",
            "description": "true: your URL answered 2xx."
          },
          "attempts": {
            "type": "array",
            "description": "Every try, in order.",
            "items": {
              "type": "object",
              "properties": {
                "at": {
                  "type": "string",
                  "format": "date-time"
                },
                "ok": {
                  "type": "boolean"
                },
                "http_status": {
                  "type": "integer"
                },
                "ms": {
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                }
              }
            }
          },
          "event_body": {
            "$ref": "#/components/schemas/WebhookEvent",
            "description": "Only in GET .../deliveries/{event_id}: the event exactly as sent."
          },
          "next_attempt_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the next try is planned, while one is (tries after 10 s, 1 min, 5 min, 30 min, 1, 2, 4, 8, 16 h)."
          }
        }
      },
      "WebhookDeliveriesResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "deliveries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookDelivery"
            }
          },
          "note": {
            "type": "string"
          }
        }
      },
      "WebhookDeliveryResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "delivery": {
            "$ref": "#/components/schemas/WebhookDelivery"
          }
        }
      },
      "WebhookRedeliverResponse": {
        "type": "object",
        "description": "The stored event sent again (same event id). See WebhookTestResponse for the fields.",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "delivered": {
            "type": "boolean"
          },
          "http_status": {
            "type": "integer"
          },
          "response_ms": {
            "type": "integer"
          },
          "error": {
            "type": "string"
          }
        }
      },
      "WebhookResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "webhook": {
            "$ref": "#/components/schemas/Webhook"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "WebhooksResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "events_available": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "webhooks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhook"
            }
          }
        }
      },
      "WebhookDeleteResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "deleted": {
            "type": "string"
          }
        }
      },
      "WebhookTestResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "delivered": {
            "type": "boolean",
            "description": "Your URL answered 2xx within 10 seconds."
          },
          "http_status": {
            "type": "integer"
          },
          "response_ms": {
            "type": "integer"
          },
          "error": {
            "type": "string"
          },
          "response_body": {
            "type": "string",
            "description": "The start of what your URL answered (up to 1000 characters)."
          },
          "sent_headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "The headers sent, signatures included."
          },
          "sent_event": {
            "$ref": "#/components/schemas/WebhookEvent"
          },
          "sent_body": {
            "type": "string",
            "description": "The body exactly as sent (and signed)."
          }
        }
      },
      "WebhookTestRequest": {
        "type": "object",
        "description": "Optional. No body: a ping. type: that event's sample (GET .../webhooks/samples). event: the event you give, as it is (a missing id, created or number is filled in).",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "ping",
              "message.status",
              "message.received",
              "message.failed",
              "contact.opted_out",
              "broadcast.completed",
              "usage.threshold",
              "template.status_changed",
              "conversation.owner_changed",
              "message.held_for_approval",
              "approval.resolved",
              "contact.updated",
              "booking.created",
              "booking.cancelled",
              "booking.rescheduled",
              "booking.rated",
              "flow.completed",
              "booking.updated",
              "booking.note.created",
              "calendar.block.created",
              "calendar.block.deleted",
              "call.incoming",
              "call.status",
              "message.edited",
              "message.deleted",
              "contact.changed_number",
              "number.updated",
              "number.error",
              "flow.status_changed",
              "client.created",
              "client.updated",
              "client.suspended",
              "number.created",
              "number.ready",
              "number.disconnected",
              "number.reconnected",
              "subscription.created",
              "subscription.renewed",
              "subscription.payment_failed",
              "subscription.cancelled",
              "trial.ending",
              "trial.expired",
              "plan.limit_reached",
              "api_key.created",
              "api_key.revoked",
              "booking.paid",
              "booking.refunded",
              "payment.paid",
              "package.purchased",
              "poll.voted",
              "poll.closed",
              "booking.customer.erased"
            ],
            "example": "message.received"
          },
          "event": {
            "$ref": "#/components/schemas/WebhookEvent"
          }
        }
      },
      "WebhookRotateRequest": {
        "type": "object",
        "description": "Optional. No body: the old secret stops at once.",
        "properties": {
          "keep_old_for_hours": {
            "type": "integer",
            "minimum": 0,
            "maximum": 24,
            "example": 24,
            "description": "The old secret keeps signing too (a second v1= in X-App2email-Signature) for this many hours."
          }
        }
      },
      "WebhookSamplesResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "samples": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/WebhookEvent"
            },
            "description": "Event type -> a sample event, as a test sends it."
          },
          "note": {
            "type": "string"
          },
          "meta_samples": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": true
            },
            "description": "Event type -> what a webhook with format meta gets instead (only the events that come from WhatsApp)."
          }
        }
      },
      "WebhookEvent": {
        "type": "object",
        "description": "What app2email POSTs to your webhook URL. Headers: X-App2email-Event (the type), X-App2email-Delivery (the id), X-App2email-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the webhook's secret> (a second v1= while an old secret is kept), X-Hub-Signature-256: sha256=<hex HMAC-SHA256 of the raw body with the webhook's secret> (as Meta signs WhatsApp webhooks), and on test events X-App2email-Test: true.",
        "properties": {
          "id": {
            "type": "string",
            "example": "evt_Xq3..."
          },
          "type": {
            "type": "string",
            "enum": [
              "message.status",
              "message.received",
              "message.failed",
              "contact.opted_out",
              "broadcast.completed",
              "usage.threshold",
              "template.status_changed",
              "conversation.owner_changed",
              "message.held_for_approval",
              "approval.resolved",
              "contact.updated",
              "booking.created",
              "booking.cancelled",
              "booking.rescheduled",
              "booking.rated",
              "flow.completed",
              "booking.updated",
              "booking.note.created",
              "calendar.block.created",
              "calendar.block.deleted",
              "call.incoming",
              "call.status",
              "message.edited",
              "message.deleted",
              "contact.changed_number",
              "number.updated",
              "number.error",
              "flow.status_changed",
              "client.created",
              "client.updated",
              "client.suspended",
              "number.created",
              "number.ready",
              "number.disconnected",
              "number.reconnected",
              "subscription.created",
              "subscription.renewed",
              "subscription.payment_failed",
              "subscription.cancelled",
              "trial.ending",
              "trial.expired",
              "plan.limit_reached",
              "api_key.created",
              "api_key.revoked",
              "booking.paid",
              "booking.refunded",
              "payment.paid",
              "package.purchased",
              "poll.voted",
              "poll.closed",
              "booking.customer.erased",
              "ping"
            ]
          },
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "number": {
            "type": "string",
            "description": "Your WhatsApp number."
          },
          "test": {
            "type": "boolean",
            "description": "Only on test events (POST .../test): true."
          },
          "data": {
            "type": "object",
            "additionalProperties": true,
            "description": "message.status: {message_id, to, status (sent|delivered|read|played|clicked|failed|deleted), timestamp, error {code, message, title, details, error_code, how_to_fix, is_retriable, retry_after_seconds}, sent_by, broadcast_code, whatsapp_status, pricing, callback_data, recipient_user_id, recipient_identity_key_hash, whatsapp}. message.failed: the same data as message.status with status failed. message.received: {message_id, from, from_user_id, media_url, name, type, text, button {text, payload}, in_reply_to, conversation_url, timestamp, context, referral, location, contacts, reaction, interactive, flow, order, identity_key_hash, whatsapp (Meta's message object)}. contact.opted_out: {number, name, source (stop_promotions|whatsapp_stop), detail, timestamp}. broadcast.completed: {code, name, status (completed|cancelled|missed), sent_by, numbers, posted, accepted, errors, skipped_do_not_call, skipped_monthly_limit, status_url, report_url}. usage.threshold: {threshold_percent (80|100), whatsapp_messages {used, limit, left}, plan_messages {whatsapp_sent, emails_sent, total_sent, limit, left}, plan, billing_period {start, end}, timestamp}. template.status_changed: {template {name, language, id}, status (APPROVED|PENDING|REJECTED|PAUSED|DISABLED|COMPONENTS_UPDATED ...), change (a Meta field, or components: the template was edited), previous_value, new_value, components, reason, can_send, timestamp}. conversation.owner_changed: {contact, owner, previous_owner, reason, summary, until, set_by, timestamp}. message.held_for_approval: {approval_id, url, approve_url, recipients, key, summary, expires, timestamp}. approval.resolved: {approval_id, status (approved|rejected|expired), resolved_by, result {status, accepted, failed, broadcast_code}, timestamp}. contact.updated: {contact (a Contact), change (upsert|patch|consent|marketing_resumed), timestamp}. booking.created / booking.cancelled / booking.rescheduled / booking.rated: the Booking object (id, reference, status, contact, contact_name, service {id, name, duration_min}, start, end, timezone, source, calendar {provider, event_id, url, error}, answers, notes, provider {id, name}, rating, payment_status, credits_used, attendance_confirmed, cancelled {at, by, reason}, rescheduled_from_id, link_id, created) plus timestamp; booking.created also hold (true when made from a held time); booking.rescheduled also rescheduled_from {id, reference, start, end}; booking.rated also rated_at. flow.completed: {flow_key, flow_name, contact, contact_name, session_id, answers {field: text}, timestamp}. booking.updated: the Booking object plus changed [name | email | notes | answers | provider] and updated_by. booking.note.created: the Note {id, contact, appointment_id, booking_reference, body, author, author_kind, pinned, created, updated} plus booking {id, reference} (null when on the customer alone). calendar.block.created / calendar.block.deleted: the Block {id, provider_id, title, notes, start, end, start_local, end_local, source, created_by, created, updated} plus by. booking.paid / booking.refunded: the Booking object plus payment {the Payment}; booking.refunded also refund {amount, amount_label, full, by}. payment.paid: {payment, timestamp}. package.purchased: {purchase, payment, granted, timestamp}. poll.voted: {poll_id, title, name, contact, email, choices, comment}. poll.closed: {poll_id, title, status closed | booked, chosen_option, appointment_id, by}. booking.customer.erased: {contact, counts}. call.incoming: {call_id, status, direction, event, from, from_user_id, to, to_user_id, contact, session, start_time, end_time, duration_seconds, biz_opaque_callback_data, error, recording, transcription, timestamp, whatsapp}. call.status: {call_id, status, direction, event, from, from_user_id, to, to_user_id, contact, session, start_time, end_time, duration_seconds, biz_opaque_callback_data, error, recording, transcription, timestamp, whatsapp}. message.edited: {message_id, original_message_id, from, from_user_id, name, type, text, message, conversation_url, timestamp, whatsapp}. message.deleted: {message_id, original_message_id, from, from_user_id, name, conversation_url, timestamp, whatsapp}. contact.changed_number: {change, previous, new, name, body, message_id, conversation_url, timestamp, whatsapp}. number.updated: {change, previous_value, new_value, details, next_step, whatsapp_field, timestamp}. number.error: {code, title, message, details, href, error_code, how_to_fix, is_retriable, retry_after_seconds, timestamp}. flow.status_changed: {flow_id, change, event, old_status, new_status, message, warning, alert_state, threshold, error_rate, p50_latency, p90_latency, availability, requests_count, errors, timestamp}. client.created: {client, source, changes, timestamp}. client.updated: {client, source, changes, timestamp}. client.suspended: {client, source, changes, timestamp}. number.created: {number, client_id, timestamp, name, display_number, service_status, plan}. number.ready: {number, client_id, timestamp, name, service_status, plan}. number.disconnected: {number, client_id, timestamp, reason, next_step, details}. number.reconnected: {number, client_id, timestamp, reason, details}. subscription.created: {subscription, timestamp}. subscription.renewed: {subscription, timestamp}. subscription.payment_failed: {subscription, timestamp}. subscription.cancelled: {subscription, timestamp}. trial.ending: {number, client_id, timestamp, trial_ends_at, days_left, plan_messages}. trial.expired: {number, client_id, timestamp, trial_ended_at, service_status}. plan.limit_reached: {number, client_id, timestamp, plan, plan_messages, billing_period}. api_key.created: {number, client_id, timestamp, key, created_by}. api_key.revoked: {number, client_id, timestamp, key, revoked_by}. ping: {webhook_id, message}."
          }
        }
      },
      "TemplatesResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "request_id": {
            "type": "string"
          },
          "from": {
            "type": "string",
            "example": "4976659348270"
          },
          "send_url": {
            "type": "string",
            "example": "https://api.app2email.com/v1/4976659348270/messages"
          },
          "templates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TemplateInfo"
            }
          }
        }
      },
      "TemplateInfo": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "category": {
            "type": "string",
            "example": "UTILITY"
          },
          "status": {
            "type": "string",
            "example": "APPROVED",
            "description": "APPROVED, PENDING, REJECTED, PAUSED, DISABLED ..."
          },
          "id": {
            "type": "string",
            "description": "WhatsApp's id of the template (in GET /templates/{name})."
          },
          "rejected_reason": {
            "type": "string",
            "description": "Why WhatsApp rejected it. Left out when there is none."
          },
          "quality_score": {
            "type": "string",
            "enum": [
              "GREEN",
              "YELLOW",
              "RED"
            ],
            "description": "WhatsApp's quality rating from the contacts' reactions. Left out when unknown. A RED template can be paused by WhatsApp."
          },
          "can_send": {
            "type": "boolean",
            "description": "Only APPROVED templates can be sent."
          },
          "needs": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "What values the template needs, in words."
          },
          "example_request": {
            "$ref": "#/components/schemas/SendTemplateRequest"
          },
          "sub_category": {
            "type": "string"
          },
          "previous_category": {
            "type": "string",
            "description": "The category before Meta changed it."
          },
          "correct_category": {
            "type": "string",
            "description": "The category Meta says is right."
          },
          "parameter_format": {
            "type": "string"
          },
          "message_send_ttl_seconds": {
            "type": "integer"
          },
          "cta_url_link_tracking_opted_out": {
            "type": "boolean"
          },
          "is_primary_device_delivery_only": {
            "type": "boolean"
          },
          "library_template_name": {
            "type": "string",
            "description": "Set when the template came from the Template Library."
          }
        }
      },
      "TemplateDetailResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "versions": {
            "type": "array",
            "description": "One entry per language of the template.",
            "items": {
              "$ref": "#/components/schemas/TemplateInfo"
            }
          }
        }
      },
      "TemplateCreateRequest": {
        "type": "object",
        "required": [
          "name",
          "language",
          "category"
        ],
        "description": "The template as WhatsApp's API takes it. Meta's template rules apply (placeholders {{1}}, sample values in 'example').",
        "properties": {
          "name": {
            "type": "string",
            "example": "order_update",
            "description": "Lowercase letters, digits and underscores."
          },
          "language": {
            "type": "string",
            "example": "en"
          },
          "category": {
            "type": "string",
            "enum": [
              "MARKETING",
              "UTILITY",
              "AUTHENTICATION"
            ],
            "example": "UTILITY"
          },
          "components": {
            "type": "array",
            "description": "WhatsApp's components: BODY (text), HEADER, FOOTER, BUTTONS. Required unless library_template_name is given.",
            "items": {
              "type": "object",
              "additionalProperties": true
            },
            "example": [
              {
                "type": "BODY",
                "text": "Hi {{1}}, your order {{2}} has shipped.",
                "example": {
                  "body_text": [
                    [
                      "John",
                      "#1234"
                    ]
                  ]
                }
              }
            ]
          },
          "parameter_format": {
            "type": "string",
            "enum": [
              "NAMED",
              "POSITIONAL"
            ],
            "description": "NAMED ({{first_name}}) or POSITIONAL ({{1}}) placeholders."
          },
          "allow_category_change": {
            "type": "boolean",
            "description": "Passed on; Meta ignores it since 9 Apr 2025 (it sets the category itself)."
          },
          "message_send_ttl_seconds": {
            "type": "integer",
            "description": "How long WhatsApp tries to deliver (Meta's ranges per category)."
          },
          "cta_url_link_tracking_opted_out": {
            "type": "boolean",
            "description": "true: no click tracking on URL buttons."
          },
          "is_primary_device_delivery_only": {
            "type": "boolean"
          },
          "sub_category": {
            "type": "string",
            "example": "ORDER_STATUS"
          },
          "display_format": {
            "type": "string",
            "example": "ORDER_DETAILS"
          },
          "degrees_of_freedom_spec": {
            "type": "object",
            "additionalProperties": true,
            "description": "Marketing creative options, as Meta takes them."
          },
          "send_type": {
            "type": "string",
            "enum": [
              "campaign",
              "direct"
            ],
            "description": "Marketing Messages API templates."
          },
          "optimization_spec": {
            "$ref": "#/components/schemas/OptimizationSpec"
          },
          "library_template_name": {
            "type": "string",
            "example": "delivery_update_1",
            "description": "Create from the Template Library (GET /template-library); then no components."
          },
          "library_template_button_inputs": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            },
            "example": [
              {
                "type": "URL",
                "url": {
                  "base_url": "https://www.example.com/{{1}}",
                  "url_suffix_example": "https://www.example.com/order/1234"
                }
              }
            ],
            "description": "Library templates with buttons: the website and phone number."
          },
          "library_template_body_inputs": {
            "type": "object",
            "additionalProperties": true,
            "example": {
              "add_contact_number": true
            }
          }
        }
      },
      "TemplateCreateResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "template": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "language": {
                "type": "string"
              },
              "category": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "example": "PENDING"
              }
            }
          },
          "note": {
            "type": "string"
          }
        }
      },
      "TemplateDeleteResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "deleted": {
            "type": "string",
            "example": "order_update"
          },
          "languages": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "note": {
            "type": "string"
          }
        }
      },
      "FreeFormText": {
        "type": "object",
        "required": [
          "body"
        ],
        "properties": {
          "body": {
            "type": "string",
            "example": "Thanks, it arrives on Friday.",
            "description": "The text. Up to 4096 characters."
          },
          "preview_url": {
            "type": "boolean",
            "default": false,
            "description": "true: show a preview of a link in the text."
          }
        }
      },
      "FreeFormMedia": {
        "type": "object",
        "description": "Give exactly one of: link, data or id. 'filename' is shown to the recipient for documents.",
        "properties": {
          "link": {
            "type": "string",
            "format": "uri",
            "example": "https://example.com/photo.jpg",
            "description": "Public http(s) URL. app2email downloads the file and uploads it to WhatsApp."
          },
          "data": {
            "type": "string",
            "format": "byte",
            "description": "The file, base64 encoded. A 'data:<mime>;base64,' prefix is accepted."
          },
          "id": {
            "type": "string",
            "description": "A media id from POST /media (or uploaded to WhatsApp for this number)."
          },
          "filename": {
            "type": "string",
            "example": "invoice.pdf",
            "description": "Needed with 'data' for documents."
          },
          "mime_type": {
            "type": "string",
            "example": "application/pdf",
            "description": "Optional. The type is detected from the file where possible."
          },
          "caption": {
            "type": "string",
            "maxLength": 1024,
            "example": "Your parcel",
            "description": "Optional text under the image, video or document."
          }
        }
      },
      "MediaUploadRequest": {
        "type": "object",
        "required": [
          "type",
          "file"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "image",
              "video",
              "document",
              "audio",
              "sticker"
            ]
          },
          "file": {
            "type": "object",
            "description": "Give 'link' (a public URL) or base64 'data'. 'filename' for documents.",
            "properties": {
              "link": {
                "type": "string",
                "format": "uri",
                "example": "https://example.com/photo.jpg"
              },
              "data": {
                "type": "string",
                "format": "byte"
              },
              "filename": {
                "type": "string",
                "example": "invoice.pdf"
              },
              "mime_type": {
                "type": "string",
                "example": "application/pdf",
                "description": "Optional. The type is detected from the file where possible."
              },
              "voice": {
                "type": "boolean",
                "description": "Audio: check it is a voice message (Ogg with OPUS)."
              }
            }
          }
        }
      },
      "MediaUploadResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "media_id": {
            "type": "string",
            "example": "1234567890"
          },
          "type": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "info": {
            "type": "object",
            "additionalProperties": true
          },
          "expires_in_days": {
            "type": "integer",
            "example": 30
          },
          "note": {
            "type": "string"
          },
          "sandbox": {
            "type": "boolean",
            "description": "true: a sandbox key; the file was checked, nothing uploaded, media_id is made up (sandbox sends accept it)."
          }
        }
      },
      "MeResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "key_valid": {
            "type": "boolean",
            "example": true
          },
          "api_version": {
            "type": "string",
            "example": "v1"
          },
          "number": {
            "type": "string"
          },
          "plan": {
            "type": "string",
            "example": "standard_5000"
          },
          "service_status": {
            "type": "string",
            "example": "LIVE"
          },
          "key": {
            "type": "object",
            "description": "The key used for this call.",
            "properties": {
              "name": {
                "type": "string",
                "example": "Zapier"
              },
              "scopes": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "example": [
                  "messages:read",
                  "messages:send"
                ],
                "description": "'*' = full access."
              },
              "expires": {
                "type": "string",
                "format": "date-time",
                "description": "Left out when the key never expires."
              },
              "ip_allow": {
                "type": "string",
                "description": "The addresses it may be used from, comma separated. '' = any."
              },
              "sandbox": {
                "type": "boolean",
                "description": "true: a sandbox key, sends are simulated."
              },
              "daily_cap": {
                "type": "integer",
                "description": "Most messages per UTC day. Left out when there is no cap."
              },
              "daily_used": {
                "type": "integer",
                "description": "Messages counted against the daily cap today."
              },
              "approval_above": {
                "type": "integer",
                "description": "Sends to more contacts than this are held for approval. Left out when there is no gate."
              }
            }
          },
          "sandbox": {
            "type": "boolean",
            "description": "true when the key is a sandbox key (left out otherwise)."
          },
          "limits": {
            "type": "object",
            "properties": {
              "max_numbers_per_request": {
                "type": "integer"
              },
              "requests_per_second": {
                "type": "integer"
              },
              "burst": {
                "type": "integer"
              },
              "rate_limit_mode": {
                "type": "string",
                "enum": [
                  "log_only",
                  "enforce",
                  "off"
                ]
              },
              "webhooks_max": {
                "type": "integer"
              },
              "monthly_cap": {
                "type": "integer",
                "description": "The number's own monthly cap (settings caps.monthly_messages). Left out when there is none."
              }
            }
          },
          "conversation_owner_values": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "",
              "agent",
              "human",
              "paused"
            ]
          },
          "scopes_available": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "RequestLogItem": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "example": "kxrkf"
          },
          "time": {
            "type": "string",
            "format": "date-time"
          },
          "method": {
            "type": "string",
            "example": "POST"
          },
          "route": {
            "type": "string",
            "example": "/v1/4976659348270/messages"
          },
          "status": {
            "type": "integer",
            "example": 422
          },
          "ms": {
            "type": "integer",
            "example": 412
          },
          "key": {
            "type": "string",
            "example": "Zapier",
            "description": "The key's name, or 'Default key'."
          },
          "ip": {
            "type": "string",
            "example": "203.0.113.7"
          }
        }
      },
      "RequestsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "requests": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RequestLogItem"
            }
          },
          "note": {
            "type": "string"
          }
        }
      },
      "RequestResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "request": {
            "$ref": "#/components/schemas/RequestLogItem"
          }
        }
      },
      "MessageListItem": {
        "type": "object",
        "description": "direction 'out': a message sent from the number (the MessageInfo fields, plus time). direction 'in': a contact's message (from, name, text, media).",
        "properties": {
          "direction": {
            "type": "string",
            "enum": [
              "in",
              "out"
            ]
          },
          "message_id": {
            "type": "string",
            "example": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA="
          },
          "to": {
            "type": "string",
            "example": "61412345678",
            "description": "direction out."
          },
          "from": {
            "type": "string",
            "example": "61412345678",
            "description": "direction in: the contact's number, or their business-scoped user id when no number is known."
          },
          "from_user_id": {
            "type": "string",
            "description": "direction in: the contact's business-scoped user id, when WhatsApp sent one."
          },
          "media_url": {
            "type": "string",
            "description": "direction in, media messages: app2email's stored copy (GET /media/{message_id}, with your key). WhatsApp's own media ids expire after 7 days."
          },
          "name": {
            "type": "string",
            "description": "direction in: the contact's name."
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "accepted",
              "sent",
              "delivered",
              "read",
              "failed",
              "deleted",
              "unknown"
            ],
            "description": "direction out."
          },
          "sent_by": {
            "type": "string"
          },
          "broadcast_code": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "media": {
            "type": "string"
          },
          "time": {
            "type": "string",
            "format": "date-time"
          },
          "times": {
            "$ref": "#/components/schemas/MessageTimes",
            "description": "direction out."
          },
          "error": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              }
            },
            "description": "direction out, when it failed."
          },
          "reply": {
            "type": "object",
            "description": "direction out: the contact's reply."
          },
          "conversation_url": {
            "type": "string"
          }
        }
      },
      "MessagesListResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MessageListItem"
            }
          },
          "next_cursor": {
            "type": "string",
            "description": "Pass it as cursor for the next page. Left out on the last page."
          },
          "count": {
            "type": "integer"
          }
        }
      },
      "ConversationItem": {
        "type": "object",
        "properties": {
          "contact": {
            "type": "string",
            "example": "61412345678",
            "description": "The phone number, or the business-scoped user id when no number is known."
          },
          "user_id": {
            "type": "string",
            "description": "The contact's business-scoped user id, when WhatsApp sent one."
          },
          "name": {
            "type": "string"
          },
          "last_inbound": {
            "type": "string",
            "format": "date-time"
          },
          "last_outbound": {
            "type": "string",
            "format": "date-time"
          },
          "window_open": {
            "type": "boolean",
            "description": "true: a free-form reply can be sent now (24 hour window)."
          },
          "window_closes_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the window closes (only while it is open)."
          },
          "owner": {
            "type": "string",
            "enum": [
              "agent",
              "human",
              "paused"
            ],
            "description": "Who handles the contact (PUT /conversations/{contact}/owner). Left out for the normal routing."
          },
          "messages": {
            "type": "integer"
          },
          "conversation_url": {
            "type": "string"
          }
        }
      },
      "ConversationsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "conversations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConversationItem"
            }
          },
          "next_cursor": {
            "type": "string"
          },
          "count": {
            "type": "integer"
          }
        }
      },
      "ConversationMessagesResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "contact": {
            "type": "string",
            "example": "61412345678"
          },
          "window_open": {
            "type": "boolean"
          },
          "window_closes_at": {
            "type": "string",
            "format": "date-time"
          },
          "owner": {
            "type": "string",
            "enum": [
              "agent",
              "human",
              "paused"
            ],
            "description": "Left out for the normal routing."
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MessageListItem"
            }
          },
          "next_cursor": {
            "type": "string"
          },
          "count": {
            "type": "integer"
          }
        }
      },
      "UsageHistoryResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "number": {
            "type": "string"
          },
          "months": {
            "type": "array",
            "description": "Newest first. Calendar months, UTC.",
            "items": {
              "type": "object",
              "properties": {
                "month": {
                  "type": "string",
                  "example": "2026-10"
                },
                "messages_sent": {
                  "type": "integer"
                },
                "messages_failed": {
                  "type": "integer"
                },
                "messages_received": {
                  "type": "integer"
                },
                "broadcasts": {
                  "type": "integer"
                }
              }
            }
          }
        }
      },
      "StatsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "messages": {
            "type": "object",
            "description": "Sent messages in the range: submitted, accepted (WhatsApp took them), sent, delivered, read, failed, replied.",
            "properties": {
              "submitted": {
                "type": "integer"
              },
              "accepted": {
                "type": "integer"
              },
              "sent": {
                "type": "integer"
              },
              "delivered": {
                "type": "integer"
              },
              "read": {
                "type": "integer"
              },
              "failed": {
                "type": "integer"
              },
              "replied": {
                "type": "integer"
              }
            }
          },
          "received": {
            "type": "integer"
          },
          "rates": {
            "type": "object",
            "description": "Fractions: delivery = delivered / sent, read = read / delivered, reply = replied / sent.",
            "properties": {
              "delivery": {
                "type": "number"
              },
              "read": {
                "type": "number"
              },
              "reply": {
                "type": "number"
              }
            }
          },
          "truncated": {
            "type": "boolean",
            "description": "true: the range had too many messages, the counts are for part of it."
          }
        }
      },
      "BroadcastCancelResponse": {
        "type": "object",
        "description": "200: a scheduled broadcast was removed. 202: a broadcast that is sending now is being cancelled.",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "broadcast": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "cancelled",
                  "cancelling"
                ]
              }
            }
          },
          "sent_before_cancel": {
            "type": "integer",
            "description": "200 only."
          },
          "note": {
            "type": "string"
          }
        }
      },
      "AutoreplySettings": {
        "type": "object",
        "required": [
          "text"
        ],
        "properties": {
          "text": {
            "type": "string",
            "maxLength": 4000,
            "example": "Thanks for writing! We reply within a day.",
            "description": "The first reply a new contact gets (the Default Auto Reply). 1 to 4000 characters. Auto Reply cards added on the dashboard (by date, day, time or keyword) are checked first; this text is used when none of them matches."
          }
        }
      },
      "AutoreplyResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "ForwardingSettings": {
        "type": "object",
        "description": "Fields left out stay as they are. These are the Default forwarding addresses: Email Rules added on the dashboard (by date, day, time or keyword) are checked first, and the first one that matches decides where that message goes.",
        "properties": {
          "to": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "email"
            },
            "example": [
              "a@x.com"
            ],
            "description": "Up to 3 emails. Or a string: \"a@x.com, b@y.com\"."
          },
          "cc": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "email"
            },
            "example": [],
            "description": "Up to 3 emails."
          },
          "bcc": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "email"
            },
            "example": [],
            "description": "Up to 3 emails."
          },
          "text": {
            "type": "string",
            "example": "New WhatsApp message",
            "description": "The line put before each forwarded message."
          }
        }
      },
      "ForwardingResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "forwarding": {
            "type": "object",
            "properties": {
              "to": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "cc": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "bcc": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "text": {
                "type": "string"
              },
              "works_on_this_plan": {
                "type": "boolean",
                "description": "WhatsApp-to-email forwarding works on the Professional and Trial plans."
              },
              "plan": {
                "type": "string"
              }
            }
          },
          "note": {
            "type": "string",
            "description": "PUT only: when the plan does not support forwarding."
          }
        }
      },
      "OptinSettingRequest": {
        "type": "object",
        "required": [
          "require_optin_for_marketing"
        ],
        "properties": {
          "require_optin_for_marketing": {
            "type": "boolean",
            "description": "true: marketing templates are only sent to numbers with an opt-in record (others: recipient_not_opted_in). Utility templates are not affected. Off by default."
          }
        }
      },
      "OptinSettingResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "require_optin_for_marketing": {
            "type": "boolean"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "OptinItem": {
        "type": "object",
        "properties": {
          "number": {
            "type": "string",
            "example": "61412345678"
          },
          "name": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "example": "web form"
          },
          "note": {
            "type": "string"
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "description": "When the person opted in."
          },
          "added_by": {
            "type": "string",
            "example": "api"
          }
        }
      },
      "OptinsAddRequest": {
        "type": "object",
        "required": [
          "numbers"
        ],
        "description": "Up to 1000 entries. All or nothing: one invalid entry, nothing is saved.",
        "properties": {
          "numbers": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "string",
                  "description": "A number with country code, digits only."
                },
                {
                  "type": "object",
                  "properties": {
                    "number": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string"
                    },
                    "note": {
                      "type": "string"
                    },
                    "at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "number"
                  ],
                  "additionalProperties": true
                }
              ]
            },
            "example": [
              "61412345678",
              {
                "number": "61498765432",
                "name": "Mary",
                "source": "web form",
                "note": "ticked the box",
                "at": "2026-10-01T00:00:00Z"
              }
            ],
            "description": "Numbers as strings, or objects with number, name, source, note and at (ISO 8601, when they opted in; default now)."
          }
        }
      },
      "OptinsAddResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "saved": {
            "type": "integer"
          }
        }
      },
      "OptinsListResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "total": {
            "type": "integer"
          },
          "optins": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OptinItem"
            }
          },
          "next_after": {
            "type": "string",
            "description": "Pass as 'after' for the next page. Left out on the last page and with ?number=."
          },
          "opted_in": {
            "type": "boolean",
            "description": "Only with ?number=: is this number opted in?"
          }
        }
      },
      "OptinRemoveResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "removed": {
            "type": "string",
            "example": "61412345678"
          }
        }
      },
      "Interactive": {
        "type": "object",
        "required": [
          "type",
          "action"
        ],
        "description": "WhatsApp's interactive object. type button: action.buttons, up to 3 reply buttons (title up to 20 characters; the shortcut \"buttons\": [\"Confirm\", \"Change\"] works too). type list: action.button (the text that opens the list) and action.sections with rows (up to 10 rows in all; a row can be a plain title). type cta_url: action.parameters {display_text, url}. header: text (60 characters), or image / video / document (link, data or id) for button and cta_url. body.text up to 1024 characters, footer.text up to 60. Also (WhatsApp Cloud API's objects): carousel (action.cards: 2 to 10, image or video header, one URL button or quick replies each; or product cards {card_index, type: 'product', action: {product_retailer_id, catalog_id}}), location_request_message, request_contact_info, flow (action.parameters: flow_message_version '3', flow_id or flow_name, flow_cta), product and product_list (a connected catalog), catalog_message, call_permission_request and voice_call (Calling), address_message (India; optional text header), order_details and order_status (payments). The fixed action.name of a kind is filled in when left out.",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "button",
              "list",
              "cta_url",
              "carousel",
              "location_request_message",
              "request_contact_info",
              "flow",
              "product",
              "product_list",
              "catalog_message",
              "call_permission_request",
              "voice_call",
              "address_message",
              "order_details",
              "order_status"
            ]
          },
          "header": {
            "type": "object",
            "additionalProperties": true,
            "example": {
              "type": "text",
              "text": "Booking"
            }
          },
          "body": {
            "type": "object",
            "required": [
              "text"
            ],
            "properties": {
              "text": {
                "type": "string",
                "maxLength": 1024,
                "example": "Confirm your booking for Friday 10:00?"
              }
            }
          },
          "footer": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string",
                "maxLength": 60
              }
            }
          },
          "action": {
            "type": "object",
            "additionalProperties": true,
            "example": {
              "buttons": [
                {
                  "type": "reply",
                  "reply": {
                    "id": "yes",
                    "title": "Confirm"
                  }
                },
                {
                  "type": "reply",
                  "reply": {
                    "id": "no",
                    "title": "Change"
                  }
                }
              ]
            }
          }
        }
      },
      "ConversationDetail": {
        "type": "object",
        "properties": {
          "contact": {
            "type": "string",
            "example": "61412345678"
          },
          "identity_type": {
            "type": "string",
            "enum": [
              "phone",
              "bsuid"
            ]
          },
          "phone": {
            "type": "string"
          },
          "user_id": {
            "type": "string",
            "description": "The business-scoped user id, when known."
          },
          "name": {
            "type": "string"
          },
          "window_state": {
            "type": "string",
            "enum": [
              "open",
              "closed"
            ],
            "description": "open: a free-form reply can be sent now."
          },
          "window_open": {
            "type": "boolean"
          },
          "window_closes_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_inbound_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_outbound_at": {
            "type": "string",
            "format": "date-time"
          },
          "messages": {
            "type": "integer"
          },
          "owner": {
            "type": "string",
            "enum": [
              "",
              "agent",
              "human",
              "paused"
            ],
            "description": "Who handles the contact now ('' = the number's normal routing; an owner_until in the past means '' again)."
          },
          "owner_set": {
            "type": "string",
            "description": "What was set, even when owner_until has passed."
          },
          "owner_set_at": {
            "type": "string",
            "format": "date-time"
          },
          "owner_set_by": {
            "type": "string",
            "example": "api:Support bot"
          },
          "owner_reason": {
            "type": "string"
          },
          "owner_summary": {
            "type": "string"
          },
          "owner_until": {
            "type": "string",
            "format": "date-time"
          },
          "held_replies": {
            "type": "boolean",
            "description": "Email replies are waiting for the contact to tap 'Show reply' (the 24 hour window had closed)."
          },
          "conversation_url": {
            "type": "string"
          }
        }
      },
      "ConversationDetailResponse": {
        "allOf": [
          {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "request_id": {
                "type": "string"
              }
            }
          },
          {
            "$ref": "#/components/schemas/ConversationDetail"
          }
        ]
      },
      "OwnerRequest": {
        "type": "object",
        "required": [
          "owner"
        ],
        "properties": {
          "owner": {
            "type": "string",
            "enum": [
              "",
              "agent",
              "human",
              "paused"
            ],
            "description": "'' = the normal routing. human / paused: the auto reply and the A2A / OpenClaw agent leave this contact alone."
          },
          "reason": {
            "type": "string",
            "maxLength": 200,
            "example": "customer asked for a person"
          },
          "summary": {
            "type": "string",
            "maxLength": 2000,
            "description": "What the conversation is about so far, for the person taking over."
          },
          "until_minutes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 43200,
            "description": "After this many minutes the owner goes back to ''."
          }
        }
      },
      "OwnerResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "conversation": {
            "$ref": "#/components/schemas/ConversationDetail"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "NumberSettings": {
        "type": "object",
        "description": "The number's settings. GET answers every key with its default; PUT changes only the keys given (nested objects or dotted keys like \"email.mark_read_on_open\").",
        "properties": {
          "email": {
            "type": "object",
            "properties": {
              "delivery_receipts": {
                "type": "string",
                "enum": [
                  "failed_only",
                  "none",
                  "all"
                ],
                "default": "failed_only",
                "description": "An email to the sender when their email reply failed on WhatsApp (or for every status)."
              },
              "mark_read_on_open": {
                "type": "boolean",
                "default": false,
                "description": "Send WhatsApp a read receipt when the forwarded email is opened."
              },
              "include_history": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100,
                "default": 20,
                "description": "Earlier messages of the conversation quoted under a forwarded message (the [HISTORY] block), at most 100. 0 = none and no Show All History button. 20 is what every number had before this setting existed. The dashboard offers 0, 10, 20, 50 and 100 (Chat History Summary)."
              },
              "history_images": {
                "type": "string",
                "enum": [
                  "name",
                  "link",
                  "thumbnail"
                ],
                "default": "link",
                "description": "What goes under a photo the contact sent in that history. The photo's own line ([IMAGE, file name, type, size]) is always shown. name: nothing more. link: a line with the link to the full-size photo. thumbnail: a small picture linked to the full-size photo; it is loaded from that link, not attached to the email. A photo app2email has no copy of gets nothing more. The dashboard calls it Images in Chat History Summary."
              }
            }
          },
          "caps": {
            "type": "object",
            "properties": {
              "monthly_messages": {
                "type": "integer",
                "minimum": 0,
                "default": 0,
                "description": "Your own monthly cap on outgoing messages (WhatsApp + email). 0 = the plan limit only."
              }
            }
          },
          "compliance": {
            "type": "object",
            "properties": {
              "adm_disclosure": {
                "type": "string",
                "maxLength": 500,
                "description": "Appended once to automated replies (auto reply, agents), eg 'This reply was generated automatically.'"
              },
              "stop_keywords_extra": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Your own opt-out words besides the built-in ones (STOP and its translations)."
              }
            }
          },
          "a2a": {
            "type": "object",
            "properties": {
              "respect_owner": {
                "type": "boolean",
                "default": true,
                "description": "Skip the A2A / OpenClaw agent when a conversation's owner is human or paused."
              }
            }
          },
          "messages": {
            "type": "object",
            "properties": {
              "marketing_route": {
                "type": "string",
                "enum": [
                  "auto",
                  "cloud_api",
                  "mm_api"
                ],
                "default": "auto",
                "description": "Where MARKETING templates go: auto = the Marketing Messages API once WhatsApp says the account is onboarded, else the Cloud API; cloud_api; mm_api."
              }
            }
          }
        }
      },
      "NumberSettingsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "settings": {
            "$ref": "#/components/schemas/NumberSettings"
          },
          "keys": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "Consent": {
        "type": "object",
        "description": "Consent to marketing messages, with the evidence the Spam Act 2003 expects you to keep.",
        "properties": {
          "marketing": {
            "type": "boolean",
            "description": "true: consented. false: withdrawn (add them to the Do Not Call list too)."
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "description": "When. Now when left out."
          },
          "source": {
            "type": "string",
            "maxLength": 100,
            "example": "web form"
          },
          "text": {
            "type": "string",
            "maxLength": 1000,
            "example": "Yes, send me offers on WhatsApp",
            "description": "The wording the contact agreed to."
          },
          "evidence": {
            "type": "string",
            "maxLength": 500,
            "example": "https://example.com/forms/123",
            "description": "A link, file name, IP address or message id that proves it."
          }
        }
      },
      "ContactInput": {
        "type": "object",
        "description": "A contact to make or change. 'phone' (or 'identity': a number or a business-scoped user id) says which; the other fields given replace, the ones left out stay.",
        "properties": {
          "phone": {
            "type": "string",
            "example": "61412345678"
          },
          "identity": {
            "type": "string",
            "example": "61.AbC123xyz",
            "description": "Instead of phone: a number or a business-scoped user id."
          },
          "name": {
            "type": "string",
            "maxLength": 200,
            "example": "John Smith"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 40
            },
            "example": [
              "vip",
              "newsletter"
            ],
            "description": "Up to 50. A comma separated string works too."
          },
          "custom_fields": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "example": {
              "order_id": "1234",
              "first_name": "John"
            },
            "description": "Up to 50 text values (names: letters, digits, underscores). Used as named template values in segment sends."
          },
          "source": {
            "type": "string",
            "maxLength": 50,
            "example": "crm"
          },
          "consent": {
            "$ref": "#/components/schemas/Consent"
          }
        }
      },
      "Contact": {
        "type": "object",
        "properties": {
          "identity": {
            "type": "string",
            "example": "61412345678"
          },
          "identity_type": {
            "type": "string",
            "enum": [
              "phone",
              "bsuid"
            ]
          },
          "phone": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "custom_fields": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "source": {
            "type": "string"
          },
          "consent": {
            "type": "object",
            "properties": {
              "marketing": {
                "type": "boolean"
              },
              "at": {
                "type": "string",
                "format": "date-time"
              },
              "source": {
                "type": "string"
              },
              "text": {
                "type": "string"
              },
              "evidence": {
                "type": "string"
              },
              "recorded": {
                "type": "boolean",
                "description": "true when any consent record exists."
              }
            }
          },
          "last_inbound_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_outbound_at": {
            "type": "string",
            "format": "date-time"
          },
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "updated": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ContactsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "contacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Contact"
            }
          },
          "next_cursor": {
            "type": "string",
            "description": "Pass it as cursor for the next page. Left out on the last page."
          },
          "count": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          }
        }
      },
      "ContactResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "contact": {
            "$ref": "#/components/schemas/Contact"
          },
          "created": {
            "type": "boolean"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "ContactsUpsertRequest": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ContactInput"
          },
          {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactInput"
            },
            "maxItems": 1000
          }
        ]
      },
      "ContactsUpsertResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "saved": {
            "type": "integer"
          },
          "created": {
            "type": "integer"
          },
          "updated": {
            "type": "integer"
          },
          "contacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Contact"
            },
            "description": "The first 100 as saved."
          }
        }
      },
      "ContactsImportResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "rows": {
            "type": "integer"
          },
          "saved": {
            "type": "integer"
          },
          "created": {
            "type": "integer"
          },
          "updated": {
            "type": "integer"
          },
          "skipped": {
            "type": "integer"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "row": {
                  "type": "integer"
                },
                "problem": {
                  "type": "string"
                }
              }
            },
            "description": "The first 50 rows with a problem."
          },
          "note": {
            "type": "string"
          }
        }
      },
      "ContactDeleteResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "deleted": {
            "type": "string"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "SegmentFilter": {
        "type": "object",
        "description": "Which contacts a segment holds. Every condition given must hold.",
        "properties": {
          "tags_any": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "At least one of these tags."
          },
          "tags_all": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "All of these tags."
          },
          "consent_marketing": {
            "type": "boolean",
            "description": "true: only contacts with marketing consent. false: only without."
          },
          "last_inbound_days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 3650,
            "description": "Wrote to the number in the last N days."
          },
          "search": {
            "type": "string",
            "maxLength": 100,
            "description": "Part of the name or number."
          }
        }
      },
      "SegmentRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100,
            "example": "VIP, consented"
          },
          "filter": {
            "$ref": "#/components/schemas/SegmentFilter"
          }
        }
      },
      "Segment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "example": 12
          },
          "name": {
            "type": "string"
          },
          "filter": {
            "$ref": "#/components/schemas/SegmentFilter"
          },
          "contacts": {
            "type": "integer",
            "description": "How many contacts match now (in answers that counted them)."
          },
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "updated": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SegmentsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "segments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Segment"
            }
          },
          "count": {
            "type": "integer"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "SegmentResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "segment": {
            "$ref": "#/components/schemas/Segment"
          }
        }
      },
      "SegmentContactsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "segment": {
            "$ref": "#/components/schemas/Segment"
          },
          "contacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Contact"
            }
          },
          "next_cursor": {
            "type": "string"
          },
          "count": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          }
        }
      },
      "SegmentDeleteResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "deleted": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "MetaPricingCounts": {
        "type": "object",
        "properties": {
          "service_free_used": {
            "type": "integer"
          },
          "service_billable": {
            "type": "integer"
          },
          "utility": {
            "type": "integer"
          },
          "marketing": {
            "type": "integer"
          },
          "authentication": {
            "type": "integer"
          },
          "free_entry_point": {
            "type": "integer"
          },
          "unknown": {
            "type": "integer",
            "description": "No pricing information (yet)."
          },
          "total": {
            "type": "integer"
          },
          "estimated_cost_usd": {
            "type": "number"
          }
        }
      },
      "MetaPricing": {
        "type": "object",
        "description": "What WhatsApp (Meta) charges for the billing month's messages, from the pricing object of its status webhooks. Indicative: Meta bills you directly.",
        "properties": {
          "billing_period": {
            "type": "object",
            "properties": {
              "start": {
                "type": "string",
                "format": "date-time"
              },
              "end": {
                "type": "string",
                "format": "date-time"
              }
            }
          },
          "counts": {
            "$ref": "#/components/schemas/MetaPricingCounts"
          },
          "free_service_messages": {
            "type": "object",
            "properties": {
              "allowance_per_month": {
                "type": "integer",
                "example": 1000
              },
              "used": {
                "type": "integer"
              },
              "left": {
                "type": "integer"
              },
              "note": {
                "type": "string"
              }
            }
          },
          "estimated_cost": {
            "type": "object",
            "properties": {
              "currency": {
                "type": "string",
                "example": "USD"
              },
              "amount": {
                "type": "number"
              },
              "rate_region": {
                "type": "string"
              },
              "rate_region_code": {
                "type": "string"
              },
              "rates_per_message": {
                "type": "object",
                "additionalProperties": {
                  "type": "number"
                }
              },
              "rates_last_checked": {
                "type": "string"
              },
              "note": {
                "type": "string"
              }
            }
          },
          "days": {
            "type": "array",
            "description": "GET /usage/meta only: per day.",
            "items": {
              "type": "object",
              "properties": {
                "date": {
                  "type": "string",
                  "example": "2026-11-02"
                },
                "counts": {
                  "$ref": "#/components/schemas/MetaPricingCounts"
                }
              }
            }
          },
          "note": {
            "type": "string"
          }
        }
      },
      "UsageMetaResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "number": {
            "type": "string"
          },
          "meta_pricing": {
            "$ref": "#/components/schemas/MetaPricing"
          }
        }
      },
      "Approval": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "apr_a1b2c3d4e5f6g7h8"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "approved",
              "rejected",
              "expired"
            ]
          },
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "expires": {
            "type": "string",
            "format": "date-time",
            "description": "48 hours after it was held."
          },
          "key": {
            "type": "string",
            "description": "The key that made the request."
          },
          "request_id": {
            "type": "string"
          },
          "recipients": {
            "type": "integer"
          },
          "summary": {
            "type": "object",
            "additionalProperties": true,
            "description": "What was held: recipients, template, text, media, broadcast_name, scheduled_for."
          },
          "resolved_at": {
            "type": "string",
            "format": "date-time"
          },
          "resolved_by": {
            "type": "string",
            "example": "dashboard"
          },
          "result": {
            "type": "object",
            "additionalProperties": true,
            "description": "After approval: status, accepted, failed, broadcast_code, error."
          },
          "url": {
            "type": "string"
          },
          "approve_url": {
            "type": "string"
          }
        }
      },
      "ApprovalsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "approvals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Approval"
            }
          },
          "count": {
            "type": "integer"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "ApprovalResolveResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "approval": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "approved",
                  "rejected"
                ]
              },
              "resolved_by": {
                "type": "string"
              },
              "resolved_at": {
                "type": "string",
                "format": "date-time"
              },
              "result": {
                "type": "object",
                "additionalProperties": true
              }
            }
          },
          "send": {
            "$ref": "#/components/schemas/SendMessageResponse",
            "description": "Approved only: the answer the original request would have got."
          },
          "note": {
            "type": "string"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": false
          },
          "request_id": {
            "type": "string",
            "example": "kxrkf",
            "description": "Quote this when contacting support."
          },
          "error": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "code",
          "message",
          "how_to_fix"
        ],
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "account_deactivated",
              "account_not_confirmed",
              "account_service_error",
              "account_service_unavailable",
              "api_key_expired",
              "api_key_number_mismatch",
              "api_key_revoked",
              "approval_already_resolved",
              "approval_body_too_large",
              "approval_expired",
              "approval_not_found",
              "background_start_failed",
              "block_list_busy",
              "block_list_full",
              "block_not_found",
              "block_users_error",
              "block_users_failed",
              "booking_cancelled",
              "booking_not_enabled",
              "booking_not_found",
              "booking_slot_taken",
              "broadcast_cancelled",
              "broadcast_not_cancellable",
              "broadcast_not_found",
              "bsuid_not_supported",
              "call_permission_required",
              "caption_not_supported",
              "caption_too_long",
              "catcher_not_found",
              "client_exists",
              "client_not_editable",
              "client_not_found",
              "contact_book_error",
              "contact_not_found",
              "conversation_not_found",
              "daily_cap_reached",
              "dataset_not_found",
              "delivery_in_progress",
              "delivery_not_found",
              "display_name_not_approved",
              "duplicate_recipients",
              "email_not_sent",
              "encryption_key_managed",
              "flow_blocked_by_integrity",
              "flow_cannot_publish",
              "flow_json_download_failed",
              "flow_json_not_found",
              "flow_json_too_large",
              "flow_name_taken",
              "flow_not_deletable",
              "flow_not_editable",
              "flow_not_found",
              "flow_not_published",
              "flow_rejected",
              "free_form_single_recipient",
              "hold_expired",
              "hold_not_found",
              "idempotency_key_reused",
              "idempotency_request_in_progress",
              "idempotency_request_interrupted",
              "insufficient_scope",
              "internal_error",
              "invalid_analytics_query",
              "invalid_api_key",
              "invalid_auth_template",
              "invalid_authorization_header",
              "invalid_base64",
              "invalid_block",
              "invalid_booking",
              "invalid_bsuid",
              "invalid_call_request",
              "invalid_call_settings",
              "invalid_callback_data",
              "invalid_catalog_id",
              "invalid_client_request",
              "invalid_compare_days",
              "invalid_compliance_info",
              "invalid_components",
              "invalid_contact_email",
              "invalid_contacts",
              "invalid_contacts_message",
              "invalid_conversation_starters",
              "invalid_conversion_events",
              "invalid_coupon",
              "invalid_csv",
              "invalid_cursor",
              "invalid_direction",
              "invalid_display_name",
              "invalid_email",
              "invalid_events",
              "invalid_flow_categories",
              "invalid_flow_field",
              "invalid_flow_id",
              "invalid_flow_json",
              "invalid_flow_name",
              "invalid_idempotency_key",
              "invalid_identity_key_hash",
              "invalid_insights_request",
              "invalid_interactive",
              "invalid_json",
              "invalid_keep_old_for_hours",
              "invalid_key_request",
              "invalid_library_filter",
              "invalid_limit",
              "invalid_link",
              "invalid_location",
              "invalid_marketing_api",
              "invalid_media_id",
              "invalid_media_link",
              "invalid_media_type",
              "invalid_months",
              "invalid_note",
              "invalid_number",
              "invalid_number_in_url",
              "invalid_numbers",
              "invalid_oba_request",
              "invalid_onboarding_request",
              "invalid_optimization_spec",
              "invalid_owner",
              "invalid_partner_settings",
              "invalid_payment",
              "invalid_phone",
              "invalid_plan",
              "invalid_poll",
              "invalid_profile",
              "invalid_public_key",
              "invalid_qr_code",
              "invalid_range",
              "invalid_reaction",
              "invalid_recipients",
              "invalid_redirect_url",
              "invalid_reply_to",
              "invalid_segment",
              "invalid_send_at",
              "invalid_service",
              "invalid_setting",
              "invalid_slug",
              "invalid_start",
              "invalid_status",
              "invalid_template_category",
              "invalid_template_components",
              "invalid_template_field",
              "invalid_template_ids",
              "invalid_template_language",
              "invalid_template_name",
              "invalid_template_preview",
              "invalid_test_event",
              "invalid_text",
              "invalid_time",
              "invalid_to",
              "invalid_username",
              "invalid_users",
              "invalid_webhook_format",
              "invalid_webhook_headers",
              "invalid_webhook_secret",
              "invalid_webhook_url",
              "ip_not_allowed",
              "key_limit_reached",
              "key_limits_unavailable",
              "key_not_found",
              "link_not_found",
              "link_not_usable",
              "marketing_disabled_on_cloud_api",
              "marketing_per_user_limit",
              "marketing_status_lookup_failed",
              "media_delete_failed",
              "media_download_error",
              "media_download_failed",
              "media_lookup_failed",
              "media_lookups_paused",
              "media_not_found",
              "media_too_large",
              "media_type_not_allowed",
              "media_upload_error",
              "media_upload_failed",
              "message_not_found",
              "message_too_old",
              "messaging_limit_restricted",
              "missing_api_key",
              "missing_file",
              "missing_interactive",
              "missing_media",
              "missing_message_id",
              "missing_numbers",
              "missing_template_language",
              "missing_template_name",
              "missing_text",
              "missing_url",
              "monthly_cap_reached",
              "monthly_limit_reached",
              "note_not_found",
              "nothing_to_change",
              "number_already_verified",
              "number_not_found",
              "number_not_live",
              "optin_not_found",
              "outside_24h_window",
              "package_not_found",
              "parameter_value_invalid",
              "partner_closed",
              "partner_service_unavailable",
              "partner_suspended",
              "payment_link_failed",
              "payment_not_found",
              "payment_provider_error",
              "payments_not_connected",
              "plan_already_active",
              "plan_not_allowed",
              "plan_not_available",
              "poll_not_found",
              "profile_photo_failed",
              "qr_code_not_found",
              "range_too_large",
              "rate_limited",
              "reaction_too_old",
              "recipient_identity_changed",
              "recipient_in_experiment",
              "recipient_is_sender",
              "recipient_not_allowed",
              "recipient_not_opted_in",
              "recipient_opted_out",
              "recipient_stopped_marketing",
              "recipient_unreachable",
              "refund_not_possible",
              "register_limit_reached",
              "request_log_unavailable",
              "request_not_found",
              "request_too_large",
              "required_parameter_missing",
              "route_not_found",
              "sandbox_key",
              "schedule_failed",
              "segment_and_recipients",
              "segment_empty",
              "segment_exists",
              "segment_not_found",
              "send_at_in_past",
              "send_at_too_far",
              "service_not_live",
              "slug_taken",
              "template_already_exists",
              "template_archive_failed",
              "template_category_locked",
              "template_compare_unavailable",
              "template_delete_failed",
              "template_disabled",
              "template_format_policy",
              "template_insights_confirm_required",
              "template_insights_not_enabled",
              "template_insights_unavailable",
              "template_language_not_found",
              "template_language_required",
              "template_limit_reached",
              "template_lookup_failed",
              "template_name_reserved",
              "template_not_approved",
              "template_not_editable",
              "template_not_found",
              "template_not_marketing",
              "template_parameter_count_mismatch",
              "template_parameter_format_mismatch",
              "template_parameter_invalid",
              "template_parameters_invalid",
              "template_paused",
              "template_rejected",
              "template_sample_media_failed",
              "template_text_too_long",
              "template_unarchive_failed",
              "test_event_too_large",
              "text_too_long",
              "to_and_recipients",
              "too_late",
              "too_many_catchers",
              "too_many_invites",
              "too_many_messages_to_recipient",
              "too_many_numbers",
              "too_many_recipients",
              "too_many_segments",
              "too_many_signups",
              "too_many_templates",
              "too_many_tests",
              "too_many_webhooks",
              "unsupported_content_type",
              "unsupported_message_type",
              "username_account_not_linked",
              "username_change_limit",
              "username_not_available",
              "username_not_eligible",
              "username_taken",
              "voice_needs_ogg_opus",
              "webhook_not_found",
              "webhook_url_in_use",
              "whatsapp_account_locked",
              "whatsapp_account_restricted",
              "whatsapp_connection_problem",
              "whatsapp_error",
              "whatsapp_maintenance",
              "whatsapp_number_not_registered",
              "whatsapp_parameter_error",
              "whatsapp_payment_issue",
              "whatsapp_permission_missing",
              "whatsapp_rate_limit",
              "whatsapp_unavailable"
            ],
            "description": "Stable error code, safe to use in your own logic."
          },
          "message": {
            "type": "string",
            "description": "What is wrong, in plain words."
          },
          "how_to_fix": {
            "type": "string",
            "description": "What to change to make the request work."
          },
          "documentation_url": {
            "type": "string",
            "example": "https://www.app2email.com/docs/api/errors#template_not_found",
            "description": "Where this error is explained."
          },
          "is_retriable": {
            "type": "boolean",
            "description": "true: the same request can work later without a change (limits, caps, trouble on our side or WhatsApp's, a request with the same Idempotency-Key still running)."
          },
          "retry_after_seconds": {
            "type": "integer",
            "description": "How long to wait before trying again, when known (also the Retry-After header)."
          },
          "details": {
            "type": "object",
            "additionalProperties": true,
            "description": "Extra information, eg the problems found, available templates or languages."
          },
          "example_request": {
            "$ref": "#/components/schemas/SendTemplateRequest"
          },
          "whatsapp_error": {
            "$ref": "#/components/schemas/WhatsAppError"
          }
        }
      },
      "WhatsAppError": {
        "type": "object",
        "description": "WhatsApp's (Meta's) own error, when the error came from WhatsApp.",
        "properties": {
          "code": {
            "type": "integer",
            "example": 132000
          },
          "message": {
            "type": "string"
          },
          "details": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "fbtrace_id": {
            "type": "string"
          }
        }
      },
      "AccountNumber": {
        "type": "object",
        "properties": {
          "number": {
            "type": "string",
            "example": "4976659348270"
          },
          "display_number": {
            "type": "string",
            "nullable": true,
            "example": "+49 7665 9348270"
          },
          "name": {
            "type": "string",
            "nullable": true,
            "description": "The WhatsApp display name."
          },
          "status": {
            "type": "string",
            "enum": [
              "live",
              "pending_payment",
              "not_live"
            ],
            "description": "live: LIVE with a plan that includes the API. pending_payment: no such plan yet. not_live: paused, expired or still being connected."
          },
          "service_status": {
            "type": "string",
            "nullable": true,
            "example": "LIVE"
          },
          "plan": {
            "type": "string",
            "example": "standard_5000"
          },
          "plan_label": {
            "type": "string",
            "example": "Standard 5,000"
          },
          "api_allowed": {
            "type": "boolean"
          },
          "billing_period_end": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "renewal_enabled": {
            "type": "boolean"
          }
        }
      },
      "AccountSignupRequest": {
        "type": "object",
        "required": [
          "contact_email"
        ],
        "properties": {
          "contact_email": {
            "type": "string",
            "format": "email",
            "maxLength": 254,
            "description": "The person's e-mail address. They get a link to confirm."
          },
          "business_name": {
            "type": "string",
            "maxLength": 100,
            "description": "Optional: the business the account is for."
          },
          "plan": {
            "type": "string",
            "description": "Optional: a plan id from GET /v1/account/plans the person means to choose."
          }
        }
      },
      "AccountSignupResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "signup_id": {
            "type": "string",
            "example": "su_Q7pX2mLw9Rk4Tz1b"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending_email"
            ]
          },
          "management_key": {
            "type": "string",
            "description": "An account key with every account permission. Shown once. Until the person confirms, it works only for GET /v1/account; it expires with the sign-up (48 h), and stops working when a newer create_account for the same address replaces the sign-up."
          },
          "onboarding_link": {
            "type": "string",
            "format": "uri",
            "description": "Give it to the person: it says what to do next. The confirmation itself is the e-mailed link."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "next_steps": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "What to do next, in plain words."
          },
          "message": {
            "type": "string"
          }
        }
      },
      "AccountStatusResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "account": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "pending_email",
                  "pending_whatsapp",
                  "pending_payment",
                  "live"
                ],
                "description": "pending_email: the person has not confirmed. pending_whatsapp: no WhatsApp number yet, or a number with a plan is not LIVE (paused, being connected). pending_payment: no number has a plan with the API. live: at least one number is live."
              },
              "email": {
                "type": "string",
                "nullable": true,
                "description": "Masked until the person confirms."
              },
              "name": {
                "type": "string",
                "nullable": true
              },
              "numbers": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/AccountNumber"
                }
              },
              "signup_id": {
                "type": "string",
                "nullable": true
              },
              "signup_expires": {
                "type": "string",
                "format": "date-time",
                "nullable": true
              }
            }
          },
          "key": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "scopes": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "next_steps": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "What to do next, in plain words."
          }
        }
      },
      "AccountNumbersResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "numbers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountNumber"
            }
          },
          "count": {
            "type": "integer"
          }
        }
      },
      "AccountNumberResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "number": {
            "$ref": "#/components/schemas/AccountNumber"
          }
        }
      },
      "AccountNumberKey": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "prefix": {
            "type": "string",
            "example": "a2e_"
          },
          "first4": {
            "type": "string"
          },
          "last4": {
            "type": "string"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "ip_allow": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "last_used": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "expires": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "sandbox": {
            "type": "boolean"
          },
          "daily_cap": {
            "type": "integer"
          },
          "approval_above": {
            "type": "integer"
          }
        }
      },
      "AccountNumberKeysResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "number": {
            "type": "string"
          },
          "keys": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountNumberKey"
            }
          },
          "count": {
            "type": "integer"
          },
          "default_key": {
            "type": "object",
            "description": "The number's Default key (made on the dashboard): whether there is one.",
            "properties": {
              "exists": {
                "type": "boolean"
              },
              "first4": {
                "type": "string",
                "nullable": true
              },
              "last4": {
                "type": "string",
                "nullable": true
              }
            }
          }
        }
      },
      "AccountNumberKeyRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 60,
            "default": "Agent"
          },
          "scopes": {
            "description": "full (default), send, read, or a list of number permissions (as on the dashboard), or [\"*\"].",
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "full",
                  "send",
                  "read"
                ]
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "sandbox": {
            "type": "boolean",
            "default": true,
            "description": "true (default): sends are simulated, nothing goes to WhatsApp. false: a live key."
          },
          "expires_days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 365
          },
          "ip_allow": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 10,
            "description": "IPs or IPv4 ranges that may use the key."
          },
          "daily_cap": {
            "type": "integer",
            "minimum": 0,
            "description": "Most messages per UTC day; 0 = no cap."
          },
          "approval_above": {
            "type": "integer",
            "minimum": 0,
            "description": "A send to more recipients waits for approval; 0 = never."
          }
        }
      },
      "AccountNumberKeyCreated": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "api_key": {
            "type": "string",
            "description": "The key. Shown once."
          },
          "key": {
            "$ref": "#/components/schemas/AccountNumberKey"
          },
          "number": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "AccountRevokeResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "revoked": {
            "type": "boolean"
          },
          "key_id": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "number": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "AccountPlan": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "standard_5000"
          },
          "type": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "messages_per_month": {
            "type": "integer"
          },
          "price_monthly": {
            "type": "number"
          },
          "price_yearly": {
            "type": "number"
          },
          "api": {
            "type": "boolean",
            "description": "The plan includes the API and MCP."
          },
          "email_bridge": {
            "type": "boolean"
          },
          "includes": {
            "type": "string"
          }
        }
      },
      "AccountPlansResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "yearly_discount": {
            "type": "number"
          },
          "plans": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountPlan"
            }
          },
          "note": {
            "type": "string"
          }
        }
      },
      "AccountCheckoutRequest": {
        "type": "object",
        "required": [
          "plan"
        ],
        "properties": {
          "plan": {
            "type": "string",
            "description": "A plan id from GET /v1/account/plans."
          },
          "yearly": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "AccountCheckoutResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "number": {
            "type": "string"
          },
          "plan": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "label": {
                "type": "string"
              },
              "messages_per_month": {
                "type": "integer"
              },
              "price": {
                "type": "number"
              },
              "currency": {
                "type": "string"
              },
              "interval": {
                "type": "string",
                "enum": [
                  "month",
                  "year"
                ]
              }
            }
          },
          "checkout_url": {
            "type": "string",
            "format": "uri",
            "description": "Stripe Checkout. Give it to the person."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "test_mode": {
            "type": "boolean",
            "description": "true on app2email's test site (Stripe test mode)."
          },
          "message": {
            "type": "string"
          }
        }
      },
      "AccountUsageResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "numbers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "number": {
                  "type": "string"
                },
                "plan": {
                  "type": "string"
                },
                "service_status": {
                  "type": "string",
                  "nullable": true
                },
                "billing_period": {
                  "type": "object",
                  "properties": {
                    "start": {
                      "type": "string",
                      "nullable": true
                    },
                    "end": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                },
                "plan_messages": {
                  "type": "object",
                  "properties": {
                    "whatsapp_sent": {
                      "type": "integer"
                    },
                    "emails_sent": {
                      "type": "integer"
                    },
                    "total_sent": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "left": {
                      "type": "integer"
                    }
                  }
                },
                "messages_received_this_billing_month": {
                  "type": "integer"
                }
              }
            }
          },
          "totals": {
            "type": "object",
            "properties": {
              "total_sent": {
                "type": "integer"
              },
              "whatsapp_sent": {
                "type": "integer"
              },
              "emails_sent": {
                "type": "integer"
              }
            }
          }
        }
      },
      "AccountKey": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "ak_Hc4dR8sLm2Qv9Xw1"
          },
          "name": {
            "type": "string"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "prefix": {
            "type": "string",
            "example": "a2e_acct_"
          },
          "first4": {
            "type": "string"
          },
          "last4": {
            "type": "string"
          },
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "type": "string",
            "enum": [
              "dashboard",
              "api",
              "create_account"
            ]
          },
          "last_used": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "expires": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "management_key": {
            "type": "boolean",
            "description": "Made by create_account (an agent's sign-up)."
          }
        }
      },
      "AccountKeysResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "keys": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountKey"
            }
          },
          "count": {
            "type": "integer"
          }
        }
      },
      "AccountKeyRequest": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 60
          },
          "scopes": {
            "description": "full (default), read, or a list of account permissions. Never more than the calling key has.",
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "full",
                  "read"
                ]
              },
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "account:read",
                    "account:manage",
                    "keys:manage",
                    "billing:read",
                    "webhooks:manage"
                  ]
                }
              }
            ]
          },
          "expires_days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 365
          }
        }
      },
      "AccountKeyCreated": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "account_key": {
            "type": "string",
            "description": "The key. Shown once."
          },
          "key": {
            "$ref": "#/components/schemas/AccountKey"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "PricingDataPoint": {
        "type": "object",
        "properties": {
          "start": {
            "type": "string",
            "format": "date-time"
          },
          "end": {
            "type": "string",
            "format": "date-time"
          },
          "pricing_category": {
            "type": "string",
            "description": "MARKETING, UTILITY, AUTHENTICATION, AUTHENTICATION_INTERNATIONAL, MARKETING_LITE, SERVICE, REFERRAL_CONVERSION."
          },
          "pricing_type": {
            "type": "string",
            "description": "REGULAR, FREE_CUSTOMER_SERVICE, FREE_ENTRY_POINT."
          },
          "country": {
            "type": "string"
          },
          "tier": {
            "type": "string",
            "description": "Volume tier, eg 0:750000 (with dimensions tier)."
          },
          "phone_number": {
            "type": "string"
          },
          "volume": {
            "type": "integer"
          },
          "cost": {
            "type": "number",
            "description": "In the WhatsApp Business Account's currency. Not given when the account uses a partner's credit line."
          }
        },
        "additionalProperties": true
      },
      "PricingAnalyticsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "request_id": {
            "type": "string",
            "example": "a1n2l"
          },
          "since": {
            "type": "string",
            "format": "date-time"
          },
          "until": {
            "type": "string",
            "format": "date-time"
          },
          "granularity": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "data_points": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PricingDataPoint"
            }
          },
          "totals": {
            "type": "object",
            "properties": {
              "volume": {
                "type": "number"
              },
              "cost": {
                "type": "number"
              }
            }
          }
        },
        "required": [
          "success",
          "request_id",
          "data_points"
        ]
      },
      "MessageDataPoint": {
        "type": "object",
        "properties": {
          "start": {
            "type": "string",
            "format": "date-time"
          },
          "end": {
            "type": "string",
            "format": "date-time"
          },
          "sent": {
            "type": "integer"
          },
          "delivered": {
            "type": "integer"
          }
        },
        "additionalProperties": true
      },
      "MessageAnalyticsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "request_id": {
            "type": "string",
            "example": "a1n2l"
          },
          "since": {
            "type": "string",
            "format": "date-time"
          },
          "until": {
            "type": "string",
            "format": "date-time"
          },
          "granularity": {
            "type": "string"
          },
          "data_points": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MessageDataPoint"
            }
          },
          "totals": {
            "type": "object",
            "properties": {
              "sent": {
                "type": "integer"
              },
              "delivered": {
                "type": "integer"
              }
            }
          }
        },
        "required": [
          "success",
          "request_id",
          "data_points"
        ]
      },
      "AccountActivity": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "event_type": {
            "type": "string",
            "description": "eg PHONE_NUMBER_DEREGISTERED_FROM_CLOUD_API, TWO_STEP_VERIFICATION_PIN_CHANGED, PARTNER_REMOVED, BILLING_DELETED."
          },
          "category": {
            "type": "string",
            "description": "ACCOUNT, APP, BILLING, BUSINESS_PROFILE, MESSAGE_TEMPLATE, PAYMENT_CONFIGURATION, PHONE_NUMBER, USER ..."
          },
          "actor_id": {
            "type": "string"
          },
          "actor_business_id": {
            "type": "string"
          },
          "time": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AccountActivityResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "request_id": {
            "type": "string",
            "example": "a1n2l"
          },
          "activities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountActivity"
            }
          },
          "count": {
            "type": "integer"
          },
          "next_cursor": {
            "type": "string"
          }
        },
        "required": [
          "success",
          "request_id",
          "activities"
        ]
      },
      "ConversionsDatasetRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 200
          }
        }
      },
      "ConversionsDatasetResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "request_id": {
            "type": "string",
            "example": "a1n2l"
          },
          "dataset": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            }
          }
        },
        "required": [
          "success",
          "request_id",
          "dataset"
        ]
      },
      "ConversionEvent": {
        "type": "object",
        "properties": {
          "event_name": {
            "type": "string",
            "description": "eg Purchase, LeadSubmitted, AddToCart."
          },
          "event_time": {
            "type": "integer",
            "description": "Unix seconds, within the last 7 days. Default: now."
          },
          "action_source": {
            "type": "string",
            "default": "business_messaging"
          },
          "messaging_channel": {
            "type": "string",
            "default": "whatsapp"
          },
          "user_data": {
            "type": "object",
            "properties": {
              "ctwa_clid": {
                "type": "string",
                "description": "The click id of the click-to-WhatsApp ad (referral.ctwa_clid of the contact's first message)."
              },
              "whatsapp_business_account_id": {
                "type": "string",
                "description": "Default: this number's WABA."
              }
            },
            "additionalProperties": true
          },
          "custom_data": {
            "type": "object",
            "properties": {
              "currency": {
                "type": "string"
              },
              "value": {
                "type": "number"
              }
            },
            "additionalProperties": true
          }
        },
        "required": [
          "event_name"
        ],
        "additionalProperties": true
      },
      "ConversionEventsRequest": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "minItems": 1,
            "maxItems": 1000,
            "items": {
              "$ref": "#/components/schemas/ConversionEvent"
            }
          },
          "test_event_code": {
            "type": "string",
            "description": "From Events Manager: the events show under Test events and are not used for ads."
          },
          "partner_agent": {
            "type": "string"
          }
        },
        "required": [
          "data"
        ]
      },
      "ConversionEventsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "request_id": {
            "type": "string",
            "example": "a1n2l"
          },
          "dataset_id": {
            "type": "string"
          },
          "events_received": {
            "type": "integer"
          },
          "messages": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "fbtrace_id": {
            "type": "string"
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "DatasetQualityResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "request_id": {
            "type": "string",
            "example": "a1n2l"
          },
          "dataset_id": {
            "type": "string"
          },
          "quality": {
            "type": "object",
            "properties": {
              "web": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "event_name": {
                      "type": "string"
                    },
                    "event_match_quality": {
                      "type": "object",
                      "properties": {
                        "composite_score": {
                          "type": "number"
                        },
                        "match_key_feedback": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "identifier": {
                                "type": "string"
                              },
                              "coverage": {
                                "type": "object",
                                "properties": {
                                  "percentage": {
                                    "type": "number"
                                  }
                                },
                                "additionalProperties": true
                              }
                            },
                            "additionalProperties": true
                          }
                        }
                      },
                      "additionalProperties": true
                    },
                    "event_coverage": {
                      "type": "object",
                      "properties": {},
                      "additionalProperties": true
                    },
                    "dedupe_key_feedback": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {},
                        "additionalProperties": true
                      }
                    },
                    "data_freshness": {
                      "type": "object",
                      "properties": {},
                      "additionalProperties": true
                    },
                    "acr": {
                      "type": "object",
                      "properties": {},
                      "additionalProperties": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            },
            "description": "Meta's dataset_quality answer as it came (the fields asked for).",
            "additionalProperties": true
          }
        },
        "required": [
          "success",
          "request_id",
          "dataset_id",
          "quality"
        ]
      },
      "BookingService": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "haircut"
          },
          "name": {
            "type": "string",
            "example": "Haircut"
          },
          "duration_min": {
            "type": "integer",
            "example": 30
          }
        }
      },
      "Booking": {
        "type": "object",
        "description": "An appointment. The same object is the data of the booking.created, booking.cancelled, booking.rescheduled and booking.rated webhook events.",
        "properties": {
          "id": {
            "type": "integer",
            "example": 42
          },
          "reference": {
            "type": "string",
            "example": "BK-7Q3M2A",
            "description": "The short code the customer sees. GET /bookings/{id} takes it too."
          },
          "status": {
            "type": "string",
            "enum": [
              "confirmed",
              "cancelled",
              "completed",
              "no_show"
            ]
          },
          "contact": {
            "type": "string",
            "example": "61412345678",
            "description": "The customer's number (digits, country code first) or their business-scoped user id."
          },
          "contact_name": {
            "type": "string",
            "example": "John Smith"
          },
          "contact_email": {
            "type": "string",
            "example": "john@example.com"
          },
          "service": {
            "$ref": "#/components/schemas/BookingService"
          },
          "start": {
            "type": "string",
            "format": "date-time",
            "description": "UTC."
          },
          "end": {
            "type": "string",
            "format": "date-time",
            "description": "UTC."
          },
          "timezone": {
            "type": "string",
            "example": "Australia/Sydney",
            "description": "The business time zone the slot was chosen in."
          },
          "source": {
            "type": "string",
            "enum": [
              "whatsapp_flow",
              "dashboard",
              "api",
              "web"
            ],
            "description": "Booked by the customer in WhatsApp, on the dashboard (or in the calendar app), through this API, or by the customer on the online booking page (web)."
          },
          "calendar": {
            "type": "object",
            "properties": {
              "provider": {
                "type": "string",
                "enum": [
                  "builtin",
                  "google",
                  "microsoft",
                  "caldav",
                  "ics"
                ]
              },
              "event_id": {
                "type": "string"
              },
              "url": {
                "type": "string"
              },
              "error": {
                "type": "string",
                "description": "The calendar write failed; the booking still stands."
              }
            }
          },
          "answers": {
            "type": "object",
            "additionalProperties": true,
            "description": "Every other field the customer filled in the Flow."
          },
          "notes": {
            "type": "string"
          },
          "provider": {
            "type": "object",
            "description": "The staff member, when the business has them. Left out otherwise.",
            "properties": {
              "id": {
                "type": "string",
                "example": "maria"
              },
              "name": {
                "type": "string",
                "example": "Maria"
              }
            }
          },
          "rating": {
            "type": "integer",
            "enum": [
              1,
              3,
              5
            ],
            "description": "The customer's rating from the follow-up message (5 loved it, 3 OK, 1 not great). Left out until given."
          },
          "payment_status": {
            "type": "string",
            "enum": [
              "link_sent",
              "paid",
              "waived"
            ],
            "description": "The business's own note on the payment. Left out when none."
          },
          "credits_used": {
            "type": "integer",
            "description": "Always 0 (memberships were removed on 2026-11-10); kept so existing integrations keep parsing."
          },
          "attendance_confirmed": {
            "type": "string",
            "format": "date-time",
            "description": "When the customer tapped Confirm on a reminder."
          },
          "cancelled": {
            "type": "object",
            "description": "Only when cancelled.",
            "properties": {
              "at": {
                "type": "string",
                "format": "date-time"
              },
              "by": {
                "type": "string",
                "enum": [
                  "customer",
                  "business",
                  "api",
                  "system"
                ]
              },
              "reason": {
                "type": "string"
              }
            }
          },
          "rescheduled_from_id": {
            "type": "integer",
            "description": "The appointment this one replaced."
          },
          "link_id": {
            "type": "integer",
            "nullable": true,
            "description": "The online booking link (/book/...) it was made through, for correlation. null: none."
          },
          "notes_count": {
            "type": "integer",
            "description": "How many internal notes are written on this appointment (GET /bookings/{id}/notes). Given by the calendar routes and the list; left out of webhook events."
          },
          "created": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "BookingsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "bookings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Booking"
            }
          },
          "next_cursor": {
            "type": "string",
            "description": "Pass it as cursor for the next page. Left out on the last page."
          },
          "count": {
            "type": "integer"
          },
          "order": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ]
          },
          "enabled": {
            "type": "boolean",
            "description": "Whether bookings are switched on for the number."
          },
          "timezone": {
            "type": "string"
          }
        }
      },
      "BookingResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "booking": {
            "$ref": "#/components/schemas/Booking"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "BookingCreateRequest": {
        "type": "object",
        "required": [
          "contact",
          "service_id",
          "start",
          "name"
        ],
        "properties": {
          "contact": {
            "type": "string",
            "example": "61412345678",
            "description": "The customer's WhatsApp number with country code, digits only, or their business-scoped user id."
          },
          "service_id": {
            "type": "string",
            "example": "haircut",
            "description": "One of config.services[].id (GET /settings/booking)."
          },
          "start": {
            "type": "string",
            "example": "2026-11-10T09:00",
            "description": "A free slot's id from GET /bookings/availability: local time in the business time zone, yyyy-MM-ddTHH:mm."
          },
          "name": {
            "type": "string",
            "maxLength": 200,
            "example": "John Smith"
          },
          "email": {
            "type": "string",
            "format": "email",
            "example": "john@example.com"
          },
          "notes": {
            "type": "string",
            "maxLength": 2000,
            "description": "Notes for the business."
          },
          "provider_id": {
            "type": "string",
            "example": "maria",
            "description": "The staff member (config.providers[].id). Left out: the first free one."
          },
          "notify": {
            "type": "boolean",
            "default": true,
            "description": "Send the customer the confirmation on WhatsApp (a text inside their 24 hour window, else the booking confirmation template)."
          },
          "answers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Optional extra fields kept with the booking."
          },
          "hold": {
            "type": "string",
            "example": "BK-4HT9XC",
            "description": "The reference of a held time (POST /bookings/holds): the booking is made from that hold, takes its reference and frees it. `contact` and `name` from this body win over the hold's; service and time come from the hold."
          }
        }
      },
      "BookingCancelRequest": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string",
            "maxLength": 500,
            "example": "customer asked by phone"
          },
          "notify": {
            "type": "boolean",
            "default": true,
            "description": "Tell the customer on WhatsApp (a text inside their 24 hour window, else the cancellation template)."
          }
        }
      },
      "BookingStatusRequest": {
        "type": "object",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "completed",
              "no_show",
              "confirmed"
            ],
            "description": "completed: the customer came. no_show: they did not. confirmed: undo one of those (within 7 days of the end)."
          }
        }
      },
      "AvailabilitySlot": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "2026-11-10T09:00",
            "description": "Local time in the business time zone: what POST /bookings takes as start."
          },
          "title": {
            "type": "string",
            "example": "9:00 AM"
          },
          "start": {
            "type": "string",
            "format": "date-time"
          },
          "end": {
            "type": "string",
            "format": "date-time"
          },
          "providers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The staff members free at this time, when the business has them."
          }
        }
      },
      "AvailabilityDay": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "example": "2026-11-10"
          },
          "slots": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AvailabilitySlot"
            },
            "description": "Empty on a closed or full day."
          }
        }
      },
      "AvailabilityResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "days": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AvailabilityDay"
            }
          },
          "timezone": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "BookingSettings": {
        "type": "object",
        "description": "The booking configuration, by section. trigger: the words that send the Flow, its intro text and button; schedule: timezone, opening hours per weekday (hours.mon ... [[\"09:00\", \"17:00\"]]), slot_interval_min, buffers, min_notice_min, max_advance_days, max_per_slot, max_per_day (the most appointments on one day, per staff member when there is staff; 0 = no limit), cancel_notice_min (a customer may cancel or move only until this many minutes before the start; 0 = any time), overrides (closed days); services: id, name, duration_min, description, price, enabled, prep_text, aftercare_text, retail_links, payment_link, deposit_text; details: ask_email, ask_notes; messages: the texts the customer gets (placeholders {service} {date} {time} {duration} {business} {location} {reference} {name} {phone} {notes} {end_time} {provider} {prep} {booking_link}), web: see the web property, reminders, followup, rebook, notify_email; calendar: provider (builtin | google | microsoft | caldav | ics | calcom | calendly | acuity | square | msbookings | simplybook | setmore | zohobookings), write_calendar_id, busy_calendar_ids, event_title, event_description; providers: the staff members. GET /settings/booking shows every key with its value.",
        "additionalProperties": true,
        "properties": {
          "trigger": {
            "type": "object",
            "additionalProperties": true,
            "example": {
              "keywords": [
                "book",
                "appointment"
              ],
              "intro_text": "Tap the button below to choose a time that suits you.",
              "cta": "Book now"
            }
          },
          "schedule": {
            "type": "object",
            "additionalProperties": true,
            "example": {
              "timezone": "Australia/Sydney",
              "slot_interval_min": 30,
              "min_notice_min": 120,
              "max_advance_days": 30
            }
          },
          "services": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            },
            "example": [
              {
                "id": "haircut",
                "name": "Haircut",
                "duration_min": 30,
                "price": "$40",
                "enabled": true
              }
            ]
          },
          "details": {
            "type": "object",
            "additionalProperties": true,
            "example": {
              "ask_email": true,
              "ask_notes": true
            }
          },
          "messages": {
            "type": "object",
            "additionalProperties": true
          },
          "calendar": {
            "type": "object",
            "additionalProperties": true,
            "example": {
              "provider": "builtin"
            }
          },
          "web": {
            "type": "object",
            "additionalProperties": true,
            "description": "The online booking page: enabled, slug (the public address /book/<slug>; unique, 3 to 40 characters of a-z 0-9 and -), headline, intro, trigger_mode (flow | link | both), link_button, link_text, link_valid_days (1..60), hold_minutes (5..30), confirm_text (must contain {reference}), allow_manage.",
            "example": {
              "enabled": true,
              "slug": "sample-salon",
              "trigger_mode": "both",
              "link_valid_days": 7,
              "hold_minutes": 10,
              "allow_manage": true
            }
          },
          "providers": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        }
      },
      "BookingFlow": {
        "type": "object",
        "description": "A Flow of the number's Bookings section: the booking form (kind booking) or another form (kind form).",
        "properties": {
          "key": {
            "type": "string",
            "example": "booking",
            "description": "The Flow's key: what POST /flows/{key}/send takes."
          },
          "name": {
            "type": "string",
            "example": "Appointment booking"
          },
          "kind": {
            "type": "string",
            "enum": [
              "booking",
              "form"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "is_default": {
            "type": "boolean",
            "description": "The Flow the generic trigger words send."
          },
          "trigger_keywords": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Words that send this Flow."
          },
          "id": {
            "type": "string",
            "description": "Meta's id of the Flow, once uploaded."
          },
          "status": {
            "type": "string",
            "enum": [
              "none",
              "draft",
              "published",
              "deprecated",
              "blocked",
              "throttled",
              "error"
            ],
            "description": "Meta's status. Only a published Flow can be sent."
          },
          "can_send": {
            "type": "boolean",
            "description": "enabled and published."
          },
          "health": {
            "type": "string",
            "description": "Meta's health word: AVAILABLE, LIMITED, BLOCKED, or empty."
          },
          "validation": {
            "type": "string",
            "description": "Meta's validation problems in words, when there are any."
          },
          "last_error": {
            "type": "string"
          },
          "last_published_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "BookingSettingsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean",
            "description": "Bookings are switched on: the trigger words send the Flow."
          },
          "configured": {
            "type": "boolean",
            "description": "false: the number has never been set up (the config shown is the default)."
          },
          "config": {
            "$ref": "#/components/schemas/BookingSettings"
          },
          "flow": {
            "$ref": "#/components/schemas/BookingFlow",
            "description": "The default Flow (the booking form)."
          },
          "flows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BookingFlow"
            }
          },
          "key_status": {
            "type": "string",
            "enum": [
              "",
              "uploaded",
              "valid",
              "mismatch",
              "error"
            ],
            "description": "The Flow encryption key at Meta (publishing needs valid)."
          },
          "timezone": {
            "type": "string",
            "example": "Australia/Sydney"
          },
          "validation": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Problems in the stored settings, if any (a saved config is always valid; the default one is empty here)."
          },
          "note": {
            "type": "string"
          }
        }
      },
      "BookingSettingsUpdateRequest": {
        "type": "object",
        "description": "Give enabled, config, or both. A section object in config is merged key by key into the stored section (keys left out stay); a list (services, providers, schedule.overrides) or a single value replaces what is stored. The whole result is checked before anything is saved.",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "config": {
            "$ref": "#/components/schemas/BookingSettings"
          }
        }
      },
      "BookingReport": {
        "type": "object",
        "properties": {
          "days": {
            "type": "integer",
            "enum": [
              7,
              30,
              90
            ]
          },
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "bookings": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer"
              },
              "by_source": {
                "type": "object",
                "additionalProperties": {
                  "type": "integer"
                },
                "description": "whatsapp_flow, dashboard, api."
              }
            }
          },
          "completed": {
            "type": "integer"
          },
          "cancelled": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer"
              },
              "by": {
                "type": "object",
                "additionalProperties": {
                  "type": "integer"
                },
                "description": "customer, business, api, system."
              }
            }
          },
          "no_shows": {
            "type": "integer"
          },
          "no_show_rate": {
            "type": "number",
            "description": "no_shows / (completed + no_shows)."
          },
          "csat": {
            "type": "object",
            "properties": {
              "average": {
                "type": "number",
                "description": "Of the ratings 1, 3, 5. Left null without ratings."
              },
              "responses": {
                "type": "integer"
              }
            }
          },
          "reminders_sent": {
            "type": "integer"
          },
          "sessions": {
            "type": "object",
            "description": "Flow sessions started and completed (the conversion of the form).",
            "properties": {
              "started": {
                "type": "integer"
              },
              "completed": {
                "type": "integer"
              },
              "conversion": {
                "type": "number"
              }
            }
          },
          "top_services": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "count": {
                  "type": "integer"
                }
              }
            }
          },
          "per_provider": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "count": {
                  "type": "integer"
                }
              }
            }
          },
          "nudges": {
            "type": "object",
            "properties": {
              "rebook": {
                "type": "integer"
              }
            }
          },
          "error": {
            "type": "string",
            "description": "Only when the numbers could not be computed."
          }
        }
      },
      "BookingReportResponse": {
        "allOf": [
          {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "request_id": {
                "type": "string"
              }
            }
          },
          {
            "$ref": "#/components/schemas/BookingReport"
          }
        ]
      },
      "FlowSendRequest": {
        "type": "object",
        "required": [
          "contact"
        ],
        "properties": {
          "contact": {
            "type": "string",
            "example": "61412345678",
            "description": "The contact's WhatsApp number with country code, digits only, or their business-scoped user id. They must have written to the number in the last 24 hours."
          },
          "purpose": {
            "type": "string",
            "enum": [
              "book",
              "reschedule"
            ],
            "default": "book",
            "description": "reschedule: move the contact's next appointment (a booking Flow only)."
          }
        }
      },
      "FlowSendResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "sent": {
            "type": "boolean"
          },
          "message_id": {
            "type": "string",
            "description": "WhatsApp message id of the Flow message."
          },
          "session_id": {
            "type": "integer",
            "description": "The Flow session: booking.created / flow.completed name it."
          },
          "flow": {
            "type": "object",
            "properties": {
              "key": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "kind": {
                "type": "string"
              }
            }
          },
          "contact": {
            "type": "string"
          },
          "purpose": {
            "type": "string"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "Block": {
        "type": "object",
        "description": "Time that cannot be booked: time off, a break, a closed afternoon. Also the data of the calendar.block.created and calendar.block.deleted events.",
        "properties": {
          "id": {
            "type": "integer",
            "example": 3
          },
          "provider_id": {
            "type": "string",
            "example": "maria",
            "description": "The staff member it is for. Empty: the whole business."
          },
          "title": {
            "type": "string",
            "example": "Lunch",
            "description": "Up to 80 characters."
          },
          "notes": {
            "type": "string",
            "description": "Up to 500 characters."
          },
          "start": {
            "type": "string",
            "format": "date-time",
            "description": "UTC."
          },
          "end": {
            "type": "string",
            "format": "date-time",
            "description": "UTC."
          },
          "start_local": {
            "type": "string",
            "example": "2026-11-14T12:00",
            "description": "Local time in the business time zone, yyyy-MM-ddTHH:mm."
          },
          "end_local": {
            "type": "string",
            "example": "2026-11-14T13:00",
            "description": "Local time in the business time zone, yyyy-MM-ddTHH:mm."
          },
          "source": {
            "type": "string",
            "enum": [
              "calendar",
              "api"
            ],
            "description": "Made in the calendar app, or through this API."
          },
          "created_by": {
            "type": "string",
            "example": "API key Planner",
            "description": "The e-mail of the person, or API key <name>."
          },
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "updated": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "BlockCreateRequest": {
        "type": "object",
        "description": "Give start and end, or date for one whole day.",
        "properties": {
          "start": {
            "type": "string",
            "example": "2026-11-14T12:00",
            "description": "Local time in the business time zone, yyyy-MM-ddTHH:mm. Or ISO 8601 with an offset (2026-11-14T12:00:00+11:00)."
          },
          "end": {
            "type": "string",
            "example": "2026-11-14T13:00",
            "description": "Same format as start. After start, at most 31 days later."
          },
          "date": {
            "type": "string",
            "example": "2026-11-14",
            "description": "Instead of start and end: one whole day (YYYY-MM-DD, business time zone)."
          },
          "provider_id": {
            "type": "string",
            "example": "maria",
            "description": "A staff member (GET /bookings/staff). Left out: the whole business."
          },
          "title": {
            "type": "string",
            "maxLength": 80,
            "example": "Lunch"
          },
          "notes": {
            "type": "string",
            "maxLength": 500
          }
        }
      },
      "BlockUpdateRequest": {
        "type": "object",
        "description": "Any of these; what is left out stays. provider_id \"\" makes it a whole-business block.",
        "properties": {
          "start": {
            "type": "string"
          },
          "end": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "description": "One whole day: sets start and end."
          },
          "provider_id": {
            "type": "string"
          },
          "title": {
            "type": "string",
            "maxLength": 80
          },
          "notes": {
            "type": "string",
            "maxLength": 500
          }
        }
      },
      "BlockResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "block": {
            "$ref": "#/components/schemas/Block"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "BlockDeleteResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "deleted": {
            "type": "boolean"
          },
          "block": {
            "$ref": "#/components/schemas/Block"
          }
        }
      },
      "BlocksResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "blocks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Block"
            }
          },
          "count": {
            "type": "integer"
          },
          "from": {
            "type": "string",
            "example": "2026-11-10"
          },
          "to": {
            "type": "string",
            "example": "2026-12-10"
          },
          "timezone": {
            "type": "string"
          }
        }
      },
      "Note": {
        "type": "object",
        "description": "An internal note about a customer, optionally written on one appointment. Never shown to the customer. Also the data of the booking.note.created event (plus booking and timestamp).",
        "properties": {
          "id": {
            "type": "integer",
            "example": 7
          },
          "contact": {
            "type": "string",
            "example": "61412345678",
            "description": "The customer."
          },
          "appointment_id": {
            "type": "integer",
            "nullable": true,
            "description": "The appointment it was written on. null: a note on the customer alone."
          },
          "booking_reference": {
            "type": "string",
            "nullable": true,
            "example": "BK-7Q3M2A"
          },
          "body": {
            "type": "string",
            "description": "Up to 4000 characters."
          },
          "author": {
            "type": "string",
            "example": "API key Planner",
            "description": "A person's name or e-mail, or API key <name>."
          },
          "author_kind": {
            "type": "string",
            "enum": [
              "user",
              "api",
              "agent",
              "system"
            ]
          },
          "pinned": {
            "type": "boolean"
          },
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "updated": {
            "type": "string",
            "format": "date-time"
          },
          "on_this_booking": {
            "type": "boolean",
            "description": "Only in GET /bookings/{id}/notes: written on that appointment (false: another note of the same customer)."
          }
        }
      },
      "NoteCreateRequest": {
        "type": "object",
        "required": [
          "body"
        ],
        "properties": {
          "body": {
            "type": "string",
            "maxLength": 4000,
            "example": "Prefers the window seat."
          },
          "pinned": {
            "type": "boolean",
            "default": false
          },
          "contact": {
            "type": "string",
            "example": "61412345678",
            "description": "POST /bookings/notes only: the customer (number with country code, or business-scoped user id). Left out when booking_id is given."
          },
          "booking_id": {
            "type": "string",
            "example": "BK-7Q3M2A",
            "description": "POST /bookings/notes only: the appointment (id or reference) the note is written on; the customer is taken from it."
          }
        }
      },
      "NoteResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "note": {
            "$ref": "#/components/schemas/Note"
          }
        }
      },
      "NotesResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "notes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Note"
            },
            "description": "Pinned first, then newest."
          },
          "count": {
            "type": "integer"
          },
          "next_cursor": {
            "type": "string",
            "description": "Pass it as cursor for the next page. Left out on the last page."
          },
          "contact": {
            "type": "string"
          },
          "booking": {
            "type": "object",
            "description": "GET /bookings/{id}/notes only.",
            "properties": {
              "id": {
                "type": "integer"
              },
              "reference": {
                "type": "string"
              }
            }
          }
        }
      },
      "NoteDeleteResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "deleted": {
            "type": "boolean"
          },
          "id": {
            "type": "integer"
          }
        }
      },
      "BookingLink": {
        "type": "object",
        "description": "A link that opens the online booking page. Send the url to the customer.",
        "properties": {
          "id": {
            "type": "integer"
          },
          "code": {
            "type": "string",
            "example": "k3XbQ9rTzP2m"
          },
          "url": {
            "type": "string",
            "example": "https://www.app2email.com/book/k3XbQ9rTzP2m"
          },
          "kind": {
            "type": "string",
            "enum": [
              "personal",
              "public",
              "feed"
            ],
            "description": "This API makes and lists personal links."
          },
          "contact": {
            "type": "string",
            "nullable": true,
            "description": "Who the link is for. null: a one-off link the customer confirms on WhatsApp."
          },
          "contact_name": {
            "type": "string",
            "nullable": true
          },
          "service_id": {
            "type": "string",
            "nullable": true
          },
          "provider_id": {
            "type": "string",
            "nullable": true
          },
          "purpose": {
            "type": "string",
            "enum": [
              "book",
              "reschedule",
              "manage"
            ]
          },
          "booking_id": {
            "type": "integer",
            "nullable": true,
            "description": "The appointment of a reschedule / manage link."
          },
          "single_use": {
            "type": "boolean"
          },
          "max_uses": {
            "type": "integer",
            "description": "0 = no limit."
          },
          "uses": {
            "type": "integer"
          },
          "expires": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "revoked": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "source": {
            "type": "string",
            "example": "api"
          },
          "created_by": {
            "type": "string",
            "example": "API key Planner"
          },
          "open_count": {
            "type": "integer"
          },
          "last_opened": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "state": {
            "type": "string",
            "enum": [
              "ok",
              "not_found",
              "expired",
              "revoked",
              "used_up",
              "off"
            ],
            "description": "ok: it opens. off: the online booking page is switched off."
          }
        }
      },
      "BookingLinkRequest": {
        "type": "object",
        "description": "Without contact: a one-off link; the customer confirms the booking on WhatsApp. purpose reschedule and manage need contact or booking_id.",
        "properties": {
          "contact": {
            "type": "string",
            "example": "61412345678",
            "description": "The customer's WhatsApp number with country code, digits only, or their business-scoped user id."
          },
          "name": {
            "type": "string",
            "example": "John"
          },
          "service_id": {
            "type": "string",
            "example": "haircut",
            "description": "Preselect a service."
          },
          "provider_id": {
            "type": "string",
            "example": "maria",
            "description": "Preselect a staff member."
          },
          "purpose": {
            "type": "string",
            "enum": [
              "book",
              "reschedule",
              "manage"
            ],
            "default": "book"
          },
          "booking_id": {
            "type": "string",
            "example": "BK-7Q3M2A",
            "description": "The appointment (id or reference) of a reschedule / manage link."
          },
          "single_use": {
            "type": "boolean",
            "default": false,
            "description": "The link stops working after one booking."
          },
          "expires_in_hours": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1440,
            "description": "Default: the business's setting (7 days)."
          }
        }
      },
      "BookingLinkResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "link": {
            "$ref": "#/components/schemas/BookingLink"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "BookingLinksResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "links": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BookingLink"
            },
            "description": "Newest first."
          },
          "count": {
            "type": "integer"
          },
          "next_cursor": {
            "type": "string",
            "description": "Pass it as cursor for the next page. Left out on the last page."
          }
        }
      },
      "Hold": {
        "type": "object",
        "description": "A time kept for a few minutes so no one else can book it.",
        "properties": {
          "reference": {
            "type": "string",
            "example": "BK-4HT9XC",
            "description": "Becomes the booking's reference when the hold is booked."
          },
          "status": {
            "type": "string",
            "enum": [
              "held",
              "booked",
              "expired",
              "released"
            ]
          },
          "service_id": {
            "type": "string"
          },
          "provider_id": {
            "type": "string",
            "nullable": true,
            "description": "The staff member the time is kept with."
          },
          "contact": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "start": {
            "type": "string",
            "format": "date-time",
            "description": "UTC."
          },
          "end": {
            "type": "string",
            "format": "date-time",
            "description": "UTC."
          },
          "start_local": {
            "type": "string",
            "description": "Local time in the business time zone, yyyy-MM-ddTHH:mm."
          },
          "end_local": {
            "type": "string",
            "description": "Local time in the business time zone, yyyy-MM-ddTHH:mm."
          },
          "expires": {
            "type": "string",
            "format": "date-time",
            "description": "When the time is freed."
          },
          "source": {
            "type": "string",
            "enum": [
              "web",
              "api"
            ]
          }
        }
      },
      "HoldRequest": {
        "type": "object",
        "required": [
          "service_id",
          "start"
        ],
        "properties": {
          "service_id": {
            "type": "string",
            "example": "haircut"
          },
          "start": {
            "type": "string",
            "example": "2026-11-10T09:00",
            "description": "A free slot of GET /bookings/availability or /bookings/next: Local time in the business time zone, yyyy-MM-ddTHH:mm."
          },
          "provider_id": {
            "type": "string",
            "example": "maria",
            "description": "Left out (or \"any\"): the first free staff member who does the service."
          },
          "contact": {
            "type": "string",
            "example": "61412345678",
            "description": "The customer, when known."
          },
          "name": {
            "type": "string",
            "example": "John"
          },
          "minutes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 30,
            "default": 10,
            "description": "How long to keep the time."
          }
        }
      },
      "HoldResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "hold": {
            "$ref": "#/components/schemas/Hold"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "HoldReleaseResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "released": {
            "type": "boolean"
          },
          "hold": {
            "$ref": "#/components/schemas/Hold"
          }
        }
      },
      "CalendarEvent": {
        "type": "object",
        "description": "One entry of the calendar, told apart by kind. booking: an appointment (the Booking fields plus start_local, end_local, service_id, service_name, duration_min, provider_id, provider_name, contact, contact_name, contact_email, conversation_id, attendance_confirmed, notes_count, calendar_error, link_id). block: a Block. busy: time busy in the connected calendar (our own appointments left out). hold: a held time.",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "booking",
              "block",
              "busy",
              "hold"
            ]
          },
          "id": {
            "type": "integer",
            "description": "kind booking and block."
          },
          "reference": {
            "type": "string",
            "description": "kind booking and hold."
          },
          "status": {
            "type": "string",
            "enum": [
              "confirmed",
              "cancelled",
              "completed",
              "no_show"
            ],
            "description": "kind booking."
          },
          "start": {
            "type": "string",
            "format": "date-time",
            "description": "UTC."
          },
          "end": {
            "type": "string",
            "format": "date-time",
            "description": "UTC."
          },
          "start_local": {
            "type": "string",
            "description": "Local time in the business time zone, yyyy-MM-ddTHH:mm."
          },
          "end_local": {
            "type": "string",
            "description": "Local time in the business time zone, yyyy-MM-ddTHH:mm."
          },
          "provider_id": {
            "type": "string"
          },
          "title": {
            "type": "string",
            "description": "kind block and busy."
          },
          "service_id": {
            "type": "string"
          },
          "service_name": {
            "type": "string"
          },
          "contact": {
            "type": "string"
          },
          "contact_name": {
            "type": "string"
          },
          "notes_count": {
            "type": "integer"
          }
        },
        "additionalProperties": true
      },
      "CalendarFeed": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "timezone": {
            "type": "string",
            "example": "Australia/Sydney"
          },
          "from": {
            "type": "string",
            "example": "2026-11-10"
          },
          "to": {
            "type": "string",
            "example": "2026-11-16"
          },
          "now_local": {
            "type": "string",
            "example": "2026-11-11T10:42"
          },
          "enabled": {
            "type": "boolean",
            "description": "Bookings are switched on."
          },
          "web": {
            "type": "object",
            "description": "The online booking page.",
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "slug": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "description": "Left out while the page is off."
              }
            }
          },
          "hours": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "description": "The business's open windows per day, overrides applied: {\"2026-11-10\": [[\"09:00\", \"17:00\"]]}. [] = closed."
          },
          "providers": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            },
            "description": "The staff: id, name, enabled, services, hours per day. Empty when the number has no staff."
          },
          "services": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            },
            "description": "id, name, duration_min, price, description, enabled."
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CalendarEvent"
            }
          }
        }
      },
      "BookableService": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "haircut"
          },
          "name": {
            "type": "string",
            "example": "Haircut"
          },
          "duration_min": {
            "type": "integer",
            "example": 30
          },
          "price": {
            "type": "string",
            "nullable": true,
            "example": "$40"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "staff": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The staff members who do it (ids). Empty when the number has no staff."
          }
        }
      },
      "BookableServicesResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "services": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BookableService"
            }
          },
          "timezone": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "StaffMember": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "maria"
          },
          "name": {
            "type": "string",
            "example": "Maria"
          },
          "services": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The services she does (ids)."
          }
        }
      },
      "StaffResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "staff": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StaffMember"
            }
          },
          "timezone": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "NextSlot": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "2026-11-10T09:00",
            "description": "Local time: what POST /bookings, /bookings/holds and /bookings/{id}/reschedule take as start."
          },
          "date": {
            "type": "string",
            "example": "2026-11-10"
          },
          "title": {
            "type": "string",
            "example": "9:00 AM"
          },
          "start": {
            "type": "string",
            "format": "date-time"
          },
          "end": {
            "type": "string",
            "format": "date-time"
          },
          "providers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The staff members free at this time, when the business has them."
          }
        }
      },
      "NextSlotsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "slots": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NextSlot"
            }
          },
          "count": {
            "type": "integer"
          },
          "timezone": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "note": {
            "type": "string",
            "description": "Only when fewer free times than asked for exist in the next 60 days."
          }
        }
      },
      "BookingPatchRequest": {
        "type": "object",
        "description": "Any of these; what is left out stays. The time is changed with POST /bookings/{id}/reschedule.",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 200
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "notes": {
            "type": "string",
            "maxLength": 2000
          },
          "provider_id": {
            "type": "string",
            "example": "maria",
            "description": "Another staff member; \"any\" = the first free one. The time must be free for them (409 booking_slot_taken)."
          },
          "answers": {
            "type": "object",
            "additionalProperties": true,
            "description": "Replaces the extra fields kept with the booking."
          }
        }
      },
      "BookingRescheduleRequest": {
        "type": "object",
        "required": [
          "start"
        ],
        "properties": {
          "start": {
            "type": "string",
            "example": "2026-11-12T10:00",
            "description": "A free slot (GET /bookings/availability or /bookings/next): Local time in the business time zone, yyyy-MM-ddTHH:mm."
          },
          "provider_id": {
            "type": "string",
            "example": "maria",
            "description": "Left out: the booking's own staff member. \"any\": the first free one."
          },
          "notify": {
            "type": "boolean",
            "default": true,
            "description": "Tell the customer on WhatsApp (a text inside their 24 hour window, else the confirmation template)."
          }
        }
      },
      "CallingSettings": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "ENABLED or DISABLED."
          },
          "call_icon_visibility": {
            "type": "string",
            "description": "DEFAULT or DISABLE_ALL."
          },
          "call_icons": {
            "type": "object",
            "properties": {
              "restrict_to_user_countries": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "call_hours": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string"
              },
              "timezone_id": {
                "type": "string"
              },
              "weekly_operating_hours": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "day_of_week": {
                      "type": "string"
                    },
                    "open_time": {
                      "type": "string"
                    },
                    "close_time": {
                      "type": "string"
                    }
                  }
                }
              },
              "holiday_schedule": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "date": {
                      "type": "string"
                    },
                    "start_time": {
                      "type": "string"
                    },
                    "end_time": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "additionalProperties": true
          },
          "callback_permission_status": {
            "type": "string",
            "description": "ENABLED: a user who calls grants call-back permission."
          },
          "srtp_key_exchange_protocol": {
            "type": "string",
            "description": "DTLS or SDES."
          },
          "sip": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string"
              },
              "servers": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "hostname": {
                      "type": "string"
                    },
                    "port": {
                      "type": "integer"
                    }
                  },
                  "additionalProperties": true
                }
              }
            },
            "additionalProperties": true
          },
          "video": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string"
              }
            }
          },
          "audio": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string"
              }
            }
          }
        },
        "description": "Meta's calling settings object, passed as it is.",
        "additionalProperties": true
      },
      "CallSettingsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "request_id": {
            "type": "string",
            "example": "c4l1s"
          },
          "settings": {
            "type": "object",
            "properties": {
              "calling": {
                "$ref": "#/components/schemas/CallingSettings"
              },
              "storage_configuration": {
                "type": "object",
                "properties": {},
                "additionalProperties": true
              },
              "payload_encryption": {
                "type": "object",
                "properties": {},
                "additionalProperties": true
              }
            },
            "additionalProperties": true
          }
        },
        "required": [
          "success",
          "request_id",
          "settings"
        ]
      },
      "CallSettingsUpdate": {
        "type": "object",
        "properties": {
          "calling": {
            "$ref": "#/components/schemas/CallingSettings"
          }
        },
        "required": [
          "calling"
        ],
        "description": "Or the calling object itself. Settings left out stay as they are."
      },
      "CallSettingsUpdateResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "request_id": {
            "type": "string",
            "example": "c4l1s"
          },
          "updated": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "calling": {
            "$ref": "#/components/schemas/CallingSettings"
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "CallRequest": {
        "type": "object",
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "connect",
              "pre_accept",
              "accept",
              "reject",
              "terminate",
              "media_update"
            ]
          },
          "to": {
            "type": "string",
            "description": "connect: the contact's number or business-scoped user id (sent as recipient)."
          },
          "recipient": {
            "type": "string",
            "description": "Instead of to: a business-scoped user id."
          },
          "call_id": {
            "type": "string",
            "description": "Every action but connect: the call's id (call.incoming / call.status)."
          },
          "session": {
            "type": "object",
            "properties": {
              "sdp_type": {
                "type": "string",
                "enum": [
                  "offer",
                  "answer"
                ]
              },
              "sdp": {
                "type": "string",
                "description": "RFC 8866 SDP."
              }
            },
            "required": [
              "sdp_type",
              "sdp"
            ]
          },
          "biz_opaque_callback_data": {
            "type": "string",
            "maxLength": 512
          },
          "recording": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string"
              },
              "purpose": {
                "type": "string"
              },
              "announcement_language": {
                "type": "string"
              }
            }
          },
          "transcription": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string"
              },
              "purpose": {
                "type": "string"
              },
              "announcement_language": {
                "type": "string"
              }
            }
          },
          "messaging_product": {
            "type": "string",
            "description": "Meta's body: accepted and ignored."
          }
        },
        "required": [
          "action"
        ],
        "description": "Meta's own body. connect needs to + session (offer); pre_accept / accept need call_id + session (answer)."
      },
      "CallResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "request_id": {
            "type": "string",
            "example": "c4l1s"
          },
          "action": {
            "type": "string"
          },
          "call_id": {
            "type": "string"
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "CallPermissionResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "request_id": {
            "type": "string",
            "example": "c4l1s"
          },
          "contact": {
            "type": "string"
          },
          "permission": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "description": "no_permission, temporary or permanent (Meta's call_permissions)."
              },
              "expires_at": {
                "type": "string",
                "format": "date-time"
              }
            }
          },
          "actions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "action_name": {
                  "type": "string",
                  "enum": [
                    "start_call",
                    "send_call_permission_request"
                  ]
                },
                "can_perform_action": {
                  "type": "boolean"
                },
                "limits": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "time_period": {
                        "type": "string"
                      },
                      "max_allowed": {
                        "type": "integer"
                      },
                      "current_usage": {
                        "type": "integer"
                      },
                      "limit_expiration_time": {
                        "type": "integer"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "FlowValidationError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "error_type": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "line_start": {
            "type": "integer"
          },
          "line_end": {
            "type": "integer"
          },
          "column_start": {
            "type": "integer"
          },
          "column_end": {
            "type": "integer"
          },
          "pointers": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        }
      },
      "Flow": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "DRAFT",
              "PUBLISHED",
              "DEPRECATED",
              "BLOCKED",
              "THROTTLED"
            ]
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "SIGN_UP",
                "SIGN_IN",
                "APPOINTMENT_BOOKING",
                "LEAD_GENERATION",
                "CONTACT_US",
                "CUSTOMER_SUPPORT",
                "SURVEY",
                "OTHER"
              ]
            }
          },
          "validation_errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FlowValidationError"
            }
          },
          "json_version": {
            "type": "string"
          },
          "data_api_version": {
            "type": "string"
          },
          "endpoint_uri": {
            "type": "string"
          },
          "health_status": {
            "type": "object",
            "additionalProperties": true,
            "description": "can_send_message (AVAILABLE | LIMITED | BLOCKED) per entity, with errors."
          },
          "key": {
            "type": "string",
            "example": "booking",
            "description": "GET /flows only: one of this number's Bookings Flows; POST /flows/{key}/send takes the key. Left out for other Flows."
          },
          "can_send": {
            "type": "boolean",
            "description": "GET /flows, a Bookings Flow: POST /flows/{key}/send works now (enabled and published)."
          },
          "booking_flow": {
            "$ref": "#/components/schemas/BookingFlow",
            "description": "GET /flows, a Bookings Flow: the Flow as the Bookings section has it (status in its words)."
          }
        }
      },
      "FlowListResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "flows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Flow"
            }
          },
          "next_cursor": {
            "type": "string",
            "nullable": true
          },
          "count": {
            "type": "integer",
            "description": "Flows in this answer."
          },
          "enabled": {
            "type": "boolean",
            "description": "Bookings are switched on for the number. Left out when the plan has no bookings."
          },
          "note": {
            "type": "string"
          }
        }
      },
      "FlowCreateRequest": {
        "type": "object",
        "required": [
          "name",
          "categories"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 200,
            "description": "Internal name; customers do not see it."
          },
          "categories": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "enum": [
                "SIGN_UP",
                "SIGN_IN",
                "APPOINTMENT_BOOKING",
                "LEAD_GENERATION",
                "CONTACT_US",
                "CUSTOMER_SUPPORT",
                "SURVEY",
                "OTHER"
              ]
            }
          },
          "flow_json": {
            "type": "object",
            "additionalProperties": true,
            "description": "The Flow JSON (version, screens), as an object or a string. Max 10 MB."
          },
          "publish": {
            "type": "boolean",
            "description": "true (with flow_json): published at once. Cannot be undone."
          },
          "clone_flow_id": {
            "type": "string",
            "description": "Copy this flow (of the same account)."
          },
          "endpoint_uri": {
            "type": "string",
            "format": "uri",
            "description": "https URL of your data endpoint, for flows that use one."
          }
        }
      },
      "FlowCreateResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "flow": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "status": {
                "type": "string"
              }
            }
          },
          "validation_errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FlowValidationError"
            }
          },
          "note": {
            "type": "string"
          }
        }
      },
      "FlowDetailResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "flow": {
            "$ref": "#/components/schemas/Flow"
          }
        }
      },
      "FlowUpdateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "SIGN_UP",
                "SIGN_IN",
                "APPOINTMENT_BOOKING",
                "LEAD_GENERATION",
                "CONTACT_US",
                "CUSTOMER_SUPPORT",
                "SURVEY",
                "OTHER"
              ]
            }
          },
          "endpoint_uri": {
            "type": "string",
            "format": "uri"
          },
          "application_id": {
            "type": "string",
            "description": "The Meta app connected to a flow with an endpoint."
          }
        }
      },
      "FlowUpdateResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "flow_id": {
            "type": "string"
          },
          "changed": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "note": {
            "type": "string",
            "description": "Only when the flow was PUBLISHED: it is a DRAFT again."
          }
        }
      },
      "FlowDeleteResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "deleted": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "FlowJsonResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "flow_id": {
            "type": "string"
          },
          "flow_json": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "FlowJsonUploadResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "flow_id": {
            "type": "string"
          },
          "validation_errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FlowValidationError"
            }
          },
          "note": {
            "type": "string"
          }
        }
      },
      "FlowStateResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "flow_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "previous_status": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "FlowPreviewResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "flow_id": {
            "type": "string"
          },
          "preview_url": {
            "type": "string",
            "format": "uri"
          },
          "expires_at": {
            "type": "string"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "FlowEncryptionKeyResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "public_key": {
            "type": "string",
            "nullable": true
          },
          "signature_status": {
            "type": "string",
            "enum": [
              "VALID",
              "MISMATCH"
            ],
            "nullable": true
          },
          "set_by": {
            "type": "string",
            "enum": [
              "bookings",
              "other"
            ],
            "nullable": true,
            "description": "bookings: the key Bookings made for its Flows (PUT answers 409 then). other: any other key. Left out without a key."
          },
          "note": {
            "type": "string"
          }
        }
      },
      "FlowEncryptionKeyRequest": {
        "type": "object",
        "required": [
          "public_key"
        ],
        "properties": {
          "public_key": {
            "type": "string",
            "description": "A 2048-bit RSA public key, PEM. Never the private key."
          }
        }
      },
      "FlowEncryptionKeySetResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "MediaMultipartUpload": {
        "type": "object",
        "required": [
          "file"
        ],
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "description": "The file."
          },
          "type": {
            "type": "string",
            "example": "image",
            "description": "Optional: image, video, document, audio or sticker, or a MIME type (Meta's own form). Left out: from the file."
          },
          "voice": {
            "type": "boolean",
            "description": "Audio: check it is a voice message (Ogg with OPUS)."
          }
        }
      },
      "MediaInfoResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "media": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "source": {
                "type": "string",
                "enum": [
                  "stored",
                  "whatsapp"
                ]
              },
              "mime_type": {
                "type": "string"
              },
              "file_size": {
                "type": "integer"
              },
              "sha256": {
                "type": "string"
              },
              "filename": {
                "type": "string",
                "description": "stored only."
              },
              "message_id": {
                "type": "string",
                "description": "stored only."
              },
              "whatsapp_media_id": {
                "type": "string",
                "description": "stored only: WhatsApp's id of the received file (valid 7 days)."
              }
            }
          }
        }
      },
      "MediaDeleteResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "media_id": {
            "type": "string"
          },
          "deleted": {
            "type": "boolean"
          }
        }
      },
      "AudioContent": {
        "type": "object",
        "description": "aac, amr, mp3, m4a or ogg (OPUS), up to 16 MB. No caption.",
        "properties": {
          "link": {
            "type": "string",
            "format": "uri",
            "description": "Public http(s) URL. app2email downloads the file and uploads it to WhatsApp."
          },
          "data": {
            "type": "string",
            "format": "byte",
            "description": "The file, base64 encoded."
          },
          "id": {
            "type": "string",
            "description": "A media id from POST /media."
          },
          "filename": {
            "type": "string"
          },
          "mime_type": {
            "type": "string"
          },
          "voice": {
            "type": "boolean",
            "description": "true: a voice message (play button, transcript). Ogg with the OPUS codec only; app2email does not convert."
          }
        }
      },
      "StickerContent": {
        "type": "object",
        "description": "WebP only: up to 100 KB static, 500 KB animated. No caption.",
        "properties": {
          "link": {
            "type": "string",
            "format": "uri",
            "description": "Public http(s) URL. app2email downloads the file and uploads it to WhatsApp."
          },
          "data": {
            "type": "string",
            "format": "byte",
            "description": "The file, base64 encoded."
          },
          "id": {
            "type": "string",
            "description": "A media id from POST /media."
          },
          "filename": {
            "type": "string"
          },
          "mime_type": {
            "type": "string"
          }
        }
      },
      "LocationContent": {
        "type": "object",
        "required": [
          "latitude",
          "longitude"
        ],
        "properties": {
          "latitude": {
            "type": "number",
            "minimum": -90,
            "maximum": 90,
            "example": -33.8568
          },
          "longitude": {
            "type": "number",
            "minimum": -180,
            "maximum": 180,
            "example": 151.2153
          },
          "name": {
            "type": "string",
            "example": "Sydney Opera House"
          },
          "address": {
            "type": "string",
            "example": "Bennelong Point, Sydney NSW 2000"
          }
        }
      },
      "ContactCard": {
        "type": "object",
        "required": [
          "name"
        ],
        "description": "One vCard, as WhatsApp Cloud API.",
        "properties": {
          "name": {
            "type": "object",
            "required": [
              "formatted_name"
            ],
            "properties": {
              "formatted_name": {
                "type": "string",
                "example": "Jane Citizen"
              },
              "first_name": {
                "type": "string"
              },
              "last_name": {
                "type": "string"
              },
              "middle_name": {
                "type": "string"
              },
              "prefix": {
                "type": "string"
              },
              "suffix": {
                "type": "string"
              }
            }
          },
          "phones": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "phone": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "example": "CELL"
                },
                "wa_id": {
                  "type": "string"
                }
              }
            }
          },
          "emails": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "email": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                }
              }
            }
          },
          "addresses": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "org": {
            "type": "object",
            "properties": {
              "company": {
                "type": "string"
              },
              "department": {
                "type": "string"
              },
              "title": {
                "type": "string"
              }
            }
          },
          "urls": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                }
              }
            }
          },
          "birthday": {
            "type": "string",
            "example": "1990-01-31"
          }
        }
      },
      "ReactionContent": {
        "type": "object",
        "required": [
          "message_id",
          "emoji"
        ],
        "properties": {
          "message_id": {
            "type": "string",
            "example": "wamid.HBgLNjE0MTIzNDU2NzgVAgASGBQzQUZCMTY0MDc2MUYwNzBDNTY5MAA=",
            "description": "A message the contact sent, up to 30 days old."
          },
          "emoji": {
            "type": "string",
            "example": "👍",
            "description": "One emoji. \"\" removes your reaction."
          }
        }
      },
      "SendContact": {
        "type": "object",
        "description": "WhatsApp's contacts[] of the send answer.",
        "properties": {
          "input": {
            "type": "string",
            "example": "61412345678"
          },
          "wa_id": {
            "type": "string",
            "example": "61412345678"
          },
          "user_id": {
            "type": "string",
            "example": "AU.13491208655302741918",
            "description": "The business-scoped user id, when WhatsApp gives one."
          }
        }
      },
      "MarkReadRequest": {
        "type": "object",
        "required": [
          "message_id"
        ],
        "properties": {
          "message_id": {
            "type": "string",
            "example": "wamid.HBgLNjE0MTIzNDU2NzgVAgASGBQzQUZCMTY0MDc2MUYwNzBDNTY5MAA=",
            "description": "A message the contact sent, up to 30 days old."
          },
          "typing": {
            "type": "boolean",
            "default": false,
            "description": "true: also the typing indicator (25 seconds or until your reply)."
          },
          "dry_run": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "MarkReadResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "message_id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "read",
              "dry_run"
            ]
          },
          "typing_indicator": {
            "type": "boolean"
          },
          "sandbox": {
            "type": "boolean"
          },
          "dry_run": {
            "type": "boolean"
          },
          "whatsapp_message": {
            "type": "object",
            "additionalProperties": true,
            "description": "Dry run only."
          },
          "note": {
            "type": "string"
          }
        }
      },
      "MarketingStatusResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "marketing": {
            "type": "object",
            "properties": {
              "route": {
                "type": "string",
                "enum": [
                  "auto",
                  "cloud_api",
                  "mm_api"
                ],
                "description": "The number's setting messages.marketing_route."
              },
              "effective_route": {
                "type": "string",
                "enum": [
                  "cloud_api",
                  "mm_api"
                ],
                "description": "Where a marketing template goes now."
              },
              "onboarding_status": {
                "type": "string",
                "example": "ONBOARDED",
                "description": "WhatsApp's marketing_messages_onboarding_status (ELIGIBLE, ONBOARDED, ...)."
              },
              "cloud_api_marketing_disabled": {
                "type": "boolean",
                "description": "The account's disable_marketing_messages_on_cloud_api switch (null: WhatsApp did not give it)."
              },
              "checked_at": {
                "type": "string",
                "format": "date-time"
              },
              "warning": {
                "type": "string"
              }
            }
          }
        }
      },
      "BlockUsersRequest": {
        "type": "object",
        "required": [
          "users"
        ],
        "properties": {
          "users": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "type": "string"
            },
            "description": "Phone numbers (country code, digits) or business-scoped user ids. Meta's own block_users list works too."
          }
        }
      },
      "BlockedUser": {
        "type": "object",
        "properties": {
          "input": {
            "type": "string"
          },
          "wa_id": {
            "type": "string"
          },
          "user_id": {
            "type": "string"
          }
        }
      },
      "BlockFailure": {
        "type": "object",
        "properties": {
          "input": {
            "type": "string"
          },
          "wa_id": {
            "type": "string"
          },
          "user_id": {
            "type": "string"
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "how_to_fix": {
                "type": "string"
              },
              "whatsapp_code": {
                "type": "integer"
              }
            }
          }
        }
      },
      "BlockUsersResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "false when some users failed (HTTP 207)."
          },
          "request_id": {
            "type": "string"
          },
          "blocked": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BlockedUser"
            },
            "description": "POST only."
          },
          "unblocked": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BlockedUser"
            },
            "description": "DELETE only."
          },
          "failed": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BlockFailure"
            }
          }
        }
      },
      "BlockedListResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "blocked": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BlockedUser"
            }
          },
          "count": {
            "type": "integer"
          },
          "next_cursor": {
            "type": "string"
          }
        }
      },
      "ContactBookResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "bsuid": {
            "type": "string"
          },
          "present": {
            "type": "boolean",
            "description": "GET: WhatsApp's contact book has a phone number for this id (never the number itself)."
          },
          "deleted": {
            "type": "boolean",
            "description": "DELETE: there was an entry and it is gone."
          },
          "note": {
            "type": "string"
          }
        }
      },
      "NumberHealth": {
        "type": "object",
        "properties": {
          "can_send_message": {
            "type": "string",
            "enum": [
              "AVAILABLE",
              "LIMITED",
              "BLOCKED"
            ],
            "description": "WhatsApp's verdict for the number, its WABA, business and app together."
          },
          "entities": {
            "type": "array",
            "description": "Meta's health_status.entities: one per PHONE_NUMBER, WABA, BUSINESS, APP, with errors and how to fix them.",
            "items": {
              "type": "object",
              "properties": {
                "entity_type": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "can_send_message": {
                  "type": "string"
                },
                "errors": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "error_code": {
                        "type": "integer"
                      },
                      "error_description": {
                        "type": "string"
                      },
                      "possible_solution": {
                        "type": "string"
                      }
                    }
                  }
                },
                "additional_info": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "display_phone_number": {
            "type": "string"
          },
          "verified_name": {
            "type": "string"
          },
          "quality_rating": {
            "type": "string",
            "enum": [
              "GREEN",
              "YELLOW",
              "RED",
              "NA",
              "UNKNOWN"
            ]
          },
          "messaging_limit": {
            "type": "string",
            "description": "The business portfolio's limit of contacts outside the service window per 24 h, eg TIER_2K, TIER_UNLIMITED."
          },
          "throughput": {
            "type": "string",
            "description": "STANDARD (80 messages/s), HIGH (1,000 messages/s) or NOT_APPLICABLE."
          },
          "status": {
            "type": "string",
            "description": "CONNECTED, DISCONNECTED, PENDING, FLAGGED, RESTRICTED, RATE_LIMITED ..."
          },
          "name_status": {
            "type": "string",
            "description": "Review of verified_name: APPROVED, AVAILABLE_WITHOUT_REVIEW, DECLINED, EXPIRED, PENDING_REVIEW, NONE."
          },
          "new_display_name": {
            "type": "string",
            "description": "A requested display name under review (PUT /profile/display-name)."
          },
          "new_name_status": {
            "type": "string"
          },
          "code_verification_status": {
            "type": "string",
            "enum": [
              "VERIFIED",
              "UNVERIFIED",
              "EXPIRED"
            ]
          },
          "account_mode": {
            "type": "string",
            "enum": [
              "SANDBOX",
              "LIVE"
            ]
          },
          "is_official_business_account": {
            "type": "boolean"
          },
          "coexistence": {
            "type": "boolean",
            "description": "true: the number also runs in the WhatsApp Business app (20 messages/s at most)."
          }
        }
      },
      "NumberHealthResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "request_id": {
            "type": "string",
            "example": "k3x9a"
          },
          "health": {
            "$ref": "#/components/schemas/NumberHealth"
          },
          "fetched_at": {
            "type": "string",
            "format": "date-time",
            "description": "When WhatsApp was asked (answers are kept 60 s)."
          }
        },
        "required": [
          "success",
          "request_id",
          "health"
        ]
      },
      "IdentityCheckRequest": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "enabled"
        ]
      },
      "IdentityCheckResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "request_id": {
            "type": "string",
            "example": "k3x9a"
          },
          "identity_check": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean"
              }
            }
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "BusinessProfile": {
        "type": "object",
        "properties": {
          "about": {
            "type": "string",
            "maxLength": 139
          },
          "address": {
            "type": "string",
            "maxLength": 256
          },
          "description": {
            "type": "string",
            "maxLength": 512
          },
          "email": {
            "type": "string",
            "maxLength": 128
          },
          "profile_picture_url": {
            "type": "string",
            "description": "Meta's link to the current photo (read only)."
          },
          "websites": {
            "type": "array",
            "maxItems": 2,
            "items": {
              "type": "string"
            }
          },
          "vertical": {
            "type": "string",
            "enum": [
              "ALCOHOL",
              "APPAREL",
              "AUTO",
              "BEAUTY",
              "EDU",
              "ENTERTAIN",
              "EVENT_PLAN",
              "FINANCE",
              "GOVT",
              "GROCERY",
              "HEALTH",
              "HOTEL",
              "NONPROFIT",
              "ONLINE_GAMBLING",
              "OTC_DRUGS",
              "OTHER",
              "PHYSICAL_GAMBLING",
              "PROF_SERVICES",
              "RESTAURANT",
              "RETAIL",
              "TRAVEL"
            ]
          }
        }
      },
      "BusinessProfileUpdate": {
        "type": "object",
        "properties": {
          "about": {
            "type": "string",
            "minLength": 1,
            "maxLength": 139
          },
          "address": {
            "type": "string",
            "maxLength": 256
          },
          "description": {
            "type": "string",
            "maxLength": 512
          },
          "email": {
            "type": "string",
            "maxLength": 128
          },
          "websites": {
            "type": "array",
            "maxItems": 2,
            "items": {
              "type": "string"
            }
          },
          "vertical": {
            "type": "string"
          },
          "profile_picture_handle": {
            "type": "string",
            "description": "A Resumable Upload handle (Meta's body). PUT /profile/photo makes one from a link."
          }
        },
        "description": "Only the fields to change. messaging_product is accepted and ignored."
      },
      "BusinessProfileResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "request_id": {
            "type": "string",
            "example": "k3x9a"
          },
          "profile": {
            "$ref": "#/components/schemas/BusinessProfile"
          }
        },
        "required": [
          "success",
          "request_id",
          "profile"
        ]
      },
      "BusinessProfileUpdateResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "request_id": {
            "type": "string",
            "example": "k3x9a"
          },
          "updated": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "profile": {
            "$ref": "#/components/schemas/BusinessProfile"
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "ProfilePhotoRequest": {
        "type": "object",
        "properties": {
          "link": {
            "type": "string",
            "format": "uri",
            "description": "Public http(s) link to a JPG or PNG image, up to 5 MB."
          }
        },
        "required": [
          "link"
        ]
      },
      "ProfilePhotoResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "request_id": {
            "type": "string",
            "example": "k3x9a"
          },
          "updated": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "link": {
            "type": "string"
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "DisplayNameRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 3,
            "maxLength": 512
          }
        },
        "required": [
          "name"
        ]
      },
      "DisplayNameResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "request_id": {
            "type": "string",
            "example": "k3x9a"
          },
          "display_name": {
            "type": "object",
            "properties": {
              "current": {
                "type": "string"
              },
              "requested": {
                "type": "string"
              },
              "status": {
                "type": "string"
              }
            }
          },
          "next_step": {
            "type": "string",
            "enum": [
              "wait_for_review"
            ]
          },
          "note": {
            "type": "string"
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "OfficialBusinessAccount": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "PENDING",
              "APPROVED",
              "REJECTED",
              "UNDER_REVIEW",
              "EXPIRED",
              "CANCELLED"
            ]
          },
          "status_message": {
            "type": "string"
          }
        }
      },
      "OfficialBusinessAccountRequest": {
        "type": "object",
        "properties": {
          "business_website_url": {
            "type": "string",
            "format": "uri"
          },
          "primary_country_of_operation": {
            "type": "string"
          },
          "primary_language": {
            "type": "string"
          },
          "parent_business_or_brand": {
            "type": "string"
          },
          "supporting_links": {
            "type": "array",
            "minItems": 5,
            "maxItems": 10,
            "items": {
              "type": "string"
            },
            "description": "Articles about the business (not paid or own content)."
          },
          "additional_supporting_information": {
            "type": "string"
          }
        },
        "required": [
          "business_website_url",
          "primary_country_of_operation"
        ]
      },
      "OfficialBusinessAccountResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "request_id": {
            "type": "string",
            "example": "k3x9a"
          },
          "official_business_account": {
            "$ref": "#/components/schemas/OfficialBusinessAccount"
          },
          "tracking_id": {
            "type": "string"
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "IndiaCompliance": {
        "type": "object",
        "properties": {
          "entity_name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 128
          },
          "entity_type": {
            "type": "string",
            "enum": [
              "LIMITED_LIABILITY_PARTNERSHIP",
              "SOLE_PROPRIETORSHIP",
              "PARTNERSHIP",
              "PUBLIC_COMPANY",
              "PRIVATE_COMPANY",
              "OTHER"
            ]
          },
          "entity_type_custom": {
            "type": "string",
            "description": "Needed with entity_type OTHER, refused with any other."
          },
          "is_registered": {
            "type": "boolean",
            "description": "Only with entity_type OTHER or PARTNERSHIP."
          },
          "grievance_officer_details": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "email": {
                "type": "string"
              },
              "mobile_number": {
                "type": "string"
              },
              "landline_number": {
                "type": "string"
              }
            },
            "required": [
              "name",
              "email"
            ]
          },
          "customer_care_details": {
            "type": "object",
            "properties": {
              "email": {
                "type": "string"
              },
              "mobile_number": {
                "type": "string"
              },
              "landline_number": {
                "type": "string"
              }
            },
            "required": [
              "email"
            ]
          }
        },
        "required": [
          "entity_name",
          "entity_type",
          "grievance_officer_details",
          "customer_care_details"
        ]
      },
      "IndiaComplianceResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "request_id": {
            "type": "string",
            "example": "k3x9a"
          },
          "india_compliance": {
            "$ref": "#/components/schemas/IndiaCompliance"
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "UsernameRequest": {
        "type": "object",
        "properties": {
          "username": {
            "type": "string",
            "pattern": "^[a-z0-9._]{3,35}$"
          },
          "transfer_action": {
            "type": "string",
            "enum": [
              "none",
              "force_transfer"
            ],
            "description": "force_transfer: move it here from another number of the same business."
          }
        },
        "required": [
          "username"
        ]
      },
      "UsernameResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "request_id": {
            "type": "string",
            "example": "k3x9a"
          },
          "username": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "approved",
              "reserved",
              "none"
            ]
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "UsernameDeleteResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "request_id": {
            "type": "string",
            "example": "k3x9a"
          },
          "deleted": {
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "UsernameSuggestionsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "request_id": {
            "type": "string",
            "example": "k3x9a"
          },
          "suggestions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "count": {
            "type": "integer"
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "ConversationStarters": {
        "type": "object",
        "properties": {
          "prompts": {
            "type": "array",
            "maxItems": 4,
            "items": {
              "type": "string",
              "maxLength": 80
            },
            "description": "Ice breakers. No emoji. [] removes them."
          },
          "commands": {
            "type": "array",
            "maxItems": 30,
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "maxLength": 32
                },
                "description": {
                  "type": "string",
                  "maxLength": 256
                }
              },
              "required": [
                "name",
                "description"
              ]
            },
            "description": "Slash commands. No emoji. [] removes them. Meta's command_name / command_description work too."
          },
          "welcome_message": {
            "type": "boolean",
            "description": "Meta's enable_welcome_message: a request_welcome message when a user opens a chat for the first time."
          }
        }
      },
      "ConversationStartersResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "request_id": {
            "type": "string",
            "example": "k3x9a"
          },
          "conversation_starters": {
            "$ref": "#/components/schemas/ConversationStarters"
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "QrCode": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "prefilled_message": {
            "type": "string",
            "maxLength": 140
          },
          "deep_link_url": {
            "type": "string"
          },
          "qr_image_url": {
            "type": "string",
            "description": "Link to the image (svg or png), when asked for."
          }
        }
      },
      "QrCodeCreateRequest": {
        "type": "object",
        "properties": {
          "prefilled_message": {
            "type": "string",
            "minLength": 1,
            "maxLength": 140
          },
          "image": {
            "type": "string",
            "enum": [
              "svg",
              "png"
            ],
            "default": "svg"
          }
        },
        "required": [
          "prefilled_message"
        ]
      },
      "QrCodeUpdateRequest": {
        "type": "object",
        "properties": {
          "prefilled_message": {
            "type": "string",
            "minLength": 1,
            "maxLength": 140
          }
        },
        "required": [
          "prefilled_message"
        ]
      },
      "QrCodeListResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "request_id": {
            "type": "string",
            "example": "k3x9a"
          },
          "qr_codes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QrCode"
            }
          },
          "count": {
            "type": "integer"
          },
          "next_cursor": {
            "type": "string"
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "QrCodeResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "request_id": {
            "type": "string",
            "example": "k3x9a"
          },
          "qr_code": {
            "$ref": "#/components/schemas/QrCode"
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "QrCodeDeleteResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "request_id": {
            "type": "string",
            "example": "k3x9a"
          },
          "deleted": {
            "type": "boolean"
          },
          "code": {
            "type": "string"
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "CommerceSettings": {
        "type": "object",
        "properties": {
          "cart_enabled": {
            "type": "boolean"
          },
          "catalog_visible": {
            "type": "boolean"
          }
        }
      },
      "CommerceSettingsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "request_id": {
            "type": "string",
            "example": "k3x9a"
          },
          "commerce": {
            "$ref": "#/components/schemas/CommerceSettings"
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "CatalogRequest": {
        "type": "object",
        "properties": {
          "catalog_id": {
            "type": "string",
            "pattern": "^[0-9]{5,32}$"
          }
        },
        "required": [
          "catalog_id"
        ]
      },
      "CatalogResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "request_id": {
            "type": "string",
            "example": "k3x9a"
          },
          "catalog": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            }
          },
          "connected": {
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "request_id"
        ]
      },
      "Partner": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "suspended",
              "closed"
            ]
          },
          "slug": {
            "type": "string"
          },
          "brand_name": {
            "type": "string",
            "nullable": true
          },
          "site_url": {
            "type": "string",
            "description": "Your site: the active own domain, else https://<slug>.app2email.com."
          },
          "custom_domain": {
            "type": "string",
            "nullable": true
          },
          "domain_status": {
            "type": "string"
          },
          "fee_percent": {
            "type": "number",
            "description": "app2email's share of each client payment."
          },
          "stripe": {
            "type": "object",
            "properties": {
              "connected": {
                "type": "boolean"
              },
              "charges_enabled": {
                "type": "boolean"
              },
              "test_mode": {
                "type": "boolean"
              },
              "currency": {
                "type": "string",
                "nullable": true
              }
            }
          },
          "trial": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "messages": {
                "type": "integer"
              },
              "days": {
                "type": "integer"
              }
            }
          },
          "redirect_url": {
            "type": "string",
            "nullable": true,
            "description": "Where Finish of an onboarding link goes when the link names none."
          },
          "created": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        }
      },
      "PartnerResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "partner": {
            "$ref": "#/components/schemas/Partner"
          },
          "key": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "scopes": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "PartnerUpdateRequest": {
        "type": "object",
        "properties": {
          "redirect_url": {
            "type": "string",
            "nullable": true,
            "description": "https only. null removes it."
          },
          "trial": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean",
                "description": "false: a new client number must buy a plan first."
              },
              "messages": {
                "type": "integer",
                "minimum": 10
              },
              "days": {
                "type": "integer",
                "minimum": 1,
                "maximum": 365
              }
            }
          }
        }
      },
      "PartnerClient": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "suspended"
            ]
          },
          "created": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "numbers": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "numbers_count": {
            "type": "integer"
          }
        }
      },
      "PartnerClientsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "clients": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PartnerClient"
            }
          },
          "count": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          }
        }
      },
      "PartnerClientResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "client": {
            "$ref": "#/components/schemas/PartnerClient"
          }
        }
      },
      "PartnerClientCreateRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          },
          "name": {
            "type": "string",
            "maxLength": 100
          },
          "send_invite": {
            "type": "boolean",
            "default": true,
            "description": "true: the client gets your invitation e-mail (its link lets them choose a password)."
          },
          "redirect_url": {
            "type": "string",
            "description": "Where the invitation's Finish goes (https)."
          },
          "state": {
            "type": "string",
            "maxLength": 200
          }
        },
        "required": [
          "email"
        ]
      },
      "PartnerClientCreated": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "client": {
            "$ref": "#/components/schemas/PartnerClient"
          },
          "invite": {
            "type": "object",
            "properties": {
              "sent": {
                "type": "boolean"
              },
              "expires": {
                "type": "string",
                "format": "date-time",
                "nullable": true
              },
              "message": {
                "type": "string"
              }
            },
            "nullable": true
          }
        }
      },
      "PartnerClientUpdateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "suspended"
            ],
            "description": "suspended: logged out of your site, cannot log in."
          }
        }
      },
      "PartnerClientUpdated": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "client": {
            "$ref": "#/components/schemas/PartnerClient"
          },
          "changes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "PartnerSubscription": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "client_id": {
            "type": "string"
          },
          "number": {
            "type": "string",
            "nullable": true
          },
          "tier_id": {
            "type": "string"
          },
          "tier_name": {
            "type": "string"
          },
          "interval": {
            "type": "string",
            "enum": [
              "month",
              "year",
              "none"
            ]
          },
          "messages_per_month": {
            "type": "integer"
          },
          "price": {
            "type": "object",
            "properties": {
              "amount_minor": {
                "type": "integer"
              },
              "currency": {
                "type": "string"
              }
            }
          },
          "status": {
            "type": "string",
            "description": "Stripe's status: active, trialing, past_due, canceled ..."
          },
          "source": {
            "type": "string",
            "enum": [
              "stripe",
              "free",
              "comp"
            ]
          },
          "cancel_at_period_end": {
            "type": "boolean"
          },
          "current_period_start": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "current_period_end": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "is_current": {
            "type": "boolean"
          },
          "canceled_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "ended_reason": {
            "type": "string",
            "nullable": true
          },
          "test_mode": {
            "type": "boolean",
            "description": "Bought through Stripe's test mode (the test site)."
          }
        }
      },
      "PartnerNumber": {
        "type": "object",
        "properties": {
          "number": {
            "type": "string"
          },
          "display_number": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "client_id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "live",
              "pending_payment",
              "not_live"
            ],
            "description": "live: LIVE on a plan with the API. pending_payment: no such plan. not_live: paused, expired or being connected."
          },
          "service_status": {
            "type": "string",
            "nullable": true
          },
          "plan": {
            "type": "string"
          },
          "features": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "description": "The plan's features; null: app2email's own rules."
          },
          "api_allowed": {
            "type": "boolean"
          },
          "plan_messages": {
            "type": "object",
            "properties": {
              "total_sent": {
                "type": "integer"
              },
              "limit": {
                "type": "integer"
              }
            }
          },
          "billing_period_end": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "renewal_enabled": {
            "type": "boolean"
          },
          "subscription": {
            "$ref": "#/components/schemas/PartnerSubscription",
            "nullable": true
          }
        }
      },
      "PartnerNumbersResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "numbers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PartnerNumber"
            }
          },
          "count": {
            "type": "integer"
          }
        }
      },
      "PartnerNumberResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "number": {
            "$ref": "#/components/schemas/PartnerNumber"
          }
        }
      },
      "PartnerUsage": {
        "type": "object",
        "properties": {
          "number": {
            "type": "string"
          },
          "client_id": {
            "type": "string"
          },
          "plan": {
            "type": "string"
          },
          "service_status": {
            "type": "string",
            "nullable": true
          },
          "billing_period": {
            "type": "object",
            "properties": {
              "start": {
                "type": "string",
                "format": "date-time",
                "nullable": true
              },
              "end": {
                "type": "string",
                "format": "date-time",
                "nullable": true
              }
            }
          },
          "plan_messages": {
            "type": "object",
            "properties": {
              "whatsapp_sent": {
                "type": "integer"
              },
              "emails_sent": {
                "type": "integer"
              },
              "total_sent": {
                "type": "integer"
              },
              "limit": {
                "type": "integer"
              },
              "left": {
                "type": "integer"
              }
            }
          },
          "messages_received_this_billing_month": {
            "type": "integer"
          }
        }
      },
      "PartnerNumberUsageResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "usage": {
            "$ref": "#/components/schemas/PartnerUsage"
          }
        }
      },
      "PartnerClientUsageResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "client_id": {
            "type": "string"
          },
          "numbers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PartnerUsage"
            }
          },
          "totals": {
            "type": "object",
            "properties": {
              "total_sent": {
                "type": "integer"
              },
              "whatsapp_sent": {
                "type": "integer"
              },
              "emails_sent": {
                "type": "integer"
              },
              "messages_received": {
                "type": "integer"
              }
            }
          }
        }
      },
      "PartnerNumberKeysResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "number": {
            "type": "string"
          },
          "keys": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountNumberKey"
            }
          },
          "count": {
            "type": "integer"
          }
        }
      },
      "OnboardingLinkRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "description": "Shown on the link's page."
          },
          "name": {
            "type": "string",
            "maxLength": 100
          },
          "client_id": {
            "type": "string",
            "description": "An existing client: only that client can finish it (a client with no password yet chooses one)."
          },
          "state": {
            "type": "string",
            "maxLength": 200,
            "description": "Comes back unchanged in the redirect."
          },
          "redirect_url": {
            "type": "string",
            "description": "https. Default: your redirect_url (PATCH /v1/partner); none: the client's dashboard."
          }
        }
      },
      "OnboardingLinkResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "link": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "expires": {
                "type": "string",
                "format": "date-time"
              },
              "client_id": {
                "type": "string",
                "nullable": true
              },
              "email": {
                "type": "string",
                "nullable": true
              },
              "state": {
                "type": "string",
                "nullable": true
              },
              "redirect_url": {
                "type": "string",
                "nullable": true
              }
            }
          },
          "message": {
            "type": "string"
          }
        }
      },
      "PartnerPayment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "client_id": {
            "type": "string",
            "nullable": true
          },
          "number_id": {
            "type": "integer",
            "nullable": true
          },
          "subscription_id": {
            "type": "integer",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "amount_minor": {
            "type": "integer"
          },
          "refunded_minor": {
            "type": "integer"
          },
          "application_fee_minor": {
            "type": "integer"
          },
          "net_minor": {
            "type": "integer"
          },
          "currency": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "paid, partially_refunded, refunded, disputed ..."
          },
          "billing_reason": {
            "type": "string",
            "nullable": true
          },
          "period_start": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "period_end": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "paid_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "stripe_invoice_id": {
            "type": "string",
            "nullable": true
          },
          "test_mode": {
            "type": "boolean"
          }
        }
      },
      "PartnerPaymentsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "mode": {
            "type": "string",
            "enum": [
              "live",
              "test"
            ]
          },
          "payments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PartnerPayment"
            }
          },
          "count": {
            "type": "integer"
          },
          "totals": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "currency": {
                  "type": "string"
                },
                "count": {
                  "type": "integer"
                },
                "gross_minor": {
                  "type": "integer"
                },
                "fee_minor": {
                  "type": "integer"
                },
                "refunded_minor": {
                  "type": "integer"
                },
                "net_minor": {
                  "type": "integer"
                }
              }
            }
          }
        }
      },
      "PartnerSubscriptionsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "mode": {
            "type": "string",
            "enum": [
              "live",
              "test"
            ]
          },
          "subscriptions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PartnerSubscription"
            }
          },
          "count": {
            "type": "integer"
          }
        }
      },
      "Payment": {
        "type": "object",
        "description": "A payment row. kind booking: the online payment (or deposit) of an appointment; request: a one-off payment request; package: a prepaid package bought online. Money is a number in the payment's currency plus a label such as \"$40.00\". Also inside booking.paid, booking.refunded and payment.paid.",
        "properties": {
          "id": {
            "type": "integer",
            "example": 15
          },
          "kind": {
            "type": "string",
            "enum": [
              "booking",
              "request",
              "package"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "paid",
              "partly_refunded",
              "refunded",
              "failed",
              "expired",
              "cancelled"
            ]
          },
          "provider": {
            "type": "string",
            "enum": [
              "stripe",
              "paypal"
            ]
          },
          "amount": {
            "type": "number",
            "example": 40.0
          },
          "amount_label": {
            "type": "string",
            "example": "$40.00"
          },
          "full_label": {
            "type": "string",
            "description": "The price before a discount."
          },
          "discount_label": {
            "type": "string"
          },
          "coupon_code": {
            "type": "string"
          },
          "currency": {
            "type": "string",
            "example": "USD"
          },
          "refunded": {
            "type": "number"
          },
          "refunded_label": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "contact": {
            "type": "string"
          },
          "payer_name": {
            "type": "string"
          },
          "appointment_id": {
            "type": "integer",
            "nullable": true
          },
          "booking_reference": {
            "type": "string",
            "example": "BK-7Q3M2A"
          },
          "package_purchase_id": {
            "type": "integer",
            "nullable": true
          },
          "checkout_url": {
            "type": "string",
            "description": "The provider's checkout page while the payment is open. Empty otherwise."
          },
          "link_url": {
            "type": "string",
            "description": "A payment request's page on the business's booking site."
          },
          "last_error": {
            "type": "string"
          },
          "paid": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "refunded_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "created": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PaymentResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "payment": {
            "$ref": "#/components/schemas/Payment"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "PaymentsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "payments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Payment"
            },
            "description": "Newest first."
          },
          "count": {
            "type": "integer"
          },
          "next_cursor": {
            "type": "string",
            "description": "Pass it as cursor for the next page. Left out on the last page."
          },
          "currency": {
            "type": "string"
          }
        }
      },
      "PaymentLinkRequest": {
        "type": "object",
        "required": [
          "contact",
          "amount",
          "description"
        ],
        "properties": {
          "contact": {
            "type": "string",
            "example": "61412345678",
            "description": "The customer's WhatsApp number with country code, digits only, or their business-scoped user id."
          },
          "amount": {
            "type": "number",
            "example": 40,
            "description": "In the business's payment currency (config.payments.currency)."
          },
          "description": {
            "type": "string",
            "example": "Deposit for your colour",
            "description": "Shown to the customer."
          },
          "booking_id": {
            "type": "string",
            "example": "BK-7Q3M2A",
            "description": "The appointment it is for (id or reference)."
          },
          "name": {
            "type": "string"
          },
          "send": {
            "type": "boolean",
            "default": false,
            "description": "Also send the link to the customer on WhatsApp (a message with a Pay button, only inside their 24 hour window)."
          }
        }
      },
      "PaymentLinkResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "payment": {
            "$ref": "#/components/schemas/Payment"
          },
          "url": {
            "type": "string",
            "example": "https://www.app2email.com/book/k3XbQ9rTzP2m",
            "description": "The page where the customer pays."
          },
          "sent": {
            "type": "boolean",
            "description": "The link was sent on WhatsApp."
          },
          "note": {
            "type": "string"
          }
        }
      },
      "RefundRequest": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "example": 10,
            "description": "A part of the money, in the payment's currency. Left out: everything that is left."
          }
        }
      },
      "BookingPaymentStatusRequest": {
        "type": "object",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "paid",
              "waived",
              "due"
            ],
            "description": "paid: taken outside app2email (cash, a terminal). waived: nothing to pay. due: still expected (the service's price is the amount when none is recorded)."
          }
        }
      },
      "PackageOnSale": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "ten-pack"
          },
          "name": {
            "type": "string",
            "example": "10 sessions"
          },
          "description": {
            "type": "string"
          },
          "sessions": {
            "type": "integer",
            "example": 10
          },
          "price_amount": {
            "type": "number",
            "example": 400
          },
          "price_label": {
            "type": "string",
            "example": "$400.00"
          },
          "valid_days": {
            "type": "integer",
            "description": "0 = never expires."
          },
          "services": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The services it covers. Empty: every service."
          }
        }
      },
      "PackagesResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "packages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PackageOnSale"
            }
          },
          "count": {
            "type": "integer"
          },
          "currency": {
            "type": "string"
          }
        }
      },
      "PackagePurchase": {
        "type": "object",
        "description": "Prepaid sessions a customer holds. Using one on a booking (POST /bookings with use_package) takes a session; a cancellation by the business gives it back. Also in package.purchased.",
        "properties": {
          "id": {
            "type": "integer",
            "example": 5
          },
          "contact": {
            "type": "string"
          },
          "contact_name": {
            "type": "string"
          },
          "package_id": {
            "type": "string"
          },
          "package_name": {
            "type": "string"
          },
          "services": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sessions_total": {
            "type": "integer"
          },
          "sessions_used": {
            "type": "integer"
          },
          "sessions_left": {
            "type": "integer"
          },
          "expires": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "active",
              "used_up",
              "expired",
              "refunded",
              "cancelled"
            ]
          },
          "payment_id": {
            "type": "integer",
            "nullable": true
          },
          "created": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PackagePurchasesResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "purchases": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PackagePurchase"
            }
          },
          "count": {
            "type": "integer"
          }
        }
      },
      "PackageGrantRequest": {
        "type": "object",
        "required": [
          "contact",
          "package_id"
        ],
        "properties": {
          "contact": {
            "type": "string",
            "example": "61412345678"
          },
          "package_id": {
            "type": "string",
            "example": "ten-pack",
            "description": "One of GET /bookings/packages."
          },
          "sessions": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "description": "Default: the package's sessions."
          },
          "name": {
            "type": "string"
          }
        }
      },
      "PackageGrantResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "purchase": {
            "$ref": "#/components/schemas/PackagePurchase"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "CustomerSummary": {
        "type": "object",
        "properties": {
          "contact": {
            "type": "string",
            "example": "61412345678"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "visits": {
            "type": "integer"
          },
          "no_shows": {
            "type": "integer"
          },
          "upcoming": {
            "type": "integer"
          },
          "last_visit": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "next_start": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "packages_left": {
            "type": "integer"
          },
          "total_paid_label": {
            "type": "string",
            "example": "$120.00"
          }
        }
      },
      "CustomersResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "customers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerSummary"
            }
          },
          "count": {
            "type": "integer"
          },
          "next_cursor": {
            "type": "string",
            "description": "Pass it as cursor for the next page. Left out on the last page."
          }
        }
      },
      "CustomerProfile": {
        "type": "object",
        "description": "Everything about one customer, for a prep brief or an agent: the contact (name, e-mail, tags, custom fields, consent), stats (visits, no-shows, cancellations, total paid, first seen, last visit), upcoming appointments and the past 50, internal notes and reminders, packages with sessions left, payments and the last 20 messages of the conversation.",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "customer": {
            "type": "object",
            "additionalProperties": true
          },
          "stats": {
            "type": "object",
            "additionalProperties": true
          },
          "upcoming": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "past": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "notes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Note"
            }
          },
          "reminders": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Note"
            },
            "description": "Notes with a remind_at that is due."
          },
          "packages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PackagePurchase"
            }
          },
          "payments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Payment"
            }
          },
          "messages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "direction": {
                  "type": "string",
                  "enum": [
                    "in",
                    "out"
                  ]
                },
                "text": {
                  "type": "string"
                },
                "time": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            }
          }
        }
      },
      "CustomerPatchRequest": {
        "type": "object",
        "description": "Any of these; what is left out stays. The e-mail also goes onto the customer's upcoming confirmed appointments.",
        "properties": {
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "custom_fields": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "CustomerResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "customer": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "CustomerEraseResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "erased": {
            "type": "boolean"
          },
          "note": {
            "type": "string"
          },
          "counts": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            },
            "description": "appointments, cancelled, notes, links, holds, votes, packages, payments."
          }
        }
      },
      "Poll": {
        "type": "object",
        "description": "A meeting poll: 2 to 10 possible times people vote on at the poll's page (url). The times are not held.",
        "properties": {
          "id": {
            "type": "integer",
            "example": 12
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "service_id": {
            "type": "string"
          },
          "provider_id": {
            "type": "string"
          },
          "duration_min": {
            "type": "integer"
          },
          "options": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "example": "a"
                },
                "start": {
                  "type": "string",
                  "format": "date-time"
                },
                "end": {
                  "type": "string",
                  "format": "date-time"
                },
                "start_local": {
                  "type": "string"
                },
                "end_local": {
                  "type": "string"
                },
                "votes": {
                  "type": "integer"
                },
                "voters": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "votes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "contact": {
                  "type": "string"
                },
                "email": {
                  "type": "string"
                },
                "choices": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "comment": {
                  "type": "string"
                },
                "created": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            }
          },
          "contact": {
            "type": "string",
            "description": "The main customer, when there is one."
          },
          "contact_name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "closed",
              "booked"
            ]
          },
          "chosen_option": {
            "type": "string"
          },
          "appointment_id": {
            "type": "integer",
            "nullable": true
          },
          "url": {
            "type": "string"
          },
          "closes": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "created": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PollResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "poll": {
            "$ref": "#/components/schemas/Poll"
          },
          "url": {
            "type": "string"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "PollsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "polls": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Poll"
            }
          },
          "count": {
            "type": "integer"
          }
        }
      },
      "PollCreateRequest": {
        "type": "object",
        "required": [
          "title",
          "options"
        ],
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 120,
            "example": "Team planning"
          },
          "description": {
            "type": "string",
            "maxLength": 1000
          },
          "options": {
            "type": "array",
            "minItems": 2,
            "maxItems": 10,
            "items": {
              "type": "string"
            },
            "example": [
              "2026-11-12T10:00",
              "2026-11-12T14:00",
              "2026-11-13T09:00"
            ],
            "description": "Start times: local time in the business time zone (yyyy-MM-ddTHH:mm) or ISO 8601 with an offset. Each must be free now."
          },
          "service_id": {
            "type": "string",
            "example": "consultation",
            "description": "Its length is used. Give this or duration_min."
          },
          "duration_min": {
            "type": "integer",
            "minimum": 5,
            "maximum": 480
          },
          "provider_id": {
            "type": "string"
          },
          "contact": {
            "type": "string",
            "description": "The main customer: booking the poll then makes an appointment for them. Left out: the time is blocked."
          },
          "name": {
            "type": "string"
          },
          "closes_at": {
            "type": "string",
            "format": "date-time",
            "description": "When voting ends."
          }
        }
      },
      "PollBookRequest": {
        "type": "object",
        "required": [
          "option_id"
        ],
        "properties": {
          "option_id": {
            "type": "string",
            "example": "c",
            "description": "One of the poll's options[].id."
          },
          "notify": {
            "type": "boolean",
            "default": true,
            "description": "Tell the customer on WhatsApp (when the poll has a contact)."
          }
        }
      },
      "PollBookResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "poll": {
            "$ref": "#/components/schemas/Poll"
          },
          "booking": {
            "$ref": "#/components/schemas/Booking",
            "nullable": true
          },
          "block": {
            "$ref": "#/components/schemas/Block",
            "nullable": true
          },
          "note": {
            "type": "string"
          }
        }
      },
      "OptimizationSpec": {
        "type": "object",
        "description": "Marketing max price (Meta: 'max price'). Needs the WhatsApp account enrolled in Meta's max price feature (Marketing Messages API). Both fields null: back to rate card pricing. Replaces bid_spec (not accepted since 31 Jul 2026).",
        "required": [
          "bid_amount",
          "bid_strategy"
        ],
        "properties": {
          "bid_amount": {
            "type": "integer",
            "nullable": true,
            "example": 5000,
            "description": "Most WhatsApp may charge per 1,000 deliveries, in the smallest unit of the account's currency (5000 = USD 0.05 a message)."
          },
          "bid_strategy": {
            "type": "string",
            "nullable": true,
            "enum": [
              "LOWEST_COST_WITH_BID_CAP"
            ]
          },
          "bid_country_multiplier_overrides": {
            "type": "object",
            "additionalProperties": {
              "type": "number"
            },
            "example": {
              "IN": 1.2,
              "MX": 0.8
            },
            "description": "Country (ISO 3166-1 alpha-2) -> multiplier (above 0, at most 10), up to 240. Replaces the whole map; {} removes it."
          }
        }
      },
      "TemplateEditRequest": {
        "type": "object",
        "description": "Only what changes. components replace all components. An APPROVED template: at most 1 edit a day and 10 in 30 days, category fixed.",
        "properties": {
          "components": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            },
            "description": "All components, in WhatsApp's format. A media header may use example.header_sample_url (a public link)."
          },
          "category": {
            "type": "string",
            "enum": [
              "MARKETING",
              "UTILITY",
              "AUTHENTICATION"
            ],
            "description": "Not for APPROVED templates."
          },
          "message_send_ttl_seconds": {
            "type": "integer",
            "description": "How long WhatsApp tries to deliver (Meta's ranges per category)."
          },
          "cta_url_link_tracking_opted_out": {
            "type": "boolean",
            "description": "true: no click tracking on URL buttons."
          },
          "parameter_format": {
            "type": "string",
            "enum": [
              "NAMED",
              "POSITIONAL"
            ]
          },
          "sub_category": {
            "type": "string",
            "example": "ORDER_STATUS"
          },
          "display_format": {
            "type": "string",
            "example": "ORDER_DETAILS"
          },
          "is_primary_device_delivery_only": {
            "type": "boolean"
          },
          "optimization_spec": {
            "$ref": "#/components/schemas/OptimizationSpec"
          },
          "allow_category_change": {
            "type": "boolean",
            "description": "Passed on; Meta ignores it since 9 Apr 2025."
          }
        }
      },
      "TemplateEditResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "template": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "language": {
                "type": "string"
              },
              "previous_status": {
                "type": "string"
              }
            }
          },
          "changed": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "note": {
            "type": "string"
          }
        }
      },
      "TemplateBulkDeleteRequest": {
        "type": "object",
        "description": "names (every language of each) or ids (one language each), not both. At most 100 template languages.",
        "properties": {
          "names": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 100
          },
          "ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 100
          }
        }
      },
      "TemplateBulkDeleteResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "deleted": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "language": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                }
              }
            }
          },
          "note": {
            "type": "string"
          }
        }
      },
      "TemplateArchiveResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "archived": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "language": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                }
              }
            },
            "description": "archive only."
          },
          "unarchived": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "language": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                }
              }
            },
            "description": "unarchive only."
          },
          "failed": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "language": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                }
              }
            }
          },
          "note": {
            "type": "string"
          }
        }
      },
      "TemplateCompareResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "template": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "language": {
                "type": "string"
              },
              "id": {
                "type": "string"
              }
            }
          },
          "with": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "language": {
                "type": "string"
              },
              "id": {
                "type": "string"
              }
            }
          },
          "days": {
            "type": "integer"
          },
          "since": {
            "type": "string",
            "format": "date-time"
          },
          "until": {
            "type": "string",
            "format": "date-time"
          },
          "metrics": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            },
            "description": "Meta's comparison as it comes: BLOCK_RATE (order), MESSAGE_SENDS, TOP_BLOCK_REASON, by template id."
          }
        }
      },
      "TemplateAuthUpsertRequest": {
        "type": "object",
        "required": [
          "languages"
        ],
        "description": "languages + otp_type (app2email builds the components), or languages + components (WhatsApp's own).",
        "properties": {
          "languages": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "en_US",
              "es_ES",
              "fr"
            ]
          },
          "otp_type": {
            "type": "string",
            "enum": [
              "COPY_CODE",
              "ONE_TAP",
              "ZERO_TAP"
            ]
          },
          "add_security_recommendation": {
            "type": "boolean",
            "description": "Adds 'For your security, do not share this code.'"
          },
          "code_expiration_minutes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 90,
            "description": "Adds the expiry footer."
          },
          "supported_apps": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "package_name": {
                  "type": "string"
                },
                "signature_hash": {
                  "type": "string"
                }
              }
            },
            "description": "ONE_TAP and ZERO_TAP: 1 to 5 Android apps."
          },
          "zero_tap_terms_accepted": {
            "type": "boolean",
            "description": "ZERO_TAP: must be true."
          },
          "components": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            },
            "description": "Instead of the fields above: BODY, FOOTER, BUTTONS in WhatsApp's format."
          },
          "message_send_ttl_seconds": {
            "type": "integer",
            "minimum": 30,
            "maximum": 900
          }
        }
      },
      "TemplateAuthUpsertResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "templates": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "language": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                }
              }
            }
          },
          "note": {
            "type": "string"
          }
        }
      },
      "TemplatePreviewsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "previews": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "language": {
                  "type": "string"
                },
                "body": {
                  "type": "string"
                },
                "footer": {
                  "type": "string"
                },
                "buttons": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              }
            }
          }
        }
      },
      "TemplateLibraryResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "templates": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            },
            "description": "Meta's library templates as they come (name, language, category, topic, usecase, industry, header, body, body_params, buttons, id)."
          },
          "next_cursor": {
            "type": "string",
            "nullable": true
          },
          "note": {
            "type": "string"
          }
        }
      },
      "TemplateInsightsEnableRequest": {
        "type": "object",
        "required": [
          "confirm"
        ],
        "properties": {
          "confirm": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "Must be true: switching insights on cannot be undone."
          }
        }
      },
      "TemplateInsightsEnableResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "TemplateInsightsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "since": {
            "type": "string",
            "format": "date"
          },
          "until": {
            "type": "string",
            "format": "date"
          },
          "product": {
            "type": "string",
            "enum": [
              "cloud_api",
              "marketing_messages"
            ]
          },
          "templates": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "language": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                }
              }
            }
          },
          "data_points": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "template": {
                  "type": "string"
                },
                "language": {
                  "type": "string"
                },
                "template_id": {
                  "type": "string"
                },
                "date": {
                  "type": "string",
                  "format": "date"
                },
                "sent": {
                  "type": "integer"
                },
                "delivered": {
                  "type": "integer"
                },
                "read": {
                  "type": "integer"
                },
                "clicked": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "description": "Per button: {type, button_content, count}."
                },
                "cost": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "description": "{type: amount_spent | cost_per_delivered | cost_per_url_button_click, value}."
                }
              }
            }
          },
          "note": {
            "type": "string"
          }
        }
      },
      "WebhookTestUrlRequest": {
        "type": "object",
        "required": [
          "url"
        ],
        "description": "One test POST to any https URL. Leave out data and raw for the sample of type.",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "example": "https://hooks.example.com/app2email",
            "description": "https only. A private address answers result.stage blocked_address."
          },
          "type": {
            "type": "string",
            "default": "ping",
            "example": "message.received",
            "description": "ping or a number event type (x-a2e-webhook-events, not the Partner group)."
          },
          "data": {
            "type": "object",
            "additionalProperties": true,
            "description": "Your own event data, sent in the normal envelope (at most 16 KB in all)."
          },
          "raw": {
            "type": "object",
            "additionalProperties": true,
            "description": "Sent as the whole body instead of an envelope."
          },
          "secret": {
            "type": "string",
            "maxLength": 200,
            "description": "Signs the test. Leave out for a new random one (answered in sent.secret)."
          },
          "format": {
            "type": "string",
            "enum": [
              "app2email",
              "meta"
            ],
            "default": "app2email",
            "description": "meta: the events that come from WhatsApp as Meta's own webhook body."
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Up to 5 custom headers, the same rules as a webhook's."
          }
        }
      },
      "WebhookTestUrlResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "sent": {
            "type": "object",
            "properties": {
              "method": {
                "type": "string"
              },
              "url": {
                "type": "string"
              },
              "headers": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                },
                "description": "Every header sent, both signatures included."
              },
              "body": {
                "type": "string",
                "description": "The body exactly as sent and signed."
              },
              "secret": {
                "type": "string"
              },
              "secret_generated": {
                "type": "boolean",
                "description": "true: no secret was given, this one is new."
              }
            }
          },
          "result": {
            "type": "object",
            "properties": {
              "ok": {
                "type": "boolean",
                "description": "Your URL answered 2xx within 10 seconds."
              },
              "stage": {
                "type": "string",
                "enum": [
                  "response",
                  "dns",
                  "connect",
                  "tls",
                  "timeout",
                  "blocked_address"
                ],
                "description": "response: your URL answered (see status). Otherwise where it failed."
              },
              "status": {
                "type": "integer"
              },
              "ms": {
                "type": "integer"
              },
              "headers": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                },
                "description": "A few of the answer's headers (Content-Type, Date, Server, Location, Retry-After ...)."
              },
              "body": {
                "type": "string",
                "description": "The first 1000 characters of the answer."
              },
              "body_truncated": {
                "type": "boolean"
              },
              "message": {
                "type": "string",
                "description": "What went wrong, in plain words."
              }
            }
          }
        }
      },
      "WebhookCatcher": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "description": "POST anything here: https://api.app2email.com/hooks/catch/<token>."
          },
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "expires": {
            "type": "string",
            "format": "date-time"
          },
          "requests": {
            "type": "integer",
            "description": "How many it has received."
          },
          "full": {
            "type": "boolean",
            "description": "It has 50 requests: the next ones get 429."
          }
        }
      },
      "WebhookCatcherCreated": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "token": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "expires": {
            "type": "string",
            "format": "date-time"
          },
          "limits": {
            "type": "object",
            "properties": {
              "requests": {
                "type": "integer"
              },
              "body_max_bytes": {
                "type": "integer"
              },
              "minutes": {
                "type": "integer"
              }
            }
          },
          "note": {
            "type": "string"
          }
        }
      },
      "WebhookCatchersResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "catchers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookCatcher"
            }
          },
          "limits": {
            "type": "object",
            "properties": {
              "catchers": {
                "type": "integer"
              },
              "requests": {
                "type": "integer"
              },
              "body_max_bytes": {
                "type": "integer"
              }
            }
          }
        }
      },
      "WebhookCaughtRequest": {
        "type": "object",
        "properties": {
          "seq": {
            "type": "integer",
            "description": "1, 2, 3 ... in the order received."
          },
          "received": {
            "type": "string",
            "format": "date-time"
          },
          "method": {
            "type": "string"
          },
          "ip": {
            "type": "string",
            "description": "The sender's address; empty for app2email's own deliveries."
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "body": {
            "type": "string",
            "description": "The body as text."
          },
          "body_truncated": {
            "type": "boolean",
            "description": "true: app2email's own delivery was larger than 64 KB and is kept cut."
          }
        }
      },
      "WebhookCatcherResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "token": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "expires": {
            "type": "string",
            "format": "date-time"
          },
          "full": {
            "type": "boolean"
          },
          "count": {
            "type": "integer"
          },
          "requests": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookCaughtRequest"
            },
            "description": "Oldest first; with after, only the later ones."
          }
        }
      },
      "WebhookCatcherDeleteResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "request_id": {
            "type": "string"
          },
          "deleted": {
            "type": "string"
          }
        }
      },
      "NumberWebhookTestRequest": {
        "type": "object",
        "description": "Optional. No body: a ping. type: that event's sample (GET .../webhooks/samples). event: the event you give, as it is (a missing id, created or number is filled in).",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "ping",
              "message.status",
              "message.received",
              "message.failed",
              "contact.opted_out",
              "broadcast.completed",
              "usage.threshold",
              "template.status_changed",
              "conversation.owner_changed",
              "message.held_for_approval",
              "approval.resolved",
              "contact.updated",
              "booking.created",
              "booking.cancelled",
              "booking.rescheduled",
              "booking.rated",
              "flow.completed",
              "booking.updated",
              "booking.note.created",
              "calendar.block.created",
              "calendar.block.deleted",
              "call.incoming",
              "call.status",
              "message.edited",
              "message.deleted",
              "contact.changed_number",
              "number.updated",
              "number.error",
              "flow.status_changed",
              "booking.paid",
              "booking.refunded",
              "payment.paid",
              "package.purchased",
              "poll.voted",
              "poll.closed",
              "booking.customer.erased"
            ],
            "example": "message.received"
          },
          "event": {
            "$ref": "#/components/schemas/WebhookEvent"
          }
        }
      }
    }
  },
  "x-a2e-mcp-servers": [
    {
      "name": "messaging",
      "url": "https://api.app2email.com/mcp",
      "auth": "Authorization: Bearer <number API key>",
      "transport": "streamable-http",
      "protocol_versions": [
        "2026-07-28",
        "2025-11-25",
        "2025-06-18",
        "2025-03-26",
        "2024-11-05"
      ],
      "documentation": "https://www.app2email.com/docs/api/mcp",
      "tools": [
        {
          "name": "check_key",
          "title": "Check the API key",
          "description": "Check the key: its scopes, the number, the plan and the limits. Works with any valid key, whatever its scopes. Use it for a 'test connection' step in Zapier, Make, n8n or Power Automate. Call this first.",
          "read_only": true,
          "destructive": false,
          "operation_id": "getMe"
        },
        {
          "name": "list_templates",
          "title": "List message templates",
          "description": "List your templates, with an example request for each. All templates of the number's WhatsApp account: status, category, what values each needs, and for approved templates a complete example request. Templates are the only way to start a conversation or to write outside the 24 hour reply window.",
          "read_only": true,
          "destructive": false,
          "operation_id": "listTemplates"
        },
        {
          "name": "get_template",
          "title": "Get one template",
          "description": "One template: status, rejection reason, what it needs. Every language of the template. Not from a cache: a status that just changed shows. With every field Meta keeps (sub_category, previous_category, TTL, link tracking, library name).",
          "read_only": true,
          "destructive": false,
          "operation_id": "getTemplate"
        },
        {
          "name": "send_template",
          "title": "Send a template message",
          "description": "Send an approved WhatsApp template to one number, a list of numbers, or a saved segment of contacts. This sends real messages and counts against the customer's plan: run it with dry_run=true first (nothing is sent, the exact message per number is returned), then with dry_run=false and an idempotency_key. Templates work at any time; they are the only option when the contact's 24 hour window is closed. Optional, templates only: send later. ISO 8601 with a time zone ('Z' or '+11:00'), 1 minute to 29 days ahead. The answer is HTTP 202 with status 'scheduled'.",
          "read_only": false,
          "destructive": true,
          "operation_id": "sendTemplateMessage"
        },
        {
          "name": "send_text",
          "title": "Send a text reply (24 hour window)",
          "description": "Send a free-form text message to ONE contact. Only possible within 24 hours of that contact's last message to this number (get_conversation shows window_state); outside the window the API answers 422 outside_24h_window and you must use send_template instead. Counts as one message of the plan. Use an idempotency_key.",
          "read_only": false,
          "destructive": true,
          "operation_id": "sendTemplateMessage"
        },
        {
          "name": "send_media",
          "title": "Send an image, video or document (24 hour window)",
          "description": "Send a free-form image, video or document by public link to ONE contact, within the 24 hour reply window (otherwise 422 outside_24h_window: use a template with a media header). WhatsApp limits: images (JPG/PNG) 5 MB, videos (MP4/3GP) 16 MB, documents 100 MB. Counts as one message of the plan.",
          "read_only": false,
          "destructive": true,
          "operation_id": "sendTemplateMessage"
        },
        {
          "name": "send_interactive",
          "title": "Send buttons or a list (24 hour window)",
          "description": "Send an interactive message (reply buttons, a list, or a call-to-action URL button) to ONE contact within the 24 hour reply window. 'interactive' is the WhatsApp Cloud API interactive object: {type: \"button\", body: {text}, action: {buttons: [{type: \"reply\", reply: {id, title}}]}}, {type: \"list\", body: {text}, action: {button, sections: [{title, rows: [{id, title, description?}]}]}}, or {type: \"cta_url\", body: {text}, action: {name: \"cta_url\", parameters: {display_text, url}}}. The contact's tap comes back as a message (list_messages, message.received webhook). Counts as one message of the plan.",
          "read_only": false,
          "destructive": true,
          "operation_id": "sendTemplateMessage"
        },
        {
          "name": "get_message",
          "title": "Status of a sent message",
          "description": "Status of a sent message. Any message sent from the number (API, Broadcast page, email replies): status, the time of each step, why it failed, and the contact's reply or button tap.",
          "read_only": true,
          "destructive": false,
          "operation_id": "getMessageStatus"
        },
        {
          "name": "list_messages",
          "title": "Messages sent and received",
          "description": "Messages sent and received, newest first. Messages sent from the number (`direction` out, with their status and times) and received from contacts (`direction` in). Filters: a time window, the direction, the status of sent messages, one contact, or one broadcast. Page with `next_cursor`. Paged: pass next_cursor from the answer as cursor for the next page.",
          "read_only": true,
          "destructive": false,
          "operation_id": "listMessages"
        },
        {
          "name": "list_conversations",
          "title": "Contacts, most recent first",
          "description": "The contacts, most recent activity first. One entry per contact, with the last message in each direction and whether a free-form reply can be sent now (window_open). window_open says whether a free-form reply can be sent to that contact now.",
          "read_only": true,
          "destructive": false,
          "operation_id": "listConversations"
        },
        {
          "name": "get_conversation",
          "title": "One contact: window state and owner",
          "description": "One contact's conversation: window_state (open: a free-form reply can be sent now; closed: use a template), window_closes_at, the owner (\"\" = default routing, agent, human, paused: see set_conversation_owner), the contact's name, and the times of their last message and your last message. Check it before replying.",
          "read_only": true,
          "destructive": false,
          "operation_id": "getConversation"
        },
        {
          "name": "get_conversation_messages",
          "title": "One contact's messages",
          "description": "One contact's messages, both directions. The messages with one contact, newest first. window_open says whether a free-form reply can be sent now. Newest first; window_open is in the answer.",
          "read_only": true,
          "destructive": false,
          "operation_id": "listConversationMessages"
        },
        {
          "name": "set_conversation_owner",
          "title": "Hand a conversation over (owner)",
          "description": "Set who owns a contact's conversation. \"human\": a person takes over - the auto reply and the A2A / OpenClaw agent stop answering this contact (the email bridge still forwards); \"agent\": an automation owns it; \"paused\": nothing automatic is sent; \"\": back to the number's default routing. Give a reason and a short summary of the conversation so far: both are shown to the person taking over (handoff email, dashboard) and sent as the conversation.owner_changed webhook event. until_minutes: the owner goes back to default after that time.",
          "read_only": false,
          "destructive": true,
          "operation_id": "setConversationOwner"
        },
        {
          "name": "list_contacts",
          "title": "Search contacts",
          "description": "The number's contacts (name, tags, custom fields, marketing consent, last message times). Search with q, filter by tag. Paged with cursor.",
          "read_only": true,
          "destructive": false,
          "operation_id": "listContacts"
        },
        {
          "name": "upsert_contact",
          "title": "Add or update a contact",
          "description": "Create a contact, or update the one with this identity: name, tags, custom fields (used as template values in segment sends) and marketing consent with its evidence (who agreed to what, where, when - keep it, it is the Spam Act record).",
          "read_only": false,
          "destructive": true,
          "operation_id": "upsertContacts"
        },
        {
          "name": "get_usage",
          "title": "Plan usage and Meta costs",
          "description": "Plan, messages used and left, limits, what WhatsApp charges. WhatsApp messages used and left this billing month, the billing period, the most numbers per send request, your own monthly cap, and `meta_pricing`: the month's messages by Meta's pricing category with an indicative cost. Includes meta_pricing: this month's messages by Meta pricing category (service, utility, marketing) and an indicative Meta cost.",
          "read_only": true,
          "destructive": false,
          "operation_id": "getUsage"
        },
        {
          "name": "list_broadcasts",
          "title": "Latest broadcasts",
          "description": "Your latest broadcasts. Broadcasts sent through the API (several numbers) and from the Broadcast page, newest first.",
          "read_only": true,
          "destructive": false,
          "operation_id": "listBroadcasts"
        },
        {
          "name": "get_broadcast",
          "title": "A broadcast's status and results",
          "description": "A broadcast's status and the result per number. Counts and the result for each number, live while a background send runs.",
          "read_only": true,
          "destructive": false,
          "operation_id": "getBroadcast"
        },
        {
          "name": "cancel_broadcast",
          "title": "Cancel a scheduled or sending broadcast",
          "description": "Cancel a scheduled or sending API broadcast. Needs the 'messages:send' scope. A scheduled broadcast (send_at) is removed: nothing is sent (200). A broadcast that is sending now (API list, background or scheduled): the messages not yet handed to WhatsApp are not sent, those already sent stay sent (202, status cancelling). Broadcasts started from the dashboard, and finished ones, cannot be cancelled here (409 broadcast_not_cancellable). broadcast.completed is sent with data.status cancelled. Messages already sent are not recalled.",
          "read_only": false,
          "destructive": true,
          "operation_id": "cancelBroadcast"
        },
        {
          "name": "list_donotcall",
          "title": "The Do Not Call list",
          "description": "The Do Not Call list, or check one number. The whole list, or with ?number= whether that number is on it. Marketing templates are never sent to numbers on it.",
          "read_only": true,
          "destructive": false,
          "operation_id": "listDoNotCall"
        },
        {
          "name": "add_donotcall",
          "title": "Add numbers to the Do Not Call list",
          "description": "Add numbers to the Do Not Call list. Up to 1000 numbers, with an optional name and note each. Numbers already on the list are left as they are. All or nothing: one invalid number, nothing is added. Use it when a contact asks to stop receiving messages.",
          "read_only": false,
          "destructive": true,
          "operation_id": "addDoNotCall"
        },
        {
          "name": "remove_donotcall",
          "title": "Remove a number from the Do Not Call list",
          "description": "Remove a number from the Do Not Call list. Only when the contact has clearly agreed to receive messages again.",
          "read_only": false,
          "destructive": true,
          "operation_id": "removeDoNotCall"
        },
        {
          "name": "list_approvals",
          "title": "Sends waiting for approval",
          "description": "Sends held for approval: a key with an approval threshold (approval_above) holds any send to more numbers than that until a person approves it on the dashboard or approve_send is called with a key that may. Shows what is waiting, with its approval_url.",
          "read_only": true,
          "destructive": false,
          "operation_id": "listApprovals"
        },
        {
          "name": "approve_send",
          "title": "Approve a held send",
          "description": "Approve a send that is waiting (list_approvals): the messages go out now. Needs a key without an approval threshold and with messages:send. Do this only when a person has confirmed it.",
          "read_only": false,
          "destructive": true,
          "operation_id": "approveSend"
        },
        {
          "name": "list_bookings",
          "title": "The appointments",
          "description": "The appointments, soonest start first. Scope: `bookings:manage` (or `messages:read`). Booked on WhatsApp, from the dashboard or through the API. Filter by a range of days (business time zone) or times, a status, or one contact; `order=desc` for the latest start first. Page with `next_cursor`. Pass from=today for the upcoming ones, status to filter, contact for one customer. Paged: pass next_cursor as cursor.",
          "read_only": true,
          "destructive": false,
          "operation_id": "listBookings"
        },
        {
          "name": "get_booking_availability",
          "title": "Free appointment slots",
          "description": "The free slots per day for a service, as the customer would see them. Scope: `bookings:manage` (or `messages:read`). Every day of the range (at most 32 days, default today + 6) with its free start times: the opening hours, the closed days, the booked appointments and the calendar's busy time applied. Each slot's `id` is the local time `POST /bookings` takes as `start`. With staff members, `providers` names who is free; `provider_id` asks for one member's own availability. Each slot's id (local time yyyy-MM-ddTHH:mm) is what create_booking takes as start. At most 32 days per call.",
          "read_only": true,
          "destructive": false,
          "operation_id": "getBookingAvailability"
        },
        {
          "name": "create_booking",
          "title": "Book an appointment",
          "description": "Book an appointment for a customer at a free slot. Scope: `bookings:manage`. Not with a sandbox key. The slot must be one of GET /bookings/availability (on the grid, inside the hours, free; the business's own minimum notice does not apply). The customer gets the confirmation on WhatsApp (a text with a calendar file inside their 24 hour window, else the booking confirmation template) unless `notify` is false; the business gets an email, the calendar event is written, and `booking.created` is sent (with `hold: true` when made from a hold). 409 `booking_slot_taken` when the time went meanwhile. To book a time kept with POST /bookings/holds, send its `hold` reference. Send an `Idempotency-Key` header to retry safely: the same key and body within... The customer gets the confirmation on WhatsApp (a text inside their 24 hour window, else the booking confirmation template) unless notify is false; the business gets an email and the booking.created event. Check the slot with get_booking_availability first and confirm the details with the user.",
          "read_only": false,
          "destructive": true,
          "operation_id": "createBooking"
        },
        {
          "name": "cancel_booking",
          "title": "Cancel an appointment",
          "description": "Cancel an appointment. Scope: `bookings:manage`. Not with a sandbox key. The calendar event is removed, `booking.cancelled` is sent, and the customer is told on WhatsApp (a text inside their 24 hour window, else the cancellation template) unless `notify` is false. 409 `booking_cancelled` when it already was. The customer is told on WhatsApp unless notify is false; the calendar event is removed and booking.cancelled is sent. Confirm with the user first.",
          "read_only": false,
          "destructive": true,
          "operation_id": "cancelBooking"
        },
        {
          "name": "set_booking_status",
          "title": "Mark an appointment completed or a no-show",
          "description": "Mark an appointment completed, a no-show, or back to confirmed. Scope: `bookings:manage`. Not with a sandbox key. Completed appointments get the follow-up message (aftercare and the rating buttons) when the business turned it on; the reports count both. An appointment that is not marked is completed by itself 24 hours after its end. A cancelled appointment cannot be marked (409 `booking_cancelled`). Use it after the appointment time: the reports count completed visits and no-shows, and the follow-up message goes to completed ones.",
          "read_only": false,
          "destructive": true,
          "operation_id": "setBookingStatus"
        },
        {
          "name": "get_booking_settings",
          "title": "The booking settings",
          "description": "The booking settings, the default Flow's status and every Flow. Scope: `bookings:manage` (or `messages:read`). Every key of the configuration with its value (defaults filled in): the trigger words, the hours, the services, the messages, the calendar, the staff members; plus the number's Bookings Flows (as booking_flow in GET /flows). Read it before create_booking (the service ids) and before update_booking_settings (the keys and their current values).",
          "read_only": true,
          "destructive": false,
          "operation_id": "getBookingSettings"
        },
        {
          "name": "update_booking_settings",
          "title": "Change the booking settings",
          "description": "Switch bookings on or off and change the settings. Scope: `bookings:manage`. Not with a sandbox key. `config` is partial: a section object is merged key by key into the stored section, a list (services, providers, schedule.overrides) or a single value replaces what is stored. The whole result is checked against the rules of every section (400 `invalid_setting` with `details.problems`; nothing is saved then). Switching bookings on also creates the utility templates bookings send outside the 24 hour window (Meta reviews them). config is partial: a section object (trigger, schedule, details, messages, calendar) is merged key by key into what is stored; a list (services, providers, schedule.overrides) or a single value replaces it. Every rule of the settings is checked (400 invalid_setting lists the problems); nothing is saved on a problem. Confirm changes with the user: they change what customers see.",
          "read_only": false,
          "destructive": true,
          "operation_id": "updateBookingSettings"
        },
        {
          "name": "get_booking_reports",
          "title": "Booking numbers for the last days",
          "description": "The booking numbers of the last 7, 30 or 90 days. Scope: `bookings:manage` (or `messages:read`). Bookings by source, completed, cancelled (by whom), no-shows and the no-show rate, the CSAT average and responses, reminders sent, Flow sessions started and completed, the top services, bookings per staff member and nudges sent. `format=csv` gives the same as metric,value lines.",
          "read_only": true,
          "destructive": false,
          "operation_id": "getBookingReports"
        },
        {
          "name": "send_flow",
          "title": "Send a Flow (booking form) to a contact",
          "description": "Send a Flow to a contact (the booking form or another form). Scope: `bookings:manage`. Not with a sandbox key. A Flow of the number's Bookings section, by its `key` (GET /flows). A Flow message is free-form: it can only go to a contact who wrote to the number in the last 24 hours (422 `outside_24h_window`; send an approved template first, then the Flow when they answer). The Flow must be enabled and published (409 `flow_not_published`). The contact's answers come back as `booking.created` (a booking Flow) or `flow.completed` (a form Flow). Counts as one message of the plan. A Flow is a free-form message: only within 24 hours of the contact's last message (422 outside_24h_window otherwise - send a template first). The contact's answers come back as booking.created (a booking Flow) or flow.completed (a form Flow). Counts as one message of the plan.",
          "read_only": false,
          "destructive": true,
          "operation_id": "sendFlow"
        },
        {
          "name": "get_calendar",
          "title": "The business calendar",
          "description": "Everything on the calendar for a range of days. Scope: `bookings:manage` (or `messages:read`). One feed for a range of days (business time zone; default 7 days from today, at most 62): the appointments, the blocked time, the busy time of the connected calendar (our own appointments left out) and the times held right now, each with `start`/`end` in UTC and `start_local`/`end_local`; plus the opening hours per day (overrides applied), the staff and the services. `include` picks any of `bookings,blocks,busy,holds`; cancelled appointments only with `cancelled=true`. At most 62 days (default 7). Times are in the business time zone as well as UTC.",
          "read_only": true,
          "destructive": false,
          "operation_id": "getCalendar"
        },
        {
          "name": "list_booking_services",
          "title": "Bookable services and their staff",
          "description": "The services a customer can book, and their staff. Scope: `bookings:manage` (or `messages:read`). The enabled services with their length, price and description, and the staff members who do each one (`staff` is empty when the business has no staff). The ids go into GET /bookings/availability, GET /bookings/next, POST /bookings and POST /bookings/holds. Use the ids with find_next_booking_slots, hold_booking_slot and create_booking.",
          "read_only": true,
          "destructive": false,
          "operation_id": "listBookableServices"
        },
        {
          "name": "find_next_booking_slots",
          "title": "The next free appointment times",
          "description": "The next free start times for a service, across days. Scope: `bookings:manage` (or `messages:read`). Like GET /bookings/availability but without choosing days: the next `count` free start times after `after` (default now), looking at most 60 days ahead. Each slot's `id` is what POST /bookings, /bookings/holds and /bookings/{id}/reschedule take as `start`. Looks at most 60 days ahead. Each slot's id is what create_booking, hold_booking_slot and reschedule_booking take as start.",
          "read_only": true,
          "destructive": false,
          "operation_id": "getNextBookingSlots"
        },
        {
          "name": "update_booking",
          "title": "Change an appointment's details",
          "description": "Change an appointment's details. Scope: `bookings:manage`. Not with a sandbox key. The customer's `name` or `email`, the `notes`, the `answers` and the staff member (`provider_id`: the time must be free for the new one, else 409 `booking_slot_taken`; the calendar event moves too). The time is changed with POST /bookings/{id}/reschedule. `booking.updated` is sent with `changed` naming the fields. A staff member change checks that the time is free for the new one. The time itself is changed with reschedule_booking. The booking.updated event is sent.",
          "read_only": false,
          "destructive": true,
          "operation_id": "updateBooking"
        },
        {
          "name": "reschedule_booking",
          "title": "Move an appointment to another time",
          "description": "Move an appointment to another time. Scope: `bookings:manage`. Not with a sandbox key. Moves a confirmed appointment in place: same `id` and `reference`, the calendar event moved, reminders start again. `start` must be a free slot (the booking's own time counts as free). The customer is told on WhatsApp unless `notify` is false. `booking.rescheduled` is sent with `rescheduled_from`. 409 `booking_slot_taken` when the time is not free. Send an `Idempotency-Key` header to retry safely: the same key and body within 24 hours gets the first answer again (an error does not use the key up). It keeps its id and reference. The customer is told on WhatsApp unless notify is false; booking.rescheduled is sent. 409 booking_slot_taken when the time is not free. Check the time with find_next_booking_slots first and confirm with the user.",
          "read_only": false,
          "destructive": true,
          "operation_id": "rescheduleBooking"
        },
        {
          "name": "list_booking_notes",
          "title": "Internal notes of a customer or appointment",
          "description": "The internal notes of an appointment and its customer. Scope: `bookings:manage` (or `messages:read`). The notes written on this appointment and the customer's other notes, pinned first then newest; `on_this_booking` tells them apart. Notes are never shown to the customer. Notes are never shown to the customer.",
          "read_only": true,
          "destructive": false
        },
        {
          "name": "add_booking_note",
          "title": "Add an internal note",
          "description": "Add an internal note to an appointment. Scope: `bookings:manage`. Not with a sandbox key. The note is about the appointment's customer and written on this appointment. `author` is \"API key <name>\" and `author_kind` \"api\". `booking.note.created` is sent. Send an `Idempotency-Key` header to retry safely: the same key and body within 24 hours gets the first answer again (an error does not use the key up). The note is signed with the API key's name and is never shown to the customer. booking.note.created is sent.",
          "read_only": false,
          "destructive": true
        },
        {
          "name": "create_time_block",
          "title": "Block time in the calendar",
          "description": "Block time so that no one can book it. Scope: `bookings:manage`. Not with a sandbox key. Time off, a break, a closed afternoon: for one staff member (`provider_id`) or the whole business. Give `start` and `end`, or `date` for one whole day. Existing appointments are not touched. The block is made with `source` \"api\" and `created_by` \"API key <name>\"; `calendar.block.created` is sent. Send an `Idempotency-Key` header to retry safely: the same key and body within 24 hours gets the first answer again (an error does not use the key up). For one staff member (provider_id) or the whole business. Give start and end, or date for a whole day. Existing appointments are not touched. calendar.block.created is sent.",
          "read_only": false,
          "destructive": true,
          "operation_id": "createCalendarBlock"
        },
        {
          "name": "delete_time_block",
          "title": "Remove a blocked time",
          "description": "Remove a blocked time. Scope: `bookings:manage`. Not with a sandbox key. The time can be booked again. `calendar.block.deleted` is sent. calendar.block.deleted is sent. Confirm with the user first.",
          "read_only": false,
          "destructive": true,
          "operation_id": "deleteCalendarBlock"
        },
        {
          "name": "create_booking_link",
          "title": "Make a booking link for a customer",
          "description": "Make a link that opens the online booking page. Scope: `bookings:manage`. Not with a sandbox key. A link for a customer to book, move an appointment (`purpose` reschedule + `booking_id`) or manage their appointments (`purpose` manage). Send the `url` to the customer yourself. With a `contact` the page knows the customer and confirms the booking right away; without one it is a one-off link and the customer confirms on WhatsApp. The online booking page must be switched on, else the answer says the link will not open yet. `created_by` is \"API key <name>\", `source` \"api\". Send an `Idempotency-Key` header to retry safely: the same key and body within 24 hours gets the first answer again (an error does not use the key up). Send the returned url to the customer yourself. Without contact it is a one-off link the customer confirms on WhatsApp. The online booking page must be switched on (the answer says when it is not).",
          "read_only": false,
          "destructive": true,
          "operation_id": "createBookingLink"
        },
        {
          "name": "hold_booking_slot",
          "title": "Hold an appointment time for a few minutes",
          "description": "Keep a free time for a few minutes. Scope: `bookings:manage`. Not with a sandbox key. Keeps a free time for `minutes` (1 to 30, default 10) so no one else can book it while the customer decides: it counts as taken in the availability, the calendar and every booking check. The slot is checked like a booking is; 409 `booking_slot_taken` when it is not free. Book it with POST /bookings and `hold` (the `reference`), or release it with DELETE; it frees itself at `expires`. Send an `Idempotency-Key` header to retry safely: the same key and body within 24 hours gets the first answer again (an error does not use the key up). Answers a hold.reference. Book it with create_booking (pass hold) or it frees itself at hold.expires. 409 booking_slot_taken when the time is not free.",
          "read_only": false,
          "destructive": true,
          "operation_id": "createBookingHold"
        },
        {
          "name": "get_customer_profile",
          "title": "A customer's profile",
          "description": "A customer's whole profile. Scope: `bookings:manage` (or `messages:read`). Contact details and tags, upcoming and past appointments, internal notes and reminders, packages, payments, stats and the last 20 messages: one call for an agent that is about to talk to the customer. Use it before talking to or booking for a returning customer.",
          "read_only": true,
          "destructive": false,
          "operation_id": "getCustomerProfile"
        },
        {
          "name": "list_payments",
          "title": "Payments taken for appointments",
          "description": "The payments, newest first. Scope: `bookings:manage` (or `messages:read`). The payments of appointments, package purchases and payment requests. Filter by `booking` (id or reference), `contact`, `status` and `kind`. Page with `next_cursor`. Paged: pass next_cursor as cursor.",
          "read_only": true,
          "destructive": false,
          "operation_id": "listPayments"
        },
        {
          "name": "request_payment",
          "title": "Ask a customer to pay",
          "description": "Ask a customer to pay an amount. Scope: `bookings:manage`. Not with a sandbox key. Makes a one-off payment request and the page where the customer pays (the business's own Stripe or PayPal). With `send` true and the customer inside their 24 hour window they also get it on WhatsApp with a Pay button; otherwise send the `url` yourself. 409 `payments_not_connected` when no provider is connected. `payment.paid` is sent when it is paid. Send an `Idempotency-Key` header to retry safely: the same key and body within 24 hours gets the first answer again (an error does not use the key up). With send true and the customer inside their 24 hour window they get it on WhatsApp with a Pay button; otherwise give them the returned url yourself. Needs Stripe or PayPal connected (409 payments_not_connected). Confirm the amount with the user first.",
          "read_only": false,
          "destructive": true,
          "operation_id": "createPaymentLink"
        },
        {
          "name": "refund_payment",
          "title": "Refund a payment",
          "description": "Refund a payment, in full or a part. Scope: `bookings:manage`. Not with a sandbox key. Sends real money back through the business's own provider; it cannot be undone. `amount` is a part in the payment's currency; left out, everything that is left. A full refund of an appointment's payment sets its `payment.status` to refunded. `booking.refunded` is sent. 409 `refund_not_possible`, 502 `payment_provider_error`. Send an `Idempotency-Key` header to retry safely: the same key and body within 24 hours gets the first answer again (an error does not use the key up). This moves real money back to the customer and cannot be undone. 409 refund_not_possible when it is not paid or too little is left. Always confirm with the user first.",
          "read_only": false,
          "destructive": true,
          "operation_id": "refundPayment"
        },
        {
          "name": "create_meeting_poll",
          "title": "Make a meeting poll",
          "description": "Offer several times and let people vote. Scope: `bookings:manage`. Not with a sandbox key. 2 to 10 possible start times (each free now; the business's rule: inside the opening hours), a title, a service or a length. The times are not held. Share the `url`: people open it and vote. Pick the winner with POST /bookings/polls/{id}/book. `poll.voted` is sent for each vote. Send an `Idempotency-Key` header to retry safely: the same key and body within 24 hours gets the first answer again (an error does not use the key up). The times are not held. Share the returned url. Pick the winner later with the poll's book call. Each time must be free now.",
          "read_only": false,
          "destructive": true,
          "operation_id": "createPoll"
        },
        {
          "name": "erase_customer_data",
          "title": "Erase a customer's booking data",
          "description": "Erase a customer's booking data. Scope: `bookings:manage`. Not with a sandbox key. For a privacy request. Future confirmed appointments are cancelled without a message (reason \"data erased\"); every appointment of the customer loses their number, name, e-mail, notes and answers (the row stays, anonymised, so reports still count it); their notes, links, holds and poll votes are deleted; package purchases and payments keep amounts and dates but lose the customer. The contact record and the conversation are kept: `DELETE /contacts/{identity}?booking_data=erase` removes the contact too. `booking.customer.erased` is sent. It cannot be undone. This cannot be undone. The contact record and the conversation stay. Only do it when the customer or the business owner has asked for it, and confirm with the user first.",
          "read_only": false,
          "destructive": true,
          "operation_id": "eraseCustomerBookingData"
        },
        {
          "name": "get_pricing_analytics",
          "title": "WhatsApp cost and volume",
          "description": "WhatsApp cost and volume of this number. Meta's pricing_analytics for this number: delivered messages and their cost per period. Estimates, not the invoice.",
          "read_only": true,
          "destructive": false,
          "operation_id": "getPricingAnalytics"
        },
        {
          "name": "get_message_analytics",
          "title": "Messages sent and delivered",
          "description": "Messages sent and delivered, as WhatsApp counts them. Meta's analytics for this number, per period.",
          "read_only": true,
          "destructive": false,
          "operation_id": "getMessageAnalytics"
        },
        {
          "name": "get_account_activity",
          "title": "WhatsApp account activity log",
          "description": "The WhatsApp Business Account's activity log. Newest first: registrations, PIN and partner changes, billing, templates. Covers every number on the WABA.",
          "read_only": true,
          "destructive": false,
          "operation_id": "getAccountActivity"
        },
        {
          "name": "get_call_settings",
          "title": "WhatsApp calling settings",
          "description": "WhatsApp calling settings. Meta's settings of the number: calling on or off, call icon, call hours, call-back permission, SIP.",
          "read_only": true,
          "destructive": false,
          "operation_id": "getCallSettings"
        },
        {
          "name": "get_call_permission",
          "title": "May the number call this contact",
          "description": "May the number call this contact. The contact's call permission and how many calls or permission requests are left.",
          "read_only": true,
          "destructive": false,
          "operation_id": "getCallPermission"
        },
        {
          "name": "list_flows",
          "title": "List WhatsApp Flows",
          "description": "List WhatsApp Flows. Every flow of the WhatsApp Business Account: id, name, status, categories, validation errors. This number's Bookings Flows also have `key`, `can_send` and `booking_flow` (POST /flows/{key}/send sends them); the first page adds the Bookings Flows not uploaded yet (no id). Needs 'messages:read' or 'bookings:manage'. send_flow takes a Flow's key (can_send: it can be sent now).",
          "read_only": true,
          "destructive": false,
          "operation_id": "listFlows"
        },
        {
          "name": "get_flow",
          "title": "One flow: status, errors, health",
          "description": "One flow: status, validation errors, health. Status, categories, validation errors, Flow JSON version, endpoint, and whether it can be sent (health_status).",
          "read_only": true,
          "destructive": false,
          "operation_id": "getFlow"
        },
        {
          "name": "create_flow",
          "title": "Create a flow",
          "description": "Create a flow (draft, or published at once). Needs 'templates:manage'. A draft; with flow_json and publish: true it is published at once (cannot be undone). WABA-wide: every number on this WhatsApp Business Account shares its flows.",
          "read_only": false,
          "destructive": true,
          "operation_id": "createFlow"
        },
        {
          "name": "update_flow",
          "title": "Rename a flow or change its categories or endpoint",
          "description": "Change a flow's name, categories or endpoint. Needs 'templates:manage'. The Flow JSON: PUT /flows/{id}/json. A published flow goes back to DRAFT until you publish it again; messages already sent keep the old version. WABA-wide: every number on this WhatsApp Business Account shares its flows.",
          "read_only": false,
          "destructive": true,
          "operation_id": "updateFlow"
        },
        {
          "name": "get_flow_json",
          "title": "A flow's Flow JSON",
          "description": "A flow's Flow JSON. The flow.json WhatsApp keeps for the flow.",
          "read_only": true,
          "destructive": false,
          "operation_id": "getFlowJson"
        },
        {
          "name": "update_flow_json",
          "title": "Replace a flow's Flow JSON",
          "description": "Replace a flow's Flow JSON. Needs 'templates:manage'. The body is the Flow JSON (or {\"flow_json\": {...}}), max 10 MB; the answer lists WhatsApp's validation errors. A published flow goes back to DRAFT until you publish it again; messages already sent keep the old version. WABA-wide: every number on this WhatsApp Business Account shares its flows.",
          "read_only": false,
          "destructive": true,
          "operation_id": "updateFlowJson"
        },
        {
          "name": "publish_flow",
          "title": "Publish a flow (cannot be undone)",
          "description": "Publish a flow (cannot be undone). Needs 'templates:manage'. A draft without validation errors. Afterwards it cannot be deleted (deprecate it instead); a change puts it back to DRAFT until published again. WABA-wide: every number on this WhatsApp Business Account shares its flows. Confirm with the user first.",
          "read_only": false,
          "destructive": true,
          "operation_id": "publishFlow"
        },
        {
          "name": "deprecate_flow",
          "title": "Deprecate a published flow (cannot be undone)",
          "description": "Deprecate a published flow (cannot be undone). Needs 'templates:manage'. It can no longer be sent or opened. WABA-wide: every number on this WhatsApp Business Account shares its flows. Confirm with the user first.",
          "read_only": false,
          "destructive": true,
          "operation_id": "deprecateFlow"
        },
        {
          "name": "delete_flow",
          "title": "Delete a draft flow",
          "description": "Delete a draft flow. Needs 'templates:manage'. Drafts only; deprecate a published flow instead. WABA-wide: every number on this WhatsApp Business Account shares its flows.",
          "read_only": false,
          "destructive": true,
          "operation_id": "deleteFlow"
        },
        {
          "name": "get_flow_preview",
          "title": "A public preview link of a flow",
          "description": "A public preview link of a flow (30 days). Anyone with the link can open it, also in an iframe. A new link: POST.",
          "read_only": true,
          "destructive": false,
          "operation_id": "getFlowPreview"
        },
        {
          "name": "renew_flow_preview",
          "title": "A new preview link of a flow (the old one stops working)",
          "description": "A new preview link of a flow (the old one stops working). Needs 'templates:manage'. Meta's preview.invalidate(true): the old link stops working at once.",
          "read_only": false,
          "destructive": true,
          "operation_id": "renewFlowPreview"
        },
        {
          "name": "upload_media",
          "title": "Upload a file to WhatsApp, get a media id",
          "description": "Upload a file once, get a media id. Uploads an image, video, document, audio file or sticker to WhatsApp and returns a `media_id` for `{\"id\": ...}` in later sends (templates or free-form). WhatsApp keeps it 30 days. JSON (a link or base64 data) or multipart/form-data (`file`, optional `type`). Limits: image JPEG/PNG 5 MB, video MP4/3GP 16 MB, audio 16 MB, sticker WebP 100 KB static / 500 KB animated, document 100 MB. A sandbox key checks the file and uploads nothing.",
          "read_only": false,
          "destructive": true,
          "operation_id": "uploadMedia"
        },
        {
          "name": "get_media_info",
          "title": "A file's type, size and checksum",
          "description": "The type, size and sha256 of a received file (message_id) or a WhatsApp media id, and whether app2email has its own copy (source stored) or it comes from WhatsApp.",
          "read_only": true,
          "destructive": false,
          "operation_id": "getMedia"
        },
        {
          "name": "delete_media",
          "title": "Delete an uploaded file at WhatsApp",
          "description": "Delete an uploaded file at WhatsApp. The media_id of POST /media (WhatsApp keeps uploads 30 days otherwise). A scheduled send that still uses it then fails. app2email's stored copies of received files stay. Sends that still use the id then fail.",
          "read_only": false,
          "destructive": true,
          "operation_id": "deleteMedia"
        },
        {
          "name": "get_number_health",
          "title": "Number health at WhatsApp",
          "description": "Number health: can it send, quality, limit, name status. WhatsApp's health_status and the number's fields (quality, messaging limit, throughput, display name review, account mode). Kept 60 s.",
          "read_only": true,
          "destructive": false,
          "operation_id": "getNumberHealth"
        },
        {
          "name": "get_profile",
          "title": "WhatsApp business profile",
          "description": "The WhatsApp business profile. About, address, description, email, websites, vertical and the photo link, as WhatsApp users see them.",
          "read_only": true,
          "destructive": false,
          "operation_id": "getBusinessProfile"
        },
        {
          "name": "update_profile",
          "title": "Change the WhatsApp business profile",
          "description": "Change the WhatsApp business profile. Fields left out stay as they are. Meta's own body (with messaging_product, profile_picture_handle) works unchanged. Every WhatsApp user sees the profile: confirm the new text with the user first.",
          "read_only": false,
          "destructive": true,
          "operation_id": "updateBusinessProfile"
        },
        {
          "name": "set_profile_photo",
          "title": "Change the WhatsApp profile photo",
          "description": "Change the profile photo from a public link. app2email downloads the image (JPG or PNG, up to 5 MB; 640x640 px suggested) and uploads it to WhatsApp.",
          "read_only": false,
          "destructive": true,
          "operation_id": "setProfilePhoto"
        },
        {
          "name": "set_display_name",
          "title": "Request a new display name",
          "description": "Submit a new display name for Meta's review. Answer 202. GET /health shows new_name_status. After approval, number.updated (change display_name, next_step reconnect): press Reconnect on the dashboard within 14 days. Confirm the exact name with the user first.",
          "read_only": false,
          "destructive": true,
          "operation_id": "setDisplayName"
        },
        {
          "name": "get_username",
          "title": "WhatsApp business username",
          "description": "The business username. status none: the number has no username.",
          "read_only": true,
          "destructive": false,
          "operation_id": "getUsername"
        },
        {
          "name": "set_username",
          "title": "Set the WhatsApp business username",
          "description": "Adopt or change the business username. 3 to 35 characters of a-z, 0-9, '.', '_', with a letter. At most 2 changes in 14 days (422 username_change_limit). Confirm the name with the user first.",
          "read_only": false,
          "destructive": true,
          "operation_id": "setUsername"
        },
        {
          "name": "get_conversation_starters",
          "title": "Ice breakers and commands",
          "description": "Ice breakers, commands and welcome message. What WhatsApp users see when they open a chat or type '/'.",
          "read_only": true,
          "destructive": false,
          "operation_id": "getConversationStarters"
        },
        {
          "name": "set_conversation_starters",
          "title": "Set ice breakers and commands",
          "description": "Set ice breakers, commands or the welcome message. Replaces the parts given. A tap or a command arrives as a normal text message (forwarded by email as usual).",
          "read_only": false,
          "destructive": true,
          "operation_id": "setConversationStarters"
        },
        {
          "name": "list_qr_codes",
          "title": "List QR codes and short links",
          "description": "QR codes and short links. Up to 2,000 per number. Codes never expire; WhatsApp gives no scan counts.",
          "read_only": true,
          "destructive": false,
          "operation_id": "listQrCodes"
        },
        {
          "name": "create_qr_code",
          "title": "Create a QR code and short link",
          "description": "Create a QR code and wa.me short link. The chat opens with prefilled_message (up to 140 characters). Answer 201.",
          "read_only": false,
          "destructive": true,
          "operation_id": "createQrCode"
        },
        {
          "name": "update_qr_code",
          "title": "Change a QR code's message",
          "description": "Change a QR code's prefilled message. The code, link and image stay the same.",
          "read_only": false,
          "destructive": true,
          "operation_id": "updateQrCode"
        },
        {
          "name": "delete_qr_code",
          "title": "Delete a QR code",
          "description": "Delete a QR code and its short link. Printed codes and shared links stop working. Printed codes stop working: confirm with the user first.",
          "read_only": false,
          "destructive": true,
          "operation_id": "deleteQrCode"
        },
        {
          "name": "send_message",
          "title": "Send any message type (24 hour window)",
          "description": "Send a free-form WhatsApp message of any type to ONE contact within the 24 hour reply window: audio (voice: true for a voice note, Ogg/OPUS), sticker (WebP), location, contacts, reaction, or interactive (button, list, cta_url, carousel, flow, location_request_message, request_contact_info, product, product_list, catalog_message, call_permission_request, voice_call, address_message, order_details, order_status). 'content' is WhatsApp Cloud API's object for that type, eg {\"latitude\": -33.85, \"longitude\": 151.21} for location. Sends a real message and counts against the plan; try dry_run=true first.",
          "read_only": false,
          "destructive": true,
          "operation_id": "sendTemplateMessage"
        },
        {
          "name": "send_reaction",
          "title": "React to a contact's message",
          "description": "Put an emoji reaction on one of the contact's messages (up to 30 days old), within the 24 hour reply window. emoji \"\" removes it. Counts as one message of the plan.",
          "read_only": false,
          "destructive": true,
          "operation_id": "sendTemplateMessage"
        },
        {
          "name": "send_location",
          "title": "Send a location pin (24 hour window)",
          "description": "Send a map pin to ONE contact within the 24 hour reply window. Counts as one message of the plan.",
          "read_only": false,
          "destructive": true,
          "operation_id": "sendTemplateMessage"
        },
        {
          "name": "mark_read",
          "title": "Mark a message as read (blue ticks)",
          "description": "Mark a received message as read, optionally typing. Blue ticks on a message the contact sent (and the earlier ones of the chat), up to 30 days old; `typing` also shows the typing indicator for up to 25 seconds. Free: not counted, no 24 hour window. Meta's own body on POST /messages works too.",
          "read_only": false,
          "destructive": true,
          "operation_id": "markMessageRead"
        },
        {
          "name": "get_marketing_status",
          "title": "Marketing Messages API status",
          "description": "Where marketing templates go: Cloud API or Marketing Messages API. The route setting (messages.marketing_route), the route a marketing template takes now, WhatsApp's onboarding status and the account's Cloud API switch. `?refresh=true` asks WhatsApp now (otherwise up to 1 hour old).",
          "read_only": true,
          "destructive": false,
          "operation_id": "getMarketingStatus"
        },
        {
          "name": "list_blocked_users",
          "title": "Blocked WhatsApp users",
          "description": "WhatsApp users this number blocked. WhatsApp's own block list of the number (not the Do Not Call list). Page with `next_cursor`.",
          "read_only": true,
          "destructive": false,
          "operation_id": "listBlockedUsers"
        },
        {
          "name": "block_users",
          "title": "Block WhatsApp users",
          "description": "Block WhatsApp users. They cannot message the number and it cannot message them. Up to 1000 per call; only users who wrote in the last 24 hours. Confirm with the user first.",
          "read_only": false,
          "destructive": true,
          "operation_id": "blockUsers"
        },
        {
          "name": "unblock_users",
          "title": "Unblock WhatsApp users",
          "description": "Unblock WhatsApp users. Same body as blocking.",
          "read_only": false,
          "destructive": true,
          "operation_id": "unblockUsers"
        },
        {
          "name": "check_contact_book",
          "title": "Is a contact's number in the contact book",
          "description": "Is a phone number on file for a business-scoped user id. WhatsApp's contact book (per business portfolio) keeps the numbers of users the business talked to, so webhooks include them. Never returns the number.",
          "read_only": true,
          "destructive": false,
          "operation_id": "getContactBookEntry"
        },
        {
          "name": "delete_contact_book_entry",
          "title": "Remove a contact from the contact book",
          "description": "Remove a business-scoped user id from the contact book. Later webhooks may then leave the number out (unless the user writes again). Confirm with the user first.",
          "read_only": false,
          "destructive": true,
          "operation_id": "deleteContactBookEntry"
        },
        {
          "name": "create_template",
          "title": "Create a template (WhatsApp reviews it)",
          "description": "Create a template and submit it for approval. Needs the 'templates:manage' scope. The template goes to WhatsApp for review (minutes to a day). `template.status_changed` tells the result. Every Meta field is passed on (TTL, link tracking, max price, Template Library). WABA-wide: every number on this WhatsApp Business Account uses the same templates.",
          "read_only": false,
          "destructive": true,
          "operation_id": "createTemplate"
        },
        {
          "name": "edit_template",
          "title": "Edit a template",
          "description": "Edit a template (components, category, TTL, max price). Needs 'templates:manage'. Only APPROVED, REJECTED or PAUSED templates; an approved one at most once a day, 10 times in 30 days. WABA-wide: every number on this WhatsApp Business Account uses the same templates.",
          "read_only": false,
          "destructive": true,
          "operation_id": "editTemplate"
        },
        {
          "name": "delete_template",
          "title": "Delete a template",
          "description": "Delete a template (every language, or one). Needs the 'templates:manage' scope. The template app2email uses for its own alerts cannot be deleted here. WABA-wide: every number on this WhatsApp Business Account uses the same templates.",
          "read_only": false,
          "destructive": true,
          "operation_id": "deleteTemplate"
        },
        {
          "name": "delete_templates",
          "title": "Delete several templates (all or nothing)",
          "description": "Delete several templates at once (all or nothing). Needs 'templates:manage'. names (every language) or ids, at most 100 languages; one bad id deletes nothing. WABA-wide: every number on this WhatsApp Business Account uses the same templates.",
          "read_only": false,
          "destructive": true,
          "operation_id": "deleteTemplates"
        },
        {
          "name": "archive_template",
          "title": "Archive a template",
          "description": "Archive a template (deleted by WhatsApp after 28 days). Needs 'templates:manage'. Every language, or ?language=. Only APPROVED or REJECTED templates; unarchive within 28 days to keep it. WABA-wide: every number on this WhatsApp Business Account uses the same templates.",
          "read_only": false,
          "destructive": true,
          "operation_id": "archiveTemplate"
        },
        {
          "name": "unarchive_template",
          "title": "Unarchive a template",
          "description": "Unarchive a template. Needs 'templates:manage'. Back to its previous status. Within 28 days of archiving. WABA-wide: every number on this WhatsApp Business Account uses the same templates.",
          "read_only": false,
          "destructive": true,
          "operation_id": "unarchiveTemplate"
        },
        {
          "name": "compare_templates",
          "title": "Compare two templates",
          "description": "Compare two templates: block rate, sends, top block reason. Both templates of this account, each sent at least 1,000 times in the period.",
          "read_only": true,
          "destructive": false,
          "operation_id": "compareTemplates"
        },
        {
          "name": "list_template_library",
          "title": "Browse Meta's Template Library",
          "description": "Meta's Template Library (pre-approved templates). Utility and authentication templates written by Meta. Create one with POST /templates and library_template_name.",
          "read_only": true,
          "destructive": false,
          "operation_id": "listTemplateLibrary"
        },
        {
          "name": "upsert_auth_template",
          "title": "Create or update an authentication template in many languages",
          "description": "Create or update an authentication template in many languages. Needs 'templates:manage'. Missing languages are created, existing ones updated, in one call. Not for business-scoped user ids (131062). WABA-wide: every number on this WhatsApp Business Account uses the same templates.",
          "read_only": false,
          "destructive": true,
          "operation_id": "upsertAuthTemplate"
        },
        {
          "name": "preview_auth_templates",
          "title": "Authentication template texts per language",
          "description": "Authentication template texts, per language. The fixed texts WhatsApp puts into an authentication template (body, security line, expiry footer, buttons).",
          "read_only": true,
          "destructive": false,
          "operation_id": "previewAuthTemplates"
        },
        {
          "name": "get_template_insights",
          "title": "Template insights: sent, delivered, read, clicked, cost",
          "description": "Template insights: sent, delivered, read, clicked, cost. Per template and day (UTC), 90 days back, at most 10 template languages. Insights must be on (POST); not for EU or Japan accounts.",
          "read_only": true,
          "destructive": false,
          "operation_id": "getTemplateInsights"
        },
        {
          "name": "enable_template_insights",
          "title": "Switch template insights on (cannot be undone)",
          "description": "Switch template insights on (cannot be undone). Needs 'templates:manage' and {\"confirm\": true}. Adds link tracking and lets Meta collect anonymised chat data. WABA-wide: every number on this WhatsApp Business Account uses the same templates. Ask the account owner first: it cannot be undone and applies to the whole WhatsApp Business Account.",
          "read_only": false,
          "destructive": true,
          "operation_id": "enableTemplateInsights"
        },
        {
          "name": "list_webhooks",
          "title": "The number's webhooks",
          "description": "Your webhooks. With the result of the last delivery to each.",
          "read_only": true,
          "destructive": false,
          "operation_id": "listWebhooks"
        },
        {
          "name": "create_webhook",
          "title": "Add a webhook",
          "description": "Get events at your URL. Up to 5 per number. Every webhook gets every event: use the event's type to pick the ones you handle. The same URL again answers that webhook, turned on (200). The answer has the secret that signs every event. Optional: headers (custom headers) and format (app2email or meta).",
          "read_only": false,
          "destructive": true,
          "operation_id": "createWebhook"
        },
        {
          "name": "update_webhook",
          "title": "Change a webhook",
          "description": "Change a webhook: url, active, headers, format. Only what is given changes: url, active, headers (a header set to null is removed), format. `active: true` turns a webhook back on after it was switched off for failures (and clears the failure count). The same url as another webhook of the number: 409 webhook_url_in_use. Needs the 'webhooks:manage' scope.",
          "read_only": false,
          "destructive": true,
          "operation_id": "updateWebhook"
        },
        {
          "name": "delete_webhook",
          "title": "Delete a webhook",
          "description": "Delete a webhook. Stops every delivery to it, planned retries included. Its delivery log is kept 7 days.",
          "read_only": false,
          "destructive": true,
          "operation_id": "deleteWebhook"
        },
        {
          "name": "test_webhook_url",
          "title": "Send a test event to any URL",
          "description": "Send a test event to any URL. One signed POST to any https URL, answered with the exact request sent and your URL's answer. No saved webhook needed. Shares the 30 tests an hour of the number (429 too_many_tests with Retry-After); 60 an hour per target host and per its IP address.",
          "read_only": false,
          "destructive": true,
          "operation_id": "testWebhookUrl"
        },
        {
          "name": "create_webhook_catcher",
          "title": "Get a temporary URL that keeps what it receives",
          "description": "Get a temporary URL that keeps what it receives. A URL for 1 hour that keeps up to 50 requests of up to 64 KB: use it as a webhook URL or in test-url, then read them. POST https://api.app2email.com/hooks/catch/{token} needs no key and answers 200 {\"ok\":true}; 404 unknown, 410 expired, 413 over 64 KB, 429 full. At most 3 per number at a time. With a sandbox key, a send's message.status events arrive there.",
          "read_only": false,
          "destructive": true,
          "operation_id": "createWebhookCatcher"
        },
        {
          "name": "get_webhook_catcher",
          "title": "What a catcher URL received",
          "description": "What a catcher received. The requests, oldest first, with their headers and body. Poll with after = the last seq you have.",
          "read_only": true,
          "destructive": false,
          "operation_id": "getWebhookCatcher"
        }
      ]
    },
    {
      "name": "management",
      "url": "https://api.app2email.com/mcp/manage",
      "auth": "none for create_account and list_plans; Authorization: Bearer <management_key> for the rest",
      "protocol_versions": [
        "2025-11-25",
        "2025-06-18",
        "2025-03-26",
        "2024-11-05"
      ],
      "documentation": "https://www.app2email.com/docs/api/agents",
      "tools": [
        {
          "name": "create_account",
          "title": "Create an account",
          "read_only": false,
          "destructive": false,
          "operation_id": "createAccount",
          "description": "Start an app2email account for a person. No key needed. E-mails them a link to confirm; returns signup_id, management_key (shown once), onboarding_link and next steps. A repeat for the same e-mail address replaces the open sign-up: the earlier link and management_key stop working."
        },
        {
          "name": "get_account_status",
          "title": "Account status",
          "read_only": true,
          "destructive": false,
          "operation_id": "getAccount",
          "description": "What the account still needs: pending_email, pending_whatsapp, pending_payment or live, with its numbers and next steps."
        },
        {
          "name": "list_plans",
          "title": "Plans",
          "read_only": true,
          "destructive": false,
          "operation_id": "listAccountPlans",
          "description": "The plans that can be bought, with prices (US$) and whether they include the API. No key needed."
        },
        {
          "name": "list_numbers",
          "title": "Numbers",
          "read_only": true,
          "destructive": false,
          "operation_id": "listAccountNumbers",
          "description": "The account's WhatsApp numbers with their status and plan."
        },
        {
          "name": "get_payment_link",
          "title": "Payment link",
          "read_only": false,
          "destructive": false,
          "operation_id": "createNumberCheckout",
          "description": "A Stripe Checkout link for a plan of one number. Nothing is charged until the person pays."
        },
        {
          "name": "create_number_key",
          "title": "Create a number key",
          "read_only": false,
          "destructive": false,
          "operation_id": "createNumberKey",
          "description": "A key for one live number, for the messaging MCP server and the REST API. Shown once. Sandbox unless sandbox is false."
        },
        {
          "name": "list_number_keys",
          "title": "Number keys",
          "read_only": true,
          "destructive": false,
          "operation_id": "listNumberKeys",
          "description": "The keys of one number (never the keys themselves)."
        },
        {
          "name": "revoke_number_key",
          "title": "Revoke a number key",
          "read_only": false,
          "destructive": true,
          "operation_id": "revokeNumberKey",
          "description": "Revoke one key of a number. Cannot be undone."
        },
        {
          "name": "get_usage",
          "title": "Usage",
          "read_only": true,
          "destructive": false,
          "operation_id": "getAccountUsage",
          "description": "Messages sent this billing month and the plan limit, for every number or one."
        }
      ]
    }
  ],
  "x-a2e-message-types": [
    {
      "type": "text",
      "kind": "message",
      "title": "Text",
      "summary": "Plain text, links with an optional preview.",
      "window": true,
      "counts": true,
      "limits": [
        "body up to 4096 characters"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/messages/text-messages",
      "example": {
        "to": "61412345678",
        "type": "text",
        "text": {
          "body": "Your order has shipped.",
          "preview_url": false
        }
      },
      "inbound": {
        "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgASGBQzQUZCMTY0MDc2MUYwNzBDNTY5MAA=",
        "from": "61412345678",
        "from_user_id": "AU.13491208655302741918",
        "name": "Jane Citizen",
        "type": "text",
        "text": "Is my order on its way?",
        "conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_k3XbQ9rTzP2mWv7a1c9e",
        "timestamp": "2026-11-06T01:00:00.000Z"
      },
      "slug": "text"
    },
    {
      "type": "image",
      "kind": "message",
      "title": "Image",
      "summary": "JPEG or PNG with an optional caption.",
      "window": true,
      "counts": true,
      "limits": [
        "JPEG, PNG up to 5 MB",
        "caption up to 1024 characters"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/messages/image-messages",
      "example": {
        "to": "61412345678",
        "type": "image",
        "image": {
          "link": "https://example.com/photo.jpg",
          "caption": "Your parcel"
        }
      },
      "inbound": {
        "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgASGBQzQUZCMTY0MDc2MUYwNzBDNTY5MAA=",
        "from": "61412345678",
        "from_user_id": "AU.13491208655302741918",
        "media_url": "https://api.app2email.com/v1/4976659348270/media/wamid.HBgLNjE0MTIzNDU2NzgVAgASGBQzQUZCMTY0MDc2MUYwNzBDNTY5MAA%3D",
        "name": "Jane Citizen",
        "type": "image",
        "text": "Here is the damage [IMAGE, photo.jpg, image/jpeg, 182044 bytes]",
        "conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_k3XbQ9rTzP2mWv7a1c9e",
        "timestamp": "2026-11-06T01:00:00.000Z"
      },
      "slug": "image"
    },
    {
      "type": "video",
      "kind": "message",
      "title": "Video",
      "summary": "MP4 or 3GP with an optional caption.",
      "window": true,
      "counts": true,
      "limits": [
        "MP4, 3GP (H.264 + AAC) up to 16 MB",
        "caption up to 1024 characters"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/messages/video-messages",
      "example": {
        "to": "61412345678",
        "type": "video",
        "video": {
          "link": "https://example.com/howto.mp4",
          "caption": "How to set it up"
        }
      },
      "inbound": {
        "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgASGBQzQUZCMTY0MDc2MUYwNzBDNTY5MAA=",
        "from": "61412345678",
        "from_user_id": "AU.13491208655302741918",
        "media_url": "https://api.app2email.com/v1/4976659348270/media/wamid.HBgLNjE0MTIzNDU2NzgVAgASGBQzQUZCMTY0MDc2MUYwNzBDNTY5MAA%3D",
        "name": "Jane Citizen",
        "type": "video",
        "text": "[VIDEO, clip.mp4, video/mp4, 2481930 bytes]",
        "conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_k3XbQ9rTzP2mWv7a1c9e",
        "timestamp": "2026-11-06T01:00:00.000Z"
      },
      "slug": "video"
    },
    {
      "type": "document",
      "kind": "message",
      "title": "Document",
      "summary": "PDF, Office or text file, shown with its file name.",
      "window": true,
      "counts": true,
      "limits": [
        "up to 100 MB",
        "caption up to 1024 characters"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/messages/document-messages",
      "example": {
        "to": "61412345678",
        "type": "document",
        "document": {
          "link": "https://example.com/invoice-1234.pdf",
          "filename": "invoice-1234.pdf",
          "caption": "Invoice"
        }
      },
      "inbound": {
        "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgASGBQzQUZCMTY0MDc2MUYwNzBDNTY5MAA=",
        "from": "61412345678",
        "from_user_id": "AU.13491208655302741918",
        "media_url": "https://api.app2email.com/v1/4976659348270/media/wamid.HBgLNjE0MTIzNDU2NzgVAgASGBQzQUZCMTY0MDc2MUYwNzBDNTY5MAA%3D",
        "name": "Jane Citizen",
        "type": "document",
        "text": "[DOCUMENT, invoice.pdf, application/pdf, 84211 bytes]",
        "conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_k3XbQ9rTzP2mWv7a1c9e",
        "timestamp": "2026-11-06T01:00:00.000Z"
      },
      "slug": "document"
    },
    {
      "type": "audio",
      "kind": "message",
      "title": "Audio and voice message",
      "summary": "An audio file, or with voice: true a voice message (play button, transcript).",
      "window": true,
      "counts": true,
      "limits": [
        "aac, amr, mp3, m4a, ogg up to 16 MB",
        "voice: Ogg with OPUS only (no conversion); play button up to 512 KB",
        "no caption"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/messages/audio-messages",
      "example": {
        "to": "61412345678",
        "type": "audio",
        "audio": {
          "id": "1013859600285441",
          "voice": true
        }
      },
      "inbound": {
        "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgASGBQzQUZCMTY0MDc2MUYwNzBDNTY5MAA=",
        "from": "61412345678",
        "from_user_id": "AU.13491208655302741918",
        "media_url": "https://api.app2email.com/v1/4976659348270/media/wamid.HBgLNjE0MTIzNDU2NzgVAgASGBQzQUZCMTY0MDc2MUYwNzBDNTY5MAA%3D",
        "name": "Jane Citizen",
        "type": "audio",
        "text": "[AUDIO, voice.ogg, audio/ogg, 12044 bytes]",
        "conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_k3XbQ9rTzP2mWv7a1c9e",
        "timestamp": "2026-11-06T01:00:00.000Z"
      },
      "slug": "audio"
    },
    {
      "type": "sticker",
      "kind": "message",
      "title": "Sticker",
      "summary": "A static or animated WebP sticker.",
      "window": true,
      "counts": true,
      "limits": [
        "WebP only",
        "static up to 100 KB, animated up to 500 KB",
        "no caption"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/messages/sticker-messages",
      "example": {
        "to": "61412345678",
        "type": "sticker",
        "sticker": {
          "link": "https://example.com/stickers/thanks.webp"
        }
      },
      "inbound": {
        "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgASGBQzQUZCMTY0MDc2MUYwNzBDNTY5MAA=",
        "from": "61412345678",
        "from_user_id": "AU.13491208655302741918",
        "media_url": "https://api.app2email.com/v1/4976659348270/media/wamid.HBgLNjE0MTIzNDU2NzgVAgASGBQzQUZCMTY0MDc2MUYwNzBDNTY5MAA%3D",
        "name": "Jane Citizen",
        "type": "sticker",
        "text": "[IMAGE, sticker.webp, image/webp, 18234 bytes]",
        "conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_k3XbQ9rTzP2mWv7a1c9e",
        "timestamp": "2026-11-06T01:00:00.000Z"
      },
      "slug": "sticker"
    },
    {
      "type": "location",
      "kind": "message",
      "title": "Location",
      "summary": "A map pin with an optional name and address.",
      "window": true,
      "counts": true,
      "limits": [
        "latitude -90 to 90, longitude -180 to 180"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/messages/location-messages",
      "example": {
        "to": "61412345678",
        "type": "location",
        "location": {
          "latitude": -33.8568,
          "longitude": 151.2153,
          "name": "Sydney Opera House",
          "address": "Bennelong Point, Sydney NSW 2000"
        }
      },
      "inbound": {
        "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgASGBQzQUZCMTY0MDc2MUYwNzBDNTY5MAA=",
        "from": "61412345678",
        "from_user_id": "AU.13491208655302741918",
        "name": "Jane Citizen",
        "type": "location",
        "text": "LOCATION: Sydney Opera House, Bennelong Point, Sydney NSW 2000, -33.8568, 151.2153",
        "conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_k3XbQ9rTzP2mWv7a1c9e",
        "timestamp": "2026-11-06T01:00:00.000Z",
        "location": {
          "latitude": -33.8568,
          "longitude": 151.2153,
          "name": "Sydney Opera House",
          "address": "Bennelong Point, Sydney NSW 2000"
        }
      },
      "answer": {
        "success": true,
        "request_id": "r4tzn",
        "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBI1RjQyNUE3NEYxMzAzMzQ5MkEA",
        "status": "accepted",
        "from": "4976659348270",
        "to": "61412345678",
        "type": "location",
        "text": "[location -33.8568,151.2153 Sydney Opera House, Bennelong Point, Sydney NSW 2000]",
        "window_closes_at": "2026-11-06T22:45:00Z",
        "conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_k3XbQ9rTzP2mWv7a1c9e",
        "contacts": [
          {
            "input": "61412345678",
            "wa_id": "61412345678"
          }
        ],
        "note": "accepted by WhatsApp. delivery and read status appear in your app2email Activity Log (WhatsApp sent) and in the message.status webhook event."
      },
      "slug": "location"
    },
    {
      "type": "contacts",
      "kind": "message",
      "title": "Contact card",
      "summary": "One or more vCards.",
      "window": true,
      "counts": true,
      "limits": [
        "1 to 20 cards",
        "name.formatted_name required"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/messages/contacts-messages",
      "example": {
        "to": "61412345678",
        "type": "contacts",
        "contacts": [
          {
            "name": {
              "formatted_name": "Jane Citizen",
              "first_name": "Jane",
              "last_name": "Citizen"
            },
            "phones": [
              {
                "phone": "+61 412 345 678",
                "type": "CELL",
                "wa_id": "61412345678"
              }
            ],
            "emails": [
              {
                "email": "jane@example.com",
                "type": "WORK"
              }
            ],
            "org": {
              "company": "Example Pty Ltd"
            }
          }
        ]
      },
      "inbound": {
        "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgASGBQzQUZCMTY0MDc2MUYwNzBDNTY5MAA=",
        "from": "61412345678",
        "from_user_id": "AU.13491208655302741918",
        "name": "Jane Citizen",
        "type": "contacts",
        "text": "[{\"name\": {\"formatted_name\": \"Sam Lee\", \"first_name\": \"Sam\", \"last_name\": \"Lee\"}, \"phones\": [{\"phone\": \"+61 498 765 432\", \"wa_id\": \"61498765432\", \"type\": \"CELL\"}]}]",
        "conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_k3XbQ9rTzP2mWv7a1c9e",
        "timestamp": "2026-11-06T01:00:00.000Z",
        "contacts": [
          {
            "name": {
              "formatted_name": "Sam Lee",
              "first_name": "Sam",
              "last_name": "Lee"
            },
            "phones": [
              {
                "phone": "+61 498 765 432",
                "wa_id": "61498765432",
                "type": "CELL"
              }
            ]
          }
        ]
      },
      "slug": "contacts"
    },
    {
      "type": "reaction",
      "kind": "message",
      "title": "Reaction",
      "summary": "An emoji on one of the contact's messages; \"\" removes it.",
      "window": true,
      "counts": true,
      "limits": [
        "messages up to 30 days old",
        "only the sent status, never delivered or read"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/messages/reaction-messages",
      "example": {
        "to": "61412345678",
        "type": "reaction",
        "reaction": {
          "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgASGBQzQUZCMTY0MDc2MUYwNzBDNTY5MAA=",
          "emoji": "👍"
        }
      },
      "inbound": {
        "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgASGBQzQUZCMTY0MDc2MUYwNzBDNTY5MAA=",
        "from": "61412345678",
        "from_user_id": "AU.13491208655302741918",
        "name": "Jane Citizen",
        "type": "reaction",
        "text": "👍",
        "conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_k3XbQ9rTzP2mWv7a1c9e",
        "timestamp": "2026-11-06T01:00:00.000Z",
        "reaction": {
          "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBI1RjQyNUE3NEYxMzAzMzQ5MkEA",
          "emoji": "👍"
        }
      },
      "slug": "reaction"
    },
    {
      "type": "interactive.button",
      "kind": "interactive",
      "title": "Reply buttons",
      "summary": "Up to 3 buttons; the tap comes back as a message.",
      "window": true,
      "counts": true,
      "limits": [
        "1 to 3 buttons",
        "title up to 20 characters",
        "body up to 1024 characters"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/messages/interactive-reply-buttons-messages",
      "example": {
        "to": "61412345678",
        "type": "interactive",
        "interactive": {
          "type": "button",
          "body": {
            "text": "Confirm your booking for Friday 10:00?"
          },
          "action": {
            "buttons": [
              {
                "type": "reply",
                "reply": {
                  "id": "yes",
                  "title": "Confirm"
                }
              },
              {
                "type": "reply",
                "reply": {
                  "id": "no",
                  "title": "Change"
                }
              }
            ]
          }
        }
      },
      "inbound": {
        "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgASGBQzQUZCMTY0MDc2MUYwNzBDNTY5MAA=",
        "from": "61412345678",
        "from_user_id": "AU.13491208655302741918",
        "name": "Jane Citizen",
        "type": "interactive",
        "text": "[BUTTON_REPLY] Confirm ID: yes",
        "button": {
          "text": "Confirm",
          "payload": "yes"
        },
        "in_reply_to": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBI1RjQyNUE3NEYxMzAzMzQ5MkEA",
        "conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_k3XbQ9rTzP2mWv7a1c9e",
        "timestamp": "2026-11-06T01:00:00.000Z",
        "context": {
          "from": "4976659348270",
          "id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBI1RjQyNUE3NEYxMzAzMzQ5MkEA"
        },
        "interactive": {
          "type": "button_reply",
          "id": "yes",
          "title": "Confirm"
        }
      },
      "slug": "button"
    },
    {
      "type": "interactive.list",
      "kind": "interactive",
      "title": "List",
      "summary": "A menu of up to 10 rows in sections.",
      "window": true,
      "counts": true,
      "limits": [
        "up to 10 rows in all",
        "row title up to 24, description up to 72 characters"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/messages/interactive-list-messages",
      "example": {
        "to": "61412345678",
        "type": "interactive",
        "interactive": {
          "type": "list",
          "body": {
            "text": "Which time suits you?"
          },
          "action": {
            "button": "Times",
            "sections": [
              {
                "title": "Friday",
                "rows": [
                  {
                    "id": "fri10",
                    "title": "10:00"
                  },
                  {
                    "id": "fri11",
                    "title": "11:00"
                  }
                ]
              }
            ]
          }
        }
      },
      "inbound": {
        "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgASGBQzQUZCMTY0MDc2MUYwNzBDNTY5MAA=",
        "from": "61412345678",
        "from_user_id": "AU.13491208655302741918",
        "name": "Jane Citizen",
        "type": "interactive",
        "text": "[LIST_REPLY] 10:00 ID: fri10",
        "button": {
          "text": "10:00",
          "payload": "fri10"
        },
        "in_reply_to": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBI1RjQyNUE3NEYxMzAzMzQ5MkEA",
        "conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_k3XbQ9rTzP2mWv7a1c9e",
        "timestamp": "2026-11-06T01:00:00.000Z",
        "context": {
          "from": "4976659348270",
          "id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBI1RjQyNUE3NEYxMzAzMzQ5MkEA"
        },
        "interactive": {
          "type": "list_reply",
          "id": "fri10",
          "title": "10:00"
        }
      },
      "slug": "list"
    },
    {
      "type": "interactive.cta_url",
      "kind": "interactive",
      "title": "URL button",
      "summary": "One button that opens a link.",
      "window": true,
      "counts": true,
      "limits": [
        "button text up to 20 characters"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/messages/interactive-cta-url-messages",
      "example": {
        "to": "61412345678",
        "type": "interactive",
        "interactive": {
          "type": "cta_url",
          "body": {
            "text": "Your invoice is ready."
          },
          "action": {
            "name": "cta_url",
            "parameters": {
              "display_text": "Open invoice",
              "url": "https://example.com/invoice/1234"
            }
          }
        }
      },
      "inbound": null,
      "slug": "cta-url"
    },
    {
      "type": "interactive.carousel",
      "kind": "interactive",
      "title": "Media carousel",
      "summary": "2 to 10 scrollable cards, each with an image or video and a button.",
      "window": true,
      "counts": true,
      "limits": [
        "2 to 10 cards",
        "card body up to 160 characters",
        "the same buttons on every card",
        "no header or footer"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/messages/interactive-media-carousel-messages",
      "example": {
        "to": "61412345678",
        "type": "interactive",
        "interactive": {
          "type": "carousel",
          "body": {
            "text": "Three of our latest arrivals, each under $25:"
          },
          "action": {
            "cards": [
              {
                "card_index": 0,
                "type": "cta_url",
                "header": {
                  "type": "image",
                  "image": {
                    "link": "https://example.com/img/echeveria.jpg"
                  }
                },
                "body": {
                  "text": "*Blue Echeveria*"
                },
                "action": {
                  "name": "cta_url",
                  "parameters": {
                    "display_text": "Buy now",
                    "url": "https://shop.example.com/echeveria"
                  }
                }
              },
              {
                "card_index": 1,
                "type": "cta_url",
                "header": {
                  "type": "image",
                  "image": {
                    "link": "https://example.com/img/haworthia.jpg"
                  }
                },
                "body": {
                  "text": "*Zebra Haworthia*"
                },
                "action": {
                  "name": "cta_url",
                  "parameters": {
                    "display_text": "Buy now",
                    "url": "https://shop.example.com/haworthia"
                  }
                }
              }
            ]
          }
        }
      },
      "inbound": null,
      "slug": "carousel"
    },
    {
      "type": "interactive.product_carousel",
      "kind": "interactive",
      "title": "Product carousel",
      "summary": "2 to 10 products of the connected catalog as scrollable cards.",
      "window": true,
      "counts": true,
      "limits": [
        "2 to 10 cards of one catalog",
        "cards: type product, no header, body or buttons"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/catalogs/interactive-product-carousel-messages",
      "example": {
        "to": "61412345678",
        "type": "interactive",
        "interactive": {
          "type": "carousel",
          "body": {
            "text": "Picked for you this week:"
          },
          "action": {
            "cards": [
              {
                "card_index": 0,
                "type": "product",
                "action": {
                  "product_retailer_id": "SKU-1234",
                  "catalog_id": "194836987003835"
                }
              },
              {
                "card_index": 1,
                "type": "product",
                "action": {
                  "product_retailer_id": "SKU-5678",
                  "catalog_id": "194836987003835"
                }
              }
            ]
          }
        }
      },
      "inbound": {
        "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgASGBQzQUZCMTY0MDc2MUYwNzBDNTY5MAA=",
        "from": "61412345678",
        "from_user_id": "AU.13491208655302741918",
        "name": "Jane Citizen",
        "type": "order",
        "text": "{\"catalog_id\": \"194836987003835\", \"text\": \"For Friday please\", \"product_items\": [{\"product_retailer_id\": \"SKU-1234\", \"quantity\": 2, \"item_price\": 12.5, \"currency\": \"AUD\"}]}",
        "in_reply_to": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBI1RjQyNUE3NEYxMzAzMzQ5MkEA",
        "conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_k3XbQ9rTzP2mWv7a1c9e",
        "timestamp": "2026-11-06T01:00:00.000Z",
        "context": {
          "from": "4976659348270",
          "id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBI1RjQyNUE3NEYxMzAzMzQ5MkEA"
        },
        "order": {
          "catalog_id": "194836987003835",
          "text": "For Friday please",
          "product_items": [
            {
              "product_retailer_id": "SKU-1234",
              "quantity": 2,
              "item_price": 12.5,
              "currency": "AUD"
            }
          ]
        }
      },
      "slug": "product-carousel"
    },
    {
      "type": "interactive.location_request_message",
      "kind": "interactive",
      "title": "Location request",
      "summary": "A button that asks the contact to share their location.",
      "window": true,
      "counts": true,
      "limits": [
        "body up to 1024 characters"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/messages/location-request-messages",
      "example": {
        "to": "61412345678",
        "type": "interactive",
        "interactive": {
          "type": "location_request_message",
          "body": {
            "text": "Where should we pick you up? Tap to share your location."
          },
          "action": {
            "name": "send_location"
          }
        }
      },
      "inbound": {
        "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgASGBQzQUZCMTY0MDc2MUYwNzBDNTY5MAA=",
        "from": "61412345678",
        "from_user_id": "AU.13491208655302741918",
        "name": "Jane Citizen",
        "type": "location",
        "text": "LOCATION: , , -33.8568, 151.2153",
        "in_reply_to": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBI1RjQyNUE3NEYxMzAzMzQ5MkEA",
        "conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_k3XbQ9rTzP2mWv7a1c9e",
        "timestamp": "2026-11-06T01:00:00.000Z",
        "context": {
          "from": "4976659348270",
          "id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBI1RjQyNUE3NEYxMzAzMzQ5MkEA"
        },
        "location": {
          "latitude": -33.8568,
          "longitude": 151.2153
        }
      },
      "slug": "location-request-message"
    },
    {
      "type": "interactive.request_contact_info",
      "kind": "interactive",
      "title": "Contact info request",
      "summary": "Asks the contact to share their phone number (contacts known only by a business-scoped user id).",
      "window": true,
      "counts": true,
      "limits": [
        "button text fixed by WhatsApp"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/business-scoped-user-ids",
      "example": {
        "to": "61412345678",
        "type": "interactive",
        "interactive": {
          "type": "request_contact_info",
          "body": {
            "text": "Please share your phone number so we can call you back."
          },
          "action": {
            "name": "request_contact_info"
          }
        }
      },
      "inbound": {
        "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgASGBQzQUZCMTY0MDc2MUYwNzBDNTY5MAA=",
        "from": "61412345678",
        "from_user_id": "AU.13491208655302741918",
        "name": "Jane Citizen",
        "type": "contacts",
        "text": "[{\"name\": {\"formatted_name\": \"Jane Citizen\"}, \"phones\": [{\"phone\": \"+61 412 345 678\", \"wa_id\": \"61412345678\", \"type\": \"CELL\"}]}]",
        "conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_k3XbQ9rTzP2mWv7a1c9e",
        "timestamp": "2026-11-06T01:00:00.000Z",
        "contacts": [
          {
            "name": {
              "formatted_name": "Jane Citizen"
            },
            "phones": [
              {
                "phone": "+61 412 345 678",
                "wa_id": "61412345678",
                "type": "CELL"
              }
            ]
          }
        ]
      },
      "slug": "request-contact-info"
    },
    {
      "type": "interactive.flow",
      "kind": "interactive",
      "title": "Flow",
      "summary": "Opens a WhatsApp Flow (a form in the chat).",
      "window": true,
      "counts": true,
      "limits": [
        "flow_cta up to 30 characters",
        "flow_message_version 3"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/flows/guides/sendingaflow",
      "example": {
        "to": "61412345678",
        "type": "interactive",
        "interactive": {
          "type": "flow",
          "header": {
            "type": "text",
            "text": "Book a table"
          },
          "body": {
            "text": "Pick a day and time."
          },
          "action": {
            "name": "flow",
            "parameters": {
              "flow_message_version": "3",
              "flow_id": "1234567890123456",
              "flow_cta": "Book now",
              "flow_token": "booking-5521",
              "flow_action": "navigate",
              "flow_action_payload": {
                "screen": "WELCOME"
              }
            }
          }
        }
      },
      "inbound": {
        "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgASGBQzQUZCMTY0MDc2MUYwNzBDNTY5MAA=",
        "from": "61412345678",
        "from_user_id": "AU.13491208655302741918",
        "name": "Jane Citizen",
        "type": "interactive",
        "text": "[FLOW] Sent\r\ndate: 2026-11-13\r\ntime: 19:00",
        "button": {
          "text": "Sent",
          "payload": ""
        },
        "in_reply_to": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBI1RjQyNUE3NEYxMzAzMzQ5MkEA",
        "conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_k3XbQ9rTzP2mWv7a1c9e",
        "timestamp": "2026-11-06T01:00:00.000Z",
        "context": {
          "from": "4976659348270",
          "id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBI1RjQyNUE3NEYxMzAzMzQ5MkEA"
        },
        "interactive": {
          "type": "nfm_reply"
        },
        "flow": {
          "name": "flow",
          "body": "Sent",
          "token": "booking-5521",
          "response": {
            "flow_token": "booking-5521",
            "date": "2026-11-13",
            "time": "19:00"
          }
        }
      },
      "slug": "flow"
    },
    {
      "type": "interactive.product",
      "kind": "interactive",
      "title": "Single product",
      "summary": "One product of the connected catalog.",
      "window": true,
      "counts": true,
      "limits": [
        "needs a catalog connected to the WhatsApp account"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/catalogs/share-products",
      "example": {
        "to": "61412345678",
        "type": "interactive",
        "interactive": {
          "type": "product",
          "body": {
            "text": "The one you asked about:"
          },
          "action": {
            "catalog_id": "194836987003835",
            "product_retailer_id": "SKU-1234"
          }
        }
      },
      "inbound": {
        "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgASGBQzQUZCMTY0MDc2MUYwNzBDNTY5MAA=",
        "from": "61412345678",
        "from_user_id": "AU.13491208655302741918",
        "name": "Jane Citizen",
        "type": "order",
        "text": "{\"catalog_id\": \"194836987003835\", \"text\": \"For Friday please\", \"product_items\": [{\"product_retailer_id\": \"SKU-1234\", \"quantity\": 2, \"item_price\": 12.5, \"currency\": \"AUD\"}]}",
        "in_reply_to": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBI1RjQyNUE3NEYxMzAzMzQ5MkEA",
        "conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_k3XbQ9rTzP2mWv7a1c9e",
        "timestamp": "2026-11-06T01:00:00.000Z",
        "context": {
          "from": "4976659348270",
          "id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBI1RjQyNUE3NEYxMzAzMzQ5MkEA"
        },
        "order": {
          "catalog_id": "194836987003835",
          "text": "For Friday please",
          "product_items": [
            {
              "product_retailer_id": "SKU-1234",
              "quantity": 2,
              "item_price": 12.5,
              "currency": "AUD"
            }
          ]
        }
      },
      "slug": "product"
    },
    {
      "type": "interactive.product_list",
      "kind": "interactive",
      "title": "Product list",
      "summary": "Up to 30 products in up to 10 sections.",
      "window": true,
      "counts": true,
      "limits": [
        "1 to 10 sections, up to 30 products",
        "text header required"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/catalogs/share-products",
      "example": {
        "to": "61412345678",
        "type": "interactive",
        "interactive": {
          "type": "product_list",
          "header": {
            "type": "text",
            "text": "Our picks"
          },
          "body": {
            "text": "Popular this week."
          },
          "action": {
            "catalog_id": "194836987003835",
            "sections": [
              {
                "title": "Succulents",
                "product_items": [
                  {
                    "product_retailer_id": "SKU-1234"
                  },
                  {
                    "product_retailer_id": "SKU-5678"
                  }
                ]
              }
            ]
          }
        }
      },
      "inbound": {
        "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgASGBQzQUZCMTY0MDc2MUYwNzBDNTY5MAA=",
        "from": "61412345678",
        "from_user_id": "AU.13491208655302741918",
        "name": "Jane Citizen",
        "type": "order",
        "text": "{\"catalog_id\": \"194836987003835\", \"text\": \"For Friday please\", \"product_items\": [{\"product_retailer_id\": \"SKU-1234\", \"quantity\": 2, \"item_price\": 12.5, \"currency\": \"AUD\"}]}",
        "in_reply_to": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBI1RjQyNUE3NEYxMzAzMzQ5MkEA",
        "conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_k3XbQ9rTzP2mWv7a1c9e",
        "timestamp": "2026-11-06T01:00:00.000Z",
        "context": {
          "from": "4976659348270",
          "id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBI1RjQyNUE3NEYxMzAzMzQ5MkEA"
        },
        "order": {
          "catalog_id": "194836987003835",
          "text": "For Friday please",
          "product_items": [
            {
              "product_retailer_id": "SKU-1234",
              "quantity": 2,
              "item_price": 12.5,
              "currency": "AUD"
            }
          ]
        }
      },
      "slug": "product-list"
    },
    {
      "type": "interactive.catalog_message",
      "kind": "interactive",
      "title": "Catalog",
      "summary": "A button that opens the whole catalog.",
      "window": true,
      "counts": true,
      "limits": [
        "needs a connected catalog"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/catalogs/share-products",
      "example": {
        "to": "61412345678",
        "type": "interactive",
        "interactive": {
          "type": "catalog_message",
          "body": {
            "text": "Browse our catalog."
          },
          "action": {
            "name": "catalog_message",
            "parameters": {
              "thumbnail_product_retailer_id": "SKU-1234"
            }
          }
        }
      },
      "inbound": {
        "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgASGBQzQUZCMTY0MDc2MUYwNzBDNTY5MAA=",
        "from": "61412345678",
        "from_user_id": "AU.13491208655302741918",
        "name": "Jane Citizen",
        "type": "order",
        "text": "{\"catalog_id\": \"194836987003835\", \"text\": \"For Friday please\", \"product_items\": [{\"product_retailer_id\": \"SKU-1234\", \"quantity\": 2, \"item_price\": 12.5, \"currency\": \"AUD\"}]}",
        "in_reply_to": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBI1RjQyNUE3NEYxMzAzMzQ5MkEA",
        "conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_k3XbQ9rTzP2mWv7a1c9e",
        "timestamp": "2026-11-06T01:00:00.000Z",
        "context": {
          "from": "4976659348270",
          "id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBI1RjQyNUE3NEYxMzAzMzQ5MkEA"
        },
        "order": {
          "catalog_id": "194836987003835",
          "text": "For Friday please",
          "product_items": [
            {
              "product_retailer_id": "SKU-1234",
              "quantity": 2,
              "item_price": 12.5,
              "currency": "AUD"
            }
          ]
        }
      },
      "slug": "catalog-message"
    },
    {
      "type": "interactive.call_permission_request",
      "kind": "interactive",
      "title": "Call permission request",
      "summary": "Asks the contact to allow WhatsApp calls from the business.",
      "window": true,
      "counts": true,
      "limits": [
        "Needs Meta enablement: Calling"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/calling/user-call-permissions",
      "example": {
        "to": "61412345678",
        "type": "interactive",
        "interactive": {
          "type": "call_permission_request",
          "body": {
            "text": "May we call you on WhatsApp about your order?"
          },
          "action": {
            "name": "call_permission_request"
          }
        }
      },
      "inbound": null,
      "slug": "call-permission-request"
    },
    {
      "type": "interactive.voice_call",
      "kind": "interactive",
      "title": "Call button",
      "summary": "A button that starts a WhatsApp call to the business.",
      "window": true,
      "counts": true,
      "limits": [
        "Needs Meta enablement: Calling",
        "button text up to 20 characters"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/calling/call-button-messages-deep-links",
      "example": {
        "to": "61412345678",
        "type": "interactive",
        "interactive": {
          "type": "voice_call",
          "body": {
            "text": "Questions? Call us on WhatsApp."
          },
          "action": {
            "name": "voice_call",
            "parameters": {
              "display_text": "Call us",
              "ttl_minutes": 60
            }
          }
        }
      },
      "inbound": null,
      "slug": "voice-call"
    },
    {
      "type": "interactive.address_message",
      "kind": "interactive",
      "title": "Address request",
      "summary": "A form for a delivery address (India only).",
      "window": true,
      "counts": true,
      "limits": [
        "India: business and customer",
        "optional text header"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/messages/address-messages",
      "example": {
        "to": "919876543210",
        "type": "interactive",
        "interactive": {
          "type": "address_message",
          "body": {
            "text": "Where should we deliver?"
          },
          "action": {
            "name": "address_message",
            "parameters": {
              "country": "IN"
            }
          }
        }
      },
      "inbound": null,
      "slug": "address-message"
    },
    {
      "type": "interactive.order_details",
      "kind": "interactive",
      "title": "Order details",
      "summary": "An order to review and pay (payments: India, Brazil, Singapore).",
      "window": true,
      "counts": true,
      "limits": [
        "a payment configuration in WhatsApp Manager"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/payments",
      "example": {
        "to": "919876543210",
        "type": "interactive",
        "interactive": {
          "type": "order_details",
          "body": {
            "text": "Your order is ready to pay."
          },
          "action": {
            "name": "review_and_pay",
            "parameters": {
              "reference_id": "ORDER-1234",
              "type": "digital-goods",
              "payment_type": "upi",
              "payment_configuration": "my-config",
              "currency": "INR",
              "total_amount": {
                "value": 21000,
                "offset": 100
              },
              "order": {
                "status": "pending",
                "subtotal": {
                  "value": 21000,
                  "offset": 100
                },
                "items": [
                  {
                    "retailer_id": "SKU-1234",
                    "name": "Gift card",
                    "amount": {
                      "value": 21000,
                      "offset": 100
                    },
                    "quantity": 1
                  }
                ]
              }
            }
          }
        }
      },
      "inbound": null,
      "slug": "order-details"
    },
    {
      "type": "interactive.order_status",
      "kind": "interactive",
      "title": "Order status",
      "summary": "An update to an order sent with order_details.",
      "window": true,
      "counts": true,
      "limits": [
        "the reference_id of an order_details message"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/payments",
      "example": {
        "to": "919876543210",
        "type": "interactive",
        "interactive": {
          "type": "order_status",
          "body": {
            "text": "Your order has shipped."
          },
          "action": {
            "name": "review_order",
            "parameters": {
              "reference_id": "ORDER-1234",
              "order": {
                "status": "shipped",
                "description": "Arrives Friday"
              }
            }
          }
        }
      },
      "inbound": null,
      "slug": "order-status"
    },
    {
      "type": "template",
      "kind": "template",
      "title": "Template",
      "summary": "An approved template: the only message that starts a conversation.",
      "window": false,
      "counts": true,
      "limits": [
        "the components must match the approved template"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/overview",
      "example": {
        "to": "61412345678",
        "type": "template",
        "template": {
          "name": "order_update",
          "language": {
            "code": "en"
          },
          "components": [
            {
              "type": "body",
              "parameters": [
                {
                  "type": "text",
                  "text": "Jane"
                },
                {
                  "type": "text",
                  "text": "#1234"
                }
              ]
            }
          ]
        }
      },
      "inbound": {
        "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgASGBQzQUZCMTY0MDc2MUYwNzBDNTY5MAA=",
        "from": "61412345678",
        "from_user_id": "AU.13491208655302741918",
        "name": "Jane Citizen",
        "type": "button",
        "text": "[BUTTON] Track my order PAYLOAD: track",
        "button": {
          "text": "Track my order",
          "payload": "track"
        },
        "in_reply_to": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBI1RjQyNUE3NEYxMzAzMzQ5MkEA",
        "conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_k3XbQ9rTzP2mWv7a1c9e",
        "timestamp": "2026-11-06T01:00:00.000Z",
        "context": {
          "from": "4976659348270",
          "id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBI1RjQyNUE3NEYxMzAzMzQ5MkEA"
        }
      },
      "slug": "template"
    },
    {
      "type": "template.named",
      "kind": "template",
      "title": "Template, named parameters",
      "summary": "Placeholders by name ({{first_name}}).",
      "window": false,
      "counts": true,
      "limits": [
        "parameter_name on every body parameter"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/overview",
      "example": {
        "to": "61412345678",
        "type": "template",
        "template": {
          "name": "order_update_named",
          "language": {
            "code": "en"
          },
          "components": [
            {
              "type": "body",
              "parameters": [
                {
                  "type": "text",
                  "parameter_name": "first_name",
                  "text": "Jane"
                },
                {
                  "type": "text",
                  "parameter_name": "order_id",
                  "text": "#1234"
                }
              ]
            }
          ]
        }
      },
      "inbound": null,
      "slug": "template-named"
    },
    {
      "type": "template.location",
      "kind": "template",
      "title": "Template, location header",
      "summary": "A map pin as the header.",
      "window": false,
      "counts": true,
      "limits": [
        "latitude and longitude required"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/utility-templates/location-request-templates",
      "example": {
        "to": "61412345678",
        "type": "template",
        "template": {
          "name": "pickup_ready",
          "language": {
            "code": "en"
          },
          "components": [
            {
              "type": "header",
              "parameters": [
                {
                  "type": "location",
                  "location": {
                    "latitude": "-33.8568",
                    "longitude": "151.2153",
                    "name": "Our shop",
                    "address": "1 George St, Sydney"
                  }
                }
              ]
            },
            {
              "type": "body",
              "parameters": [
                {
                  "type": "text",
                  "text": "Jane"
                }
              ]
            }
          ]
        }
      },
      "inbound": null,
      "slug": "template-location"
    },
    {
      "type": "template.carousel",
      "kind": "template",
      "title": "Carousel template",
      "summary": "2 to 10 media cards, as many as the approved template has.",
      "window": false,
      "counts": true,
      "limits": [
        "the card count of the approved template",
        "each card: its header media, body values, button values"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/marketing-templates/media-card-carousel-templates",
      "example": {
        "to": "61412345678",
        "type": "template",
        "template": {
          "name": "summer_succulents",
          "language": {
            "code": "en"
          },
          "components": [
            {
              "type": "body",
              "parameters": [
                {
                  "type": "text",
                  "text": "Jane"
                }
              ]
            },
            {
              "type": "carousel",
              "cards": [
                {
                  "card_index": 0,
                  "components": [
                    {
                      "type": "header",
                      "parameters": [
                        {
                          "type": "image",
                          "image": {
                            "link": "https://example.com/img/card0.jpg"
                          }
                        }
                      ]
                    },
                    {
                      "type": "button",
                      "sub_type": "quick_reply",
                      "index": "0",
                      "parameters": [
                        {
                          "type": "payload",
                          "payload": "more-0"
                        }
                      ]
                    },
                    {
                      "type": "button",
                      "sub_type": "url",
                      "index": "1",
                      "parameters": [
                        {
                          "type": "text",
                          "text": "card-0"
                        }
                      ]
                    }
                  ]
                },
                {
                  "card_index": 1,
                  "components": [
                    {
                      "type": "header",
                      "parameters": [
                        {
                          "type": "image",
                          "image": {
                            "link": "https://example.com/img/card1.jpg"
                          }
                        }
                      ]
                    },
                    {
                      "type": "button",
                      "sub_type": "quick_reply",
                      "index": "0",
                      "parameters": [
                        {
                          "type": "payload",
                          "payload": "more-1"
                        }
                      ]
                    },
                    {
                      "type": "button",
                      "sub_type": "url",
                      "index": "1",
                      "parameters": [
                        {
                          "type": "text",
                          "text": "card-1"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      },
      "inbound": null,
      "slug": "template-carousel"
    },
    {
      "type": "template.product_carousel",
      "kind": "template",
      "title": "Product card carousel template",
      "summary": "Cards that each show a catalog product.",
      "window": false,
      "counts": true,
      "limits": [
        "needs a connected catalog"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/marketing-templates/product-card-carousel-templates",
      "example": {
        "to": "61412345678",
        "type": "template",
        "template": {
          "name": "product_picks",
          "language": {
            "code": "en"
          },
          "components": [
            {
              "type": "carousel",
              "cards": [
                {
                  "card_index": 0,
                  "components": [
                    {
                      "type": "header",
                      "parameters": [
                        {
                          "type": "product",
                          "product": {
                            "product_retailer_id": "SKU-1234",
                            "catalog_id": "194836987003835"
                          }
                        }
                      ]
                    }
                  ]
                },
                {
                  "card_index": 1,
                  "components": [
                    {
                      "type": "header",
                      "parameters": [
                        {
                          "type": "product",
                          "product": {
                            "product_retailer_id": "SKU-5678",
                            "catalog_id": "194836987003835"
                          }
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      },
      "inbound": null,
      "slug": "template-product-carousel"
    },
    {
      "type": "template.limited_time_offer",
      "kind": "template",
      "title": "Limited-time offer template",
      "summary": "An offer with an expiry countdown and a coupon code.",
      "window": false,
      "counts": true,
      "limits": [
        "expiration_time_ms in the future when the template has an expiration"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/marketing-templates/limited-time-offer-templates",
      "example": {
        "to": "61412345678",
        "type": "template",
        "template": {
          "name": "flash_sale",
          "language": {
            "code": "en"
          },
          "components": [
            {
              "type": "header",
              "parameters": [
                {
                  "type": "image",
                  "image": {
                    "link": "https://example.com/img/sale.jpg"
                  }
                }
              ]
            },
            {
              "type": "limited_time_offer",
              "parameters": [
                {
                  "type": "limited_time_offer",
                  "limited_time_offer": {
                    "expiration_time_ms": 1767225600000
                  }
                }
              ]
            },
            {
              "type": "button",
              "sub_type": "copy_code",
              "index": "0",
              "parameters": [
                {
                  "type": "coupon_code",
                  "coupon_code": "SAVE20"
                }
              ]
            },
            {
              "type": "button",
              "sub_type": "url",
              "index": "1",
              "parameters": [
                {
                  "type": "text",
                  "text": "summer"
                }
              ]
            }
          ]
        }
      },
      "inbound": null,
      "slug": "template-limited-time-offer"
    },
    {
      "type": "template.copy_code",
      "kind": "template",
      "title": "Coupon code template",
      "summary": "A button that copies a coupon code.",
      "window": false,
      "counts": true,
      "limits": [
        "coupon_code up to 20 characters (15 in a limited-time offer)"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/marketing-templates/coupon-templates",
      "example": {
        "to": "61412345678",
        "type": "template",
        "template": {
          "name": "welcome_coupon",
          "language": {
            "code": "en"
          },
          "components": [
            {
              "type": "button",
              "sub_type": "copy_code",
              "index": "0",
              "parameters": [
                {
                  "type": "coupon_code",
                  "coupon_code": "WELCOME10"
                }
              ]
            }
          ]
        }
      },
      "inbound": null,
      "slug": "template-copy-code"
    },
    {
      "type": "template.catalog",
      "kind": "template",
      "title": "Catalog template",
      "summary": "A button that opens the catalog.",
      "window": false,
      "counts": true,
      "limits": [
        "needs a connected catalog"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/marketing-templates/catalog-templates",
      "example": {
        "to": "61412345678",
        "type": "template",
        "template": {
          "name": "browse_catalog",
          "language": {
            "code": "en"
          },
          "components": [
            {
              "type": "button",
              "sub_type": "catalog",
              "index": "0",
              "parameters": [
                {
                  "type": "action",
                  "action": {
                    "thumbnail_product_retailer_id": "SKU-1234"
                  }
                }
              ]
            }
          ]
        }
      },
      "inbound": null,
      "slug": "template-catalog"
    },
    {
      "type": "template.mpm",
      "kind": "template",
      "title": "Multi-product template",
      "summary": "Up to 30 products in up to 10 sections.",
      "window": false,
      "counts": true,
      "limits": [
        "1 to 10 sections, up to 30 products"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/marketing-templates/mpm-templates",
      "example": {
        "to": "61412345678",
        "type": "template",
        "template": {
          "name": "new_arrivals",
          "language": {
            "code": "en"
          },
          "components": [
            {
              "type": "header",
              "parameters": [
                {
                  "type": "text",
                  "text": "Succulents"
                }
              ]
            },
            {
              "type": "button",
              "sub_type": "mpm",
              "index": "0",
              "parameters": [
                {
                  "type": "action",
                  "action": {
                    "thumbnail_product_retailer_id": "SKU-1234",
                    "sections": [
                      {
                        "title": "Popular",
                        "product_items": [
                          {
                            "product_retailer_id": "SKU-1234"
                          },
                          {
                            "product_retailer_id": "SKU-5678"
                          }
                        ]
                      }
                    ]
                  }
                }
              ]
            }
          ]
        }
      },
      "inbound": null,
      "slug": "template-mpm"
    },
    {
      "type": "template.spm",
      "kind": "template",
      "title": "Single-product template",
      "summary": "One catalog product as the header.",
      "window": false,
      "counts": true,
      "limits": [
        "product_retailer_id and catalog_id"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/marketing-templates/spm-templates",
      "example": {
        "to": "61412345678",
        "type": "template",
        "template": {
          "name": "product_of_the_week",
          "language": {
            "code": "en"
          },
          "components": [
            {
              "type": "header",
              "parameters": [
                {
                  "type": "product",
                  "product": {
                    "product_retailer_id": "SKU-1234",
                    "catalog_id": "194836987003835"
                  }
                }
              ]
            }
          ]
        }
      },
      "inbound": null,
      "slug": "template-spm"
    },
    {
      "type": "template.flow",
      "kind": "template",
      "title": "Flow button template",
      "summary": "A button that opens a WhatsApp Flow.",
      "window": false,
      "counts": true,
      "limits": [
        "flow_token optional"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/flows/guides/sendingaflow",
      "example": {
        "to": "61412345678",
        "type": "template",
        "template": {
          "name": "book_a_table",
          "language": {
            "code": "en"
          },
          "components": [
            {
              "type": "button",
              "sub_type": "flow",
              "index": "0",
              "parameters": [
                {
                  "type": "action",
                  "action": {
                    "flow_token": "booking-5521",
                    "flow_action_data": {
                      "party_size": 2
                    }
                  }
                }
              ]
            }
          ]
        }
      },
      "inbound": null,
      "slug": "template-flow"
    },
    {
      "type": "template.otp",
      "kind": "template",
      "title": "One-time password template",
      "summary": "An authentication code with a copy or autofill button.",
      "window": false,
      "counts": true,
      "limits": [
        "the code in the body and in the button",
        "not to a business-scoped user id (131062)"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/authentication-templates/authentication-templates",
      "example": {
        "to": "61412345678",
        "type": "template",
        "template": {
          "name": "login_code",
          "language": {
            "code": "en"
          },
          "components": [
            {
              "type": "body",
              "parameters": [
                {
                  "type": "text",
                  "text": "482913"
                }
              ]
            },
            {
              "type": "button",
              "sub_type": "url",
              "index": "0",
              "parameters": [
                {
                  "type": "text",
                  "text": "482913"
                }
              ]
            }
          ]
        }
      },
      "inbound": null,
      "slug": "template-otp"
    },
    {
      "type": "template.marketing_messages_api",
      "kind": "template",
      "title": "Marketing template via the Marketing Messages API",
      "summary": "marketing_api picks the path; sent_via in the answer says which one was used.",
      "window": false,
      "counts": true,
      "limits": [
        "MARKETING templates only",
        "the account must be onboarded (GET /marketing)"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/marketing-messages/send-marketing-messages",
      "example": {
        "to": "61412345678",
        "type": "template",
        "template": {
          "name": "november_offer",
          "language": {
            "code": "en"
          },
          "components": [
            {
              "type": "body",
              "parameters": [
                {
                  "type": "text",
                  "text": "Jane"
                }
              ]
            }
          ]
        },
        "marketing_api": "mm_api",
        "product_policy": "CLOUD_API_FALLBACK",
        "message_activity_sharing": true,
        "callback_data": "campaign-nov"
      },
      "inbound": null,
      "answer": {
        "success": true,
        "request_id": "m7mmq",
        "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBI1RjQyNUE3NEYxMzAzMzQ5MkEA",
        "status": "accepted",
        "from": "4976659348270",
        "to": "61412345678",
        "template": {
          "name": "november_offer",
          "language": "en",
          "category": "MARKETING"
        },
        "text": "Hi Jane, 20% off this week.",
        "conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_k3XbQ9rTzP2mWv7a1c9e",
        "sent_via": "mm_api",
        "whatsapp_status": "accepted",
        "contacts": [
          {
            "input": "61412345678",
            "wa_id": "61412345678"
          }
        ],
        "note": "accepted by WhatsApp. delivery and read status appear in your app2email Activity Log (WhatsApp sent)."
      },
      "slug": "template-marketing-messages-api"
    },
    {
      "type": "status.read",
      "kind": "status",
      "title": "Mark as read and typing",
      "summary": "Blue ticks, and the typing indicator while you prepare a reply. Free.",
      "window": false,
      "counts": false,
      "limits": [
        "messages up to 30 days old",
        "typing: 25 seconds or until your reply"
      ],
      "meta_doc": "https://developers.facebook.com/documentation/business-messaging/whatsapp/messages/mark-message-as-read",
      "example": {
        "messaging_product": "whatsapp",
        "status": "read",
        "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgASGBQzQUZCMTY0MDc2MUYwNzBDNTY5MAA=",
        "typing_indicator": {
          "type": "text"
        }
      },
      "inbound": null,
      "answer": {
        "success": true,
        "request_id": "k2rdq",
        "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgASGBQzQUZCMTY0MDc2MUYwNzBDNTY5MAA=",
        "status": "read",
        "typing_indicator": true
      },
      "slug": "mark-read"
    }
  ],
  "x-a2e-webhook-events": [
    {
      "type": "message.status",
      "group": "Messages",
      "when": "A message sent from the number was sent, delivered, read, failed or deleted.",
      "data": {
        "type": "object",
        "properties": {
          "message_id": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "sent",
              "delivered",
              "read",
              "played",
              "clicked",
              "failed",
              "deleted"
            ],
            "description": "played: a voice message was played. clicked: a link in a Marketing Messages API message was clicked (no clicker identity)."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "integer",
                "description": "Meta's error code."
              },
              "message": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "details": {
                "type": "string"
              },
              "href": {
                "type": "string"
              },
              "error_code": {
                "type": "string",
                "description": "app2email's code for it: the same codes as API errors (/docs/api/errors)."
              },
              "how_to_fix": {
                "type": "string"
              },
              "is_retriable": {
                "type": "boolean"
              },
              "retry_after_seconds": {
                "type": "integer"
              }
            }
          },
          "sent_by": {
            "type": "string",
            "description": "api, dashboard, broadcast, email, autoreply ..."
          },
          "broadcast_code": {
            "type": "string"
          },
          "whatsapp_status": {
            "type": "string",
            "description": "Meta's status, unchanged."
          },
          "pricing": {
            "type": "object",
            "properties": {
              "billable": {
                "type": "boolean"
              },
              "pricing_model": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "description": "regular, free_customer_service, free_entry_point ..."
              },
              "category": {
                "type": "string"
              }
            },
            "description": "What Meta charges for the message (on one of its statuses)."
          },
          "callback_data": {
            "type": "string",
            "description": "The biz_opaque_callback_data given when sending."
          },
          "recipient_user_id": {
            "type": "string",
            "description": "The contact's business-scoped user id."
          },
          "recipient_identity_key_hash": {
            "type": "string",
            "description": "The contact's identity key hash, when the identity check is on (PUT /settings/identity-check)."
          },
          "conversation": {
            "type": "object",
            "additionalProperties": true,
            "description": "Meta's conversation object, when it sends one."
          },
          "whatsapp": {
            "type": "object",
            "additionalProperties": true,
            "description": "Meta's object, unchanged."
          }
        },
        "required": [
          "message_id",
          "to",
          "status"
        ]
      },
      "samples": {
        "delivered": {
          "id": "evt_Xq3k9m2Lw8Rt5Yp1Zs01",
          "type": "message.status",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA=",
            "to": "61412345678",
            "status": "delivered",
            "timestamp": "2026-11-06T01:00:00.000Z",
            "sent_by": "api",
            "whatsapp_status": "delivered",
            "recipient_user_id": "AU.1234567890123456",
            "pricing": {
              "billable": true,
              "pricing_model": "PMP",
              "type": "regular",
              "category": "utility"
            },
            "callback_data": "order-1234"
          }
        },
        "played": {
          "id": "evt_Pa3k9m2Lw8Rt5Yp1Zs010",
          "type": "message.status",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA=",
            "to": "61412345678",
            "status": "played",
            "timestamp": "2026-11-06T01:00:00.000Z",
            "sent_by": "api",
            "whatsapp_status": "played"
          }
        }
      }
    },
    {
      "type": "message.received",
      "group": "Messages",
      "when": "A contact sent a message or tapped a button. While WhatsApp's AI agent holds the conversation (owner whatsapp_ai) a reply goes through only after it passes the conversation on (conversation.owner_changed).",
      "data": {
        "type": "object",
        "properties": {
          "message_id": {
            "type": "string"
          },
          "from": {
            "type": "string"
          },
          "from_user_id": {
            "type": "string",
            "description": "The contact's business-scoped user id, when WhatsApp gave one."
          },
          "media_url": {
            "type": "string",
            "description": "app2email's stored copy of received media (GET /v1/{number}/media/{message_id})."
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "description": "text, image, video, audio, document, sticker, location, contacts, reaction, button, interactive, order, request_welcome (the contact opened the chat), system, unsupported ..."
          },
          "text": {
            "type": "string"
          },
          "button": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              },
              "payload": {
                "type": "string"
              }
            }
          },
          "in_reply_to": {
            "type": "string"
          },
          "conversation_url": {
            "type": "string"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "context": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "forwarded": {
                "type": "boolean"
              },
              "frequently_forwarded": {
                "type": "boolean"
              },
              "referred_product": {
                "type": "object",
                "additionalProperties": true
              }
            },
            "description": "What it replies to or forwards."
          },
          "referral": {
            "type": "object",
            "additionalProperties": true,
            "description": "The ad or post a click-to-WhatsApp message came from."
          },
          "location": {
            "type": "object",
            "properties": {
              "latitude": {
                "type": "number"
              },
              "longitude": {
                "type": "number"
              },
              "name": {
                "type": "string"
              },
              "address": {
                "type": "string"
              },
              "url": {
                "type": "string"
              }
            }
          },
          "contacts": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            },
            "description": "Shared contact cards, as Meta sent them."
          },
          "reaction": {
            "type": "object",
            "properties": {
              "message_id": {
                "type": "string"
              },
              "emoji": {
                "type": "string",
                "description": "Empty when the reaction was removed."
              }
            }
          },
          "interactive": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "description": "button_reply, list_reply, nfm_reply ..."
              },
              "id": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "description": {
                "type": "string"
              }
            }
          },
          "flow": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "body": {
                "type": "string"
              },
              "token": {
                "type": "string",
                "description": "The flow_token sent with the Flow."
              },
              "response": {
                "type": "object",
                "additionalProperties": true,
                "description": "What the contact filled in."
              }
            },
            "description": "A WhatsApp Flow's answer (interactive nfm_reply)."
          },
          "order": {
            "type": "object",
            "properties": {
              "catalog_id": {
                "type": "string"
              },
              "text": {
                "type": "string"
              },
              "product_items": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "identity_key_hash": {
            "type": "string",
            "description": "The contact's identity key hash (the identity check is on): send it back as recipient_identity_key_hash."
          },
          "whatsapp": {
            "type": "object",
            "additionalProperties": true,
            "description": "Meta's object, unchanged."
          }
        },
        "required": [
          "message_id",
          "from",
          "type"
        ]
      },
      "samples": {
        "text": {
          "id": "evt_Xq3k9m2Lw8Rt5Yp1Zs01",
          "type": "message.received",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA=",
            "from": "61412345678",
            "name": "Sample Contact",
            "type": "text",
            "text": "Hi, is my order on its way?",
            "conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_SAMPLEk3XbQ9rTzP2mW",
            "timestamp": "2026-11-06T01:00:00.000Z",
            "from_user_id": "AU.1234567890123456",
            "whatsapp": {
              "from": "61412345678",
              "from_user_id": "AU.1234567890123456",
              "id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA=",
              "timestamp": "1762390800",
              "type": "text",
              "text": {
                "body": "Hi, is my order on its way?"
              }
            }
          }
        },
        "image": {
          "id": "evt_Pa3k9m2Lw8Rt5Yp1Zs017",
          "type": "message.received",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA=",
            "from": "61412345678",
            "from_user_id": "AU.1234567890123456",
            "media_url": "https://api.app2email.com/v1/4976659348270/media/wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA%3D",
            "name": "Sample Contact",
            "type": "image",
            "text": "[IMAGE, photo.jpg, image/jpeg, 48213 bytes] Is this the right part?",
            "in_reply_to": "wamid.HBgLNjE0MTIzNDU2NzgVAgASGBJPUklHSU5BTF9NRVNTQUdFAA==",
            "context": {
              "from": "4976659348270",
              "id": "wamid.HBgLNjE0MTIzNDU2NzgVAgASGBJPUklHSU5BTF9NRVNTQUdFAA=="
            },
            "conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_SAMPLEk3XbQ9rTzP2mW",
            "timestamp": "2026-11-06T01:00:00.000Z"
          }
        },
        "button_reply": {
          "id": "evt_Pa3k9m2Lw8Rt5Yp1Zs012",
          "type": "message.received",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA=",
            "from": "61412345678",
            "from_user_id": "AU.1234567890123456",
            "name": "Sample Contact",
            "type": "interactive",
            "text": "Track my order",
            "in_reply_to": "wamid.HBgLNjE0MTIzNDU2NzgVAgASGBJPUklHSU5BTF9NRVNTQUdFAA==",
            "interactive": {
              "type": "button_reply",
              "id": "track",
              "title": "Track my order"
            },
            "context": {
              "from": "4976659348270",
              "id": "wamid.HBgLNjE0MTIzNDU2NzgVAgASGBJPUklHSU5BTF9NRVNTQUdFAA=="
            },
            "conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_SAMPLEk3XbQ9rTzP2mW",
            "timestamp": "2026-11-06T01:00:00.000Z"
          }
        },
        "location": {
          "id": "evt_Pa3k9m2Lw8Rt5Yp1Zs013",
          "type": "message.received",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA=",
            "from": "61412345678",
            "name": "Sample Contact",
            "type": "location",
            "text": "-33.8688,151.2093 Sydney Opera House",
            "location": {
              "latitude": -33.8688,
              "longitude": 151.2093,
              "name": "Sydney Opera House",
              "address": "Bennelong Point, Sydney NSW 2000"
            },
            "conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_SAMPLEk3XbQ9rTzP2mW",
            "timestamp": "2026-11-06T01:00:00.000Z"
          }
        },
        "flow": {
          "id": "evt_Pa3k9m2Lw8Rt5Yp1Zs014",
          "type": "message.received",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA=",
            "from": "61412345678",
            "name": "Sample Contact",
            "type": "interactive",
            "text": "Sent",
            "interactive": {
              "type": "nfm_reply"
            },
            "flow": {
              "name": "flow",
              "body": "Sent",
              "token": "booking-1234",
              "response": {
                "date": "2026-11-20",
                "people": "2",
                "flow_token": "booking-1234"
              }
            },
            "conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_SAMPLEk3XbQ9rTzP2mW",
            "timestamp": "2026-11-06T01:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "message.failed",
      "group": "Messages",
      "when": "A message sent from the number failed (the same data as message.status).",
      "data": {
        "type": "object",
        "properties": {
          "message_id": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "sent",
              "delivered",
              "read",
              "played",
              "clicked",
              "failed",
              "deleted"
            ],
            "description": "played: a voice message was played. clicked: a link in a Marketing Messages API message was clicked (no clicker identity)."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "integer",
                "description": "Meta's error code."
              },
              "message": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "details": {
                "type": "string"
              },
              "href": {
                "type": "string"
              },
              "error_code": {
                "type": "string",
                "description": "app2email's code for it: the same codes as API errors (/docs/api/errors)."
              },
              "how_to_fix": {
                "type": "string"
              },
              "is_retriable": {
                "type": "boolean"
              },
              "retry_after_seconds": {
                "type": "integer"
              }
            }
          },
          "sent_by": {
            "type": "string",
            "description": "api, dashboard, broadcast, email, autoreply ..."
          },
          "broadcast_code": {
            "type": "string"
          },
          "whatsapp_status": {
            "type": "string",
            "description": "Meta's status, unchanged."
          },
          "pricing": {
            "type": "object",
            "properties": {
              "billable": {
                "type": "boolean"
              },
              "pricing_model": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "description": "regular, free_customer_service, free_entry_point ..."
              },
              "category": {
                "type": "string"
              }
            },
            "description": "What Meta charges for the message (on one of its statuses)."
          },
          "callback_data": {
            "type": "string",
            "description": "The biz_opaque_callback_data given when sending."
          },
          "recipient_user_id": {
            "type": "string",
            "description": "The contact's business-scoped user id."
          },
          "recipient_identity_key_hash": {
            "type": "string",
            "description": "The contact's identity key hash, when the identity check is on (PUT /settings/identity-check)."
          },
          "conversation": {
            "type": "object",
            "additionalProperties": true,
            "description": "Meta's conversation object, when it sends one."
          },
          "whatsapp": {
            "type": "object",
            "additionalProperties": true,
            "description": "Meta's object, unchanged."
          }
        },
        "required": [
          "message_id",
          "to",
          "status"
        ]
      },
      "samples": {
        "failed": {
          "id": "evt_Xq3k9m2Lw8Rt5Yp1Zs01",
          "type": "message.failed",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA=",
            "to": "61412345678",
            "status": "failed",
            "timestamp": "2026-11-06T01:00:00.000Z",
            "error": {
              "code": 131026,
              "message": "Message Undeliverable.",
              "title": "Message undeliverable",
              "details": "Message Undeliverable.",
              "error_code": "recipient_unreachable",
              "how_to_fix": "WhatsApp could not deliver to this number. Check it is a WhatsApp number written with its country code (digits only, eg 61412345678), and that the person uses an up to date WhatsApp.",
              "is_retriable": false
            },
            "sent_by": "api",
            "whatsapp_status": "failed"
          }
        },
        "marketing_limit": {
          "id": "evt_Pa3k9m2Lw8Rt5Yp1Zs011",
          "type": "message.failed",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA=",
            "to": "61412345678",
            "status": "failed",
            "timestamp": "2026-11-06T01:00:00.000Z",
            "sent_by": "broadcast",
            "whatsapp_status": "failed",
            "error": {
              "code": 131049,
              "message": "This message was not delivered to maintain healthy ecosystem engagement.",
              "title": "This message was not delivered to maintain healthy ecosystem engagement.",
              "error_code": "marketing_per_user_limit",
              "how_to_fix": "WhatsApp held this marketing message back: the person has had many marketing messages lately. Do not send it again within 24 hours, because retrying sooner keeps the block longer.",
              "is_retriable": false,
              "retry_after_seconds": 86400
            }
          }
        }
      }
    },
    {
      "type": "contact.opted_out",
      "group": "Contacts",
      "when": "A contact was added to the Do Not Call list by their own action.",
      "data": {
        "type": "object",
        "properties": {
          "number": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "enum": [
              "stop_promotions",
              "whatsapp_stop",
              "keyword"
            ]
          },
          "detail": {
            "type": "string"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "number",
          "source"
        ]
      },
      "samples": {
        "stop_promotions": {
          "id": "evt_Xq3k9m2Lw8Rt5Yp1Zs01",
          "type": "contact.opted_out",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "number": "61412345678",
            "name": "Sample Contact",
            "source": "stop_promotions",
            "detail": "Stop promotions",
            "timestamp": "2026-11-06T01:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "broadcast.completed",
      "group": "Broadcasts",
      "when": "A broadcast finished sending, was cancelled, or its scheduled time was missed.",
      "data": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "completed",
              "cancelled",
              "missed"
            ]
          },
          "sent_by": {
            "type": "string"
          },
          "numbers": {
            "type": "integer"
          },
          "posted": {
            "type": "integer"
          },
          "accepted": {
            "type": "integer"
          },
          "errors": {
            "type": "integer"
          },
          "skipped_do_not_call": {
            "type": "integer"
          },
          "skipped_monthly_limit": {
            "type": "integer"
          },
          "status_url": {
            "type": "string"
          },
          "report_url": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "status"
        ]
      },
      "samples": {
        "completed": {
          "id": "evt_Xq3k9m2Lw8Rt5Yp1Zs01",
          "type": "broadcast.completed",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "code": "k3XbQ9rTzP2mWv7a1c9e",
            "name": "October newsletter",
            "status": "completed",
            "sent_by": "dashboard",
            "numbers": 3,
            "posted": 3,
            "accepted": 3,
            "errors": 0,
            "skipped_do_not_call": 0,
            "skipped_monthly_limit": 0,
            "status_url": "https://api.app2email.com/v1/4976659348270/broadcasts/k3XbQ9rTzP2mWv7a1c9e",
            "report_url": "https://www.app2email.com/dashboard/log/broadcast/k3XbQ9rTzP2mWv7a1c9e"
          }
        }
      }
    },
    {
      "type": "usage.threshold",
      "group": "Account",
      "when": "80% or 100% of the billing month's messages are used (once each per month).",
      "data": {
        "type": "object",
        "properties": {
          "threshold_percent": {
            "type": "integer",
            "enum": [
              80,
              100
            ]
          },
          "whatsapp_messages": {
            "type": "object",
            "properties": {
              "used": {
                "type": "integer"
              },
              "limit": {
                "type": "integer"
              },
              "left": {
                "type": "integer"
              }
            }
          },
          "plan_messages": {
            "type": "object",
            "properties": {
              "whatsapp_sent": {
                "type": "integer"
              },
              "emails_sent": {
                "type": "integer"
              },
              "total_sent": {
                "type": "integer"
              },
              "limit": {
                "type": "integer"
              },
              "left": {
                "type": "integer"
              }
            }
          },
          "plan": {
            "type": "string"
          },
          "billing_period": {
            "type": "object",
            "properties": {
              "start": {
                "type": "string",
                "format": "date-time"
              },
              "end": {
                "type": "string",
                "format": "date-time"
              }
            }
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "threshold_percent"
        ]
      },
      "samples": {
        "80": {
          "id": "evt_Xq3k9m2Lw8Rt5Yp1Zs01",
          "type": "usage.threshold",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "threshold_percent": 80,
            "whatsapp_messages": {
              "used": 750,
              "limit": 1000,
              "left": 200
            },
            "plan_messages": {
              "whatsapp_sent": 750,
              "emails_sent": 50,
              "total_sent": 800,
              "limit": 1000,
              "left": 200
            },
            "plan": "standard_1000",
            "billing_period": {
              "start": "2026-11-01T00:00:00.000Z",
              "end": "2026-12-01T00:00:00.000Z"
            },
            "timestamp": "2026-11-06T01:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "template.status_changed",
      "group": "Templates",
      "when": "WhatsApp approved, rejected, paused or disabled a template, changed its quality or category, or it was edited (change components). WABA-wide: every number gets it.",
      "data": {
        "type": "object",
        "properties": {
          "template": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "language": {
                "type": "string"
              },
              "id": {
                "type": "string"
              }
            }
          },
          "status": {
            "type": "string"
          },
          "change": {
            "type": "string",
            "description": "The Meta webhook field for changes other than a status; components: the template was edited (status COMPONENTS_UPDATED)."
          },
          "previous_value": {
            "type": "string"
          },
          "new_value": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "can_send": {
            "type": "boolean"
          },
          "components": {
            "type": "object",
            "properties": {
              "header": {
                "type": "string"
              },
              "body": {
                "type": "string"
              },
              "footer": {
                "type": "string"
              },
              "buttons": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "text": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "phone_number": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "template",
          "status"
        ]
      },
      "samples": {
        "approved": {
          "id": "evt_Xq3k9m2Lw8Rt5Yp1Zs01",
          "type": "template.status_changed",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "template": {
              "name": "order_update",
              "language": "en",
              "id": "1234567890123456"
            },
            "status": "APPROVED",
            "can_send": true,
            "timestamp": "2026-11-06T01:00:00.000Z"
          }
        },
        "components": {
          "id": "evt_Xq3k9m2Lw8Rt5Yp1Zs02",
          "type": "template.status_changed",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "template": {
              "name": "order_update",
              "language": "en",
              "id": "1234567890123456"
            },
            "status": "COMPONENTS_UPDATED",
            "change": "components",
            "components": {
              "header": "Your order",
              "body": "Hi {{1}}, your order {{2}} is on its way.",
              "buttons": [
                {
                  "type": "URL",
                  "text": "Track",
                  "url": "https://www.example.com/track"
                }
              ]
            },
            "timestamp": "2026-11-06T01:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "conversation.owner_changed",
      "group": "Conversations",
      "when": "Who handles a contact changed: human, agent, paused or back to normal; or WhatsApp's AI agent took or passed on the conversation (owner whatsapp_ai).",
      "data": {
        "type": "object",
        "properties": {
          "contact": {
            "type": "string"
          },
          "owner": {
            "type": "string",
            "description": "agent, human, paused, whatsapp_ai (WhatsApp's AI agent holds it), or empty (normal handling)."
          },
          "previous_owner": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "until": {
            "type": "string",
            "format": "date-time"
          },
          "set_by": {
            "type": "string",
            "description": "api, dashboard, agent ..., or whatsapp (a handover of WhatsApp's AI agent)."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "handover": {
            "type": "string",
            "enum": [
              "control_passed",
              "control_taken"
            ],
            "description": "Only for set_by whatsapp."
          },
          "whatsapp_roles": {
            "type": "object",
            "properties": {
              "previous": {
                "type": "string"
              },
              "new": {
                "type": "string"
              }
            },
            "description": "Meta's owner roles, eg ai_agent, escalation."
          }
        },
        "required": [
          "contact",
          "owner"
        ]
      },
      "samples": {
        "human": {
          "id": "evt_Xq3k9m2Lw8Rt5Yp1Zs01",
          "type": "conversation.owner_changed",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "contact": "61412345678",
            "owner": "human",
            "previous_owner": "agent",
            "reason": "The customer asked for a person",
            "summary": "Asked about a late delivery",
            "set_by": "dashboard",
            "timestamp": "2026-11-06T01:00:00.000Z"
          }
        },
        "whatsapp_ai": {
          "id": "evt_Pa3k9m2Lw8Rt5Yp1Zs015",
          "type": "conversation.owner_changed",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "contact": "61412345678",
            "owner": "",
            "previous_owner": "whatsapp_ai",
            "reason": "asked for a person",
            "summary": "Asked about a late delivery of order 1234.",
            "set_by": "whatsapp",
            "handover": "control_passed",
            "whatsapp_roles": {
              "previous": "ai_agent",
              "new": "escalation"
            },
            "timestamp": "2026-11-06T01:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "message.held_for_approval",
      "group": "Approvals",
      "when": "A send was held by the key's approval gate.",
      "data": {
        "type": "object",
        "properties": {
          "approval_id": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "approve_url": {
            "type": "string"
          },
          "recipients": {
            "type": "integer"
          },
          "key": {
            "type": "string"
          },
          "summary": {
            "type": "object",
            "additionalProperties": true
          },
          "expires": {
            "type": "string",
            "format": "date-time"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "approval_id"
        ]
      },
      "samples": {
        "held": {
          "id": "evt_Xq3k9m2Lw8Rt5Yp1Zs01",
          "type": "message.held_for_approval",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "approval_id": "apr_a1b2c3d4e5f6g7h8",
            "url": "https://www.app2email.com/dashboard/approvals?id=apr_a1b2c3d4e5f6g7h8",
            "approve_url": "https://api.app2email.com/v1/4976659348270/approvals/apr_a1b2c3d4e5f6g7h8/approve",
            "recipients": 250,
            "key": "Agent key",
            "summary": {
              "type": "template",
              "template": "order_update",
              "to": 250
            },
            "expires": "2026-11-07T01:00:00.000Z",
            "timestamp": "2026-11-06T01:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "approval.resolved",
      "group": "Approvals",
      "when": "A held send was approved (and sent), rejected, or expired.",
      "data": {
        "type": "object",
        "properties": {
          "approval_id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "approved",
              "rejected",
              "expired"
            ]
          },
          "resolved_by": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "properties": {
              "http_status": {
                "type": "integer"
              },
              "status": {
                "type": "string"
              },
              "accepted": {
                "type": "integer"
              },
              "failed": {
                "type": "integer"
              },
              "broadcast_code": {
                "type": "string"
              }
            }
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "approval_id",
          "status"
        ]
      },
      "samples": {
        "approved": {
          "id": "evt_Xq3k9m2Lw8Rt5Yp1Zs01",
          "type": "approval.resolved",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "approval_id": "apr_a1b2c3d4e5f6g7h8",
            "status": "approved",
            "resolved_by": "dashboard",
            "result": {
              "http_status": 202,
              "status": "accepted",
              "accepted": 250,
              "failed": 0,
              "broadcast_code": "k3XbQ9rTzP2mWv7a1c9e"
            },
            "timestamp": "2026-11-06T01:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "contact.updated",
      "group": "Contacts",
      "when": "A contact was made or changed through the API (upsert, patch, consent; not imports), or turned marketing messages back on in WhatsApp.",
      "data": {
        "type": "object",
        "properties": {
          "contact": {
            "$ref": "#/components/schemas/Contact"
          },
          "change": {
            "type": "string",
            "enum": [
              "upsert",
              "patch",
              "consent",
              "marketing_resumed"
            ]
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "detail": {
            "type": "string"
          }
        },
        "required": [
          "contact",
          "change"
        ]
      },
      "samples": {
        "upsert": {
          "id": "evt_Xq3k9m2Lw8Rt5Yp1Zs01",
          "type": "contact.updated",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "contact": {
              "identity": "61412345678",
              "identity_type": "phone",
              "phone": "61412345678",
              "name": "Sample Contact",
              "tags": [
                "vip"
              ],
              "custom_fields": {
                "city": "Sydney"
              },
              "source": "api",
              "consent": {
                "marketing": true,
                "at": "2026-11-06T01:00:00.000Z",
                "source": "website form",
                "recorded": true
              },
              "created": "2026-11-06T01:00:00.000Z",
              "updated": "2026-11-06T01:00:00.000Z"
            },
            "change": "upsert",
            "timestamp": "2026-11-06T01:00:00.000Z"
          }
        },
        "marketing_resumed": {
          "id": "evt_Pa3k9m2Lw8Rt5Yp1Zs016",
          "type": "contact.updated",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "contact": {
              "identity": "61412345678",
              "identity_type": "phone",
              "phone": "61412345678"
            },
            "change": "marketing_resumed",
            "detail": "User resumed marketing messages",
            "timestamp": "2026-11-06T01:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "booking.created",
      "group": "Bookings",
      "when": "An appointment was booked: by the customer in the WhatsApp Flow, on the dashboard, or through the API.",
      "data": {
        "type": "object",
        "required": [
          "id",
          "reference",
          "status",
          "contact",
          "start"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "example": 42
          },
          "reference": {
            "type": "string",
            "example": "BK-7Q3M2A",
            "description": "The short code the customer sees. GET /bookings/{id} takes it too."
          },
          "status": {
            "type": "string",
            "enum": [
              "confirmed",
              "cancelled",
              "completed",
              "no_show"
            ]
          },
          "contact": {
            "type": "string",
            "example": "61412345678",
            "description": "The customer's number (digits, country code first) or their business-scoped user id."
          },
          "contact_name": {
            "type": "string",
            "example": "John Smith"
          },
          "contact_email": {
            "type": "string",
            "example": "john@example.com"
          },
          "service": {
            "$ref": "#/components/schemas/BookingService"
          },
          "start": {
            "type": "string",
            "format": "date-time",
            "description": "UTC."
          },
          "end": {
            "type": "string",
            "format": "date-time",
            "description": "UTC."
          },
          "timezone": {
            "type": "string",
            "example": "Australia/Sydney",
            "description": "The business time zone the slot was chosen in."
          },
          "source": {
            "type": "string",
            "enum": [
              "whatsapp_flow",
              "dashboard",
              "api",
              "web"
            ],
            "description": "Booked by the customer in WhatsApp, on the dashboard (or in the calendar app), through this API, or by the customer on the online booking page (web)."
          },
          "calendar": {
            "type": "object",
            "properties": {
              "provider": {
                "type": "string",
                "enum": [
                  "builtin",
                  "google",
                  "microsoft",
                  "caldav",
                  "ics"
                ]
              },
              "event_id": {
                "type": "string"
              },
              "url": {
                "type": "string"
              },
              "error": {
                "type": "string",
                "description": "The calendar write failed; the booking still stands."
              }
            }
          },
          "answers": {
            "type": "object",
            "additionalProperties": true,
            "description": "Every other field the customer filled in the Flow."
          },
          "notes": {
            "type": "string"
          },
          "provider": {
            "type": "object",
            "description": "The staff member, when the business has them. Left out otherwise.",
            "properties": {
              "id": {
                "type": "string",
                "example": "maria"
              },
              "name": {
                "type": "string",
                "example": "Maria"
              }
            }
          },
          "rating": {
            "type": "integer",
            "enum": [
              1,
              3,
              5
            ],
            "description": "The customer's rating from the follow-up message (5 loved it, 3 OK, 1 not great). Left out until given."
          },
          "payment_status": {
            "type": "string",
            "enum": [
              "link_sent",
              "paid",
              "waived"
            ],
            "description": "The business's own note on the payment. Left out when none."
          },
          "credits_used": {
            "type": "integer",
            "description": "Always 0 (memberships were removed on 2026-11-10); kept so existing integrations keep parsing."
          },
          "attendance_confirmed": {
            "type": "string",
            "format": "date-time",
            "description": "When the customer tapped Confirm on a reminder."
          },
          "cancelled": {
            "type": "object",
            "description": "Only when cancelled.",
            "properties": {
              "at": {
                "type": "string",
                "format": "date-time"
              },
              "by": {
                "type": "string",
                "enum": [
                  "customer",
                  "business",
                  "api",
                  "system"
                ]
              },
              "reason": {
                "type": "string"
              }
            }
          },
          "rescheduled_from_id": {
            "type": "integer",
            "description": "The appointment this one replaced."
          },
          "link_id": {
            "type": "integer",
            "nullable": true,
            "description": "The online booking link (/book/...) it was made through, for correlation. null: none."
          },
          "notes_count": {
            "type": "integer",
            "description": "How many internal notes are written on this appointment (GET /bookings/{id}/notes). Given by the calendar routes and the list; left out of webhook events."
          },
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "hold": {
            "type": "boolean",
            "description": "true when it was made from a held time (POST /bookings with hold, or the online booking page). Left out otherwise."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "The Booking object (GET /bookings/{id}) plus timestamp."
      },
      "samples": {
        "whatsapp_flow": {
          "id": "evt_Bk3k9m2Lw8Rt5Yp1Zs01",
          "type": "booking.created",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "id": 42,
            "reference": "BK-7Q3M2A",
            "status": "confirmed",
            "contact": "61412345678",
            "contact_name": "Sample Contact",
            "contact_email": "sample@example.com",
            "service": {
              "id": "haircut",
              "name": "Haircut",
              "duration_min": 30
            },
            "start": "2026-11-09T23:00:00.000Z",
            "end": "2026-11-09T23:30:00.000Z",
            "timezone": "Australia/Sydney",
            "source": "whatsapp_flow",
            "calendar": {
              "provider": "google",
              "event_id": "evt_sample_1",
              "url": "https://calendar.google.com/calendar/event?eid=sample"
            },
            "answers": {
              "notes": "Please keep it short"
            },
            "notes": "Please keep it short",
            "provider": {
              "id": "maria",
              "name": "Maria"
            },
            "credits_used": 0,
            "created": "2026-11-06T01:00:00.000Z",
            "timestamp": "2026-11-06T01:00:00.000Z"
          }
        },
        "online_page": {
          "id": "evt_Bk3k9m2Lw8Rt5Yp1Zs06",
          "type": "booking.created",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "id": 42,
            "reference": "BK-7Q3M2A",
            "status": "confirmed",
            "contact": "61412345678",
            "contact_name": "Sample Contact",
            "contact_email": "sample@example.com",
            "service": {
              "id": "haircut",
              "name": "Haircut",
              "duration_min": 30
            },
            "start": "2026-11-09T23:00:00.000Z",
            "end": "2026-11-09T23:30:00.000Z",
            "timezone": "Australia/Sydney",
            "source": "web",
            "calendar": {
              "provider": "google",
              "event_id": "evt_sample_1",
              "url": "https://calendar.google.com/calendar/event?eid=sample"
            },
            "answers": {
              "notes": "Please keep it short"
            },
            "notes": "Please keep it short",
            "provider": {
              "id": "maria",
              "name": "Maria"
            },
            "credits_used": 0,
            "created": "2026-11-06T01:00:00.000Z",
            "timestamp": "2026-11-06T01:00:00.000Z",
            "link_id": 21,
            "hold": true
          }
        }
      }
    },
    {
      "type": "booking.cancelled",
      "group": "Bookings",
      "when": "An appointment was cancelled: by the customer (CANCEL on WhatsApp), the business, the API or app2email.",
      "data": {
        "type": "object",
        "required": [
          "id",
          "reference",
          "status",
          "contact",
          "start"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "example": 42
          },
          "reference": {
            "type": "string",
            "example": "BK-7Q3M2A",
            "description": "The short code the customer sees. GET /bookings/{id} takes it too."
          },
          "status": {
            "type": "string",
            "enum": [
              "confirmed",
              "cancelled",
              "completed",
              "no_show"
            ]
          },
          "contact": {
            "type": "string",
            "example": "61412345678",
            "description": "The customer's number (digits, country code first) or their business-scoped user id."
          },
          "contact_name": {
            "type": "string",
            "example": "John Smith"
          },
          "contact_email": {
            "type": "string",
            "example": "john@example.com"
          },
          "service": {
            "$ref": "#/components/schemas/BookingService"
          },
          "start": {
            "type": "string",
            "format": "date-time",
            "description": "UTC."
          },
          "end": {
            "type": "string",
            "format": "date-time",
            "description": "UTC."
          },
          "timezone": {
            "type": "string",
            "example": "Australia/Sydney",
            "description": "The business time zone the slot was chosen in."
          },
          "source": {
            "type": "string",
            "enum": [
              "whatsapp_flow",
              "dashboard",
              "api",
              "web"
            ],
            "description": "Booked by the customer in WhatsApp, on the dashboard (or in the calendar app), through this API, or by the customer on the online booking page (web)."
          },
          "calendar": {
            "type": "object",
            "properties": {
              "provider": {
                "type": "string",
                "enum": [
                  "builtin",
                  "google",
                  "microsoft",
                  "caldav",
                  "ics"
                ]
              },
              "event_id": {
                "type": "string"
              },
              "url": {
                "type": "string"
              },
              "error": {
                "type": "string",
                "description": "The calendar write failed; the booking still stands."
              }
            }
          },
          "answers": {
            "type": "object",
            "additionalProperties": true,
            "description": "Every other field the customer filled in the Flow."
          },
          "notes": {
            "type": "string"
          },
          "provider": {
            "type": "object",
            "description": "The staff member, when the business has them. Left out otherwise.",
            "properties": {
              "id": {
                "type": "string",
                "example": "maria"
              },
              "name": {
                "type": "string",
                "example": "Maria"
              }
            }
          },
          "rating": {
            "type": "integer",
            "enum": [
              1,
              3,
              5
            ],
            "description": "The customer's rating from the follow-up message (5 loved it, 3 OK, 1 not great). Left out until given."
          },
          "payment_status": {
            "type": "string",
            "enum": [
              "link_sent",
              "paid",
              "waived"
            ],
            "description": "The business's own note on the payment. Left out when none."
          },
          "credits_used": {
            "type": "integer",
            "description": "Always 0 (memberships were removed on 2026-11-10); kept so existing integrations keep parsing."
          },
          "attendance_confirmed": {
            "type": "string",
            "format": "date-time",
            "description": "When the customer tapped Confirm on a reminder."
          },
          "cancelled": {
            "type": "object",
            "description": "Only when cancelled.",
            "properties": {
              "at": {
                "type": "string",
                "format": "date-time"
              },
              "by": {
                "type": "string",
                "enum": [
                  "customer",
                  "business",
                  "api",
                  "system"
                ]
              },
              "reason": {
                "type": "string"
              }
            }
          },
          "rescheduled_from_id": {
            "type": "integer",
            "description": "The appointment this one replaced."
          },
          "link_id": {
            "type": "integer",
            "nullable": true,
            "description": "The online booking link (/book/...) it was made through, for correlation. null: none."
          },
          "notes_count": {
            "type": "integer",
            "description": "How many internal notes are written on this appointment (GET /bookings/{id}/notes). Given by the calendar routes and the list; left out of webhook events."
          },
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "The Booking object (GET /bookings/{id}) plus timestamp."
      },
      "samples": {
        "customer": {
          "id": "evt_Bk3k9m2Lw8Rt5Yp1Zs02",
          "type": "booking.cancelled",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "id": 42,
            "reference": "BK-7Q3M2A",
            "status": "cancelled",
            "contact": "61412345678",
            "contact_name": "Sample Contact",
            "contact_email": "sample@example.com",
            "service": {
              "id": "haircut",
              "name": "Haircut",
              "duration_min": 30
            },
            "start": "2026-11-09T23:00:00.000Z",
            "end": "2026-11-09T23:30:00.000Z",
            "timezone": "Australia/Sydney",
            "source": "whatsapp_flow",
            "calendar": {
              "provider": "google",
              "event_id": "evt_sample_1",
              "url": "https://calendar.google.com/calendar/event?eid=sample"
            },
            "answers": {
              "notes": "Please keep it short"
            },
            "notes": "Please keep it short",
            "provider": {
              "id": "maria",
              "name": "Maria"
            },
            "credits_used": 0,
            "created": "2026-11-06T01:00:00.000Z",
            "timestamp": "2026-11-06T01:00:00.000Z",
            "cancelled": {
              "at": "2026-11-06T01:00:00.000Z",
              "by": "customer",
              "reason": "cancelled on WhatsApp"
            }
          }
        }
      }
    },
    {
      "type": "booking.rescheduled",
      "group": "Bookings",
      "when": "An appointment was moved to another time (the old one is in rescheduled_from).",
      "data": {
        "type": "object",
        "required": [
          "id",
          "reference",
          "status",
          "contact",
          "start"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "example": 42
          },
          "reference": {
            "type": "string",
            "example": "BK-7Q3M2A",
            "description": "The short code the customer sees. GET /bookings/{id} takes it too."
          },
          "status": {
            "type": "string",
            "enum": [
              "confirmed",
              "cancelled",
              "completed",
              "no_show"
            ]
          },
          "contact": {
            "type": "string",
            "example": "61412345678",
            "description": "The customer's number (digits, country code first) or their business-scoped user id."
          },
          "contact_name": {
            "type": "string",
            "example": "John Smith"
          },
          "contact_email": {
            "type": "string",
            "example": "john@example.com"
          },
          "service": {
            "$ref": "#/components/schemas/BookingService"
          },
          "start": {
            "type": "string",
            "format": "date-time",
            "description": "UTC."
          },
          "end": {
            "type": "string",
            "format": "date-time",
            "description": "UTC."
          },
          "timezone": {
            "type": "string",
            "example": "Australia/Sydney",
            "description": "The business time zone the slot was chosen in."
          },
          "source": {
            "type": "string",
            "enum": [
              "whatsapp_flow",
              "dashboard",
              "api",
              "web"
            ],
            "description": "Booked by the customer in WhatsApp, on the dashboard (or in the calendar app), through this API, or by the customer on the online booking page (web)."
          },
          "calendar": {
            "type": "object",
            "properties": {
              "provider": {
                "type": "string",
                "enum": [
                  "builtin",
                  "google",
                  "microsoft",
                  "caldav",
                  "ics"
                ]
              },
              "event_id": {
                "type": "string"
              },
              "url": {
                "type": "string"
              },
              "error": {
                "type": "string",
                "description": "The calendar write failed; the booking still stands."
              }
            }
          },
          "answers": {
            "type": "object",
            "additionalProperties": true,
            "description": "Every other field the customer filled in the Flow."
          },
          "notes": {
            "type": "string"
          },
          "provider": {
            "type": "object",
            "description": "The staff member, when the business has them. Left out otherwise.",
            "properties": {
              "id": {
                "type": "string",
                "example": "maria"
              },
              "name": {
                "type": "string",
                "example": "Maria"
              }
            }
          },
          "rating": {
            "type": "integer",
            "enum": [
              1,
              3,
              5
            ],
            "description": "The customer's rating from the follow-up message (5 loved it, 3 OK, 1 not great). Left out until given."
          },
          "payment_status": {
            "type": "string",
            "enum": [
              "link_sent",
              "paid",
              "waived"
            ],
            "description": "The business's own note on the payment. Left out when none."
          },
          "credits_used": {
            "type": "integer",
            "description": "Always 0 (memberships were removed on 2026-11-10); kept so existing integrations keep parsing."
          },
          "attendance_confirmed": {
            "type": "string",
            "format": "date-time",
            "description": "When the customer tapped Confirm on a reminder."
          },
          "cancelled": {
            "type": "object",
            "description": "Only when cancelled.",
            "properties": {
              "at": {
                "type": "string",
                "format": "date-time"
              },
              "by": {
                "type": "string",
                "enum": [
                  "customer",
                  "business",
                  "api",
                  "system"
                ]
              },
              "reason": {
                "type": "string"
              }
            }
          },
          "rescheduled_from_id": {
            "type": "integer",
            "description": "The appointment this one replaced."
          },
          "link_id": {
            "type": "integer",
            "nullable": true,
            "description": "The online booking link (/book/...) it was made through, for correlation. null: none."
          },
          "notes_count": {
            "type": "integer",
            "description": "How many internal notes are written on this appointment (GET /bookings/{id}/notes). Given by the calendar routes and the list; left out of webhook events."
          },
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "rescheduled_from": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer"
              },
              "reference": {
                "type": "string"
              },
              "start": {
                "type": "string",
                "format": "date-time"
              },
              "end": {
                "type": "string",
                "format": "date-time"
              }
            },
            "description": "The appointment this one replaced."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "The Booking object (GET /bookings/{id}) plus timestamp."
      },
      "samples": {
        "moved": {
          "id": "evt_Bk3k9m2Lw8Rt5Yp1Zs03",
          "type": "booking.rescheduled",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "id": 42,
            "reference": "BK-7Q3M2A",
            "status": "confirmed",
            "contact": "61412345678",
            "contact_name": "Sample Contact",
            "contact_email": "sample@example.com",
            "service": {
              "id": "haircut",
              "name": "Haircut",
              "duration_min": 30
            },
            "start": "2026-11-09T23:00:00.000Z",
            "end": "2026-11-09T23:30:00.000Z",
            "timezone": "Australia/Sydney",
            "source": "whatsapp_flow",
            "calendar": {
              "provider": "google",
              "event_id": "evt_sample_1",
              "url": "https://calendar.google.com/calendar/event?eid=sample"
            },
            "answers": {
              "notes": "Please keep it short"
            },
            "notes": "Please keep it short",
            "provider": {
              "id": "maria",
              "name": "Maria"
            },
            "credits_used": 0,
            "created": "2026-11-06T01:00:00.000Z",
            "timestamp": "2026-11-06T01:00:00.000Z",
            "rescheduled_from_id": 41,
            "rescheduled_from": {
              "id": 41,
              "reference": "BK-2KD8XQ",
              "start": "2026-11-08T23:00:00.000Z",
              "end": "2026-11-08T23:30:00.000Z"
            }
          }
        }
      }
    },
    {
      "type": "booking.rated",
      "group": "Bookings",
      "when": "The customer rated a completed appointment (the follow-up message's buttons).",
      "data": {
        "type": "object",
        "required": [
          "id",
          "reference",
          "status",
          "contact",
          "start"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "example": 42
          },
          "reference": {
            "type": "string",
            "example": "BK-7Q3M2A",
            "description": "The short code the customer sees. GET /bookings/{id} takes it too."
          },
          "status": {
            "type": "string",
            "enum": [
              "confirmed",
              "cancelled",
              "completed",
              "no_show"
            ]
          },
          "contact": {
            "type": "string",
            "example": "61412345678",
            "description": "The customer's number (digits, country code first) or their business-scoped user id."
          },
          "contact_name": {
            "type": "string",
            "example": "John Smith"
          },
          "contact_email": {
            "type": "string",
            "example": "john@example.com"
          },
          "service": {
            "$ref": "#/components/schemas/BookingService"
          },
          "start": {
            "type": "string",
            "format": "date-time",
            "description": "UTC."
          },
          "end": {
            "type": "string",
            "format": "date-time",
            "description": "UTC."
          },
          "timezone": {
            "type": "string",
            "example": "Australia/Sydney",
            "description": "The business time zone the slot was chosen in."
          },
          "source": {
            "type": "string",
            "enum": [
              "whatsapp_flow",
              "dashboard",
              "api",
              "web"
            ],
            "description": "Booked by the customer in WhatsApp, on the dashboard (or in the calendar app), through this API, or by the customer on the online booking page (web)."
          },
          "calendar": {
            "type": "object",
            "properties": {
              "provider": {
                "type": "string",
                "enum": [
                  "builtin",
                  "google",
                  "microsoft",
                  "caldav",
                  "ics"
                ]
              },
              "event_id": {
                "type": "string"
              },
              "url": {
                "type": "string"
              },
              "error": {
                "type": "string",
                "description": "The calendar write failed; the booking still stands."
              }
            }
          },
          "answers": {
            "type": "object",
            "additionalProperties": true,
            "description": "Every other field the customer filled in the Flow."
          },
          "notes": {
            "type": "string"
          },
          "provider": {
            "type": "object",
            "description": "The staff member, when the business has them. Left out otherwise.",
            "properties": {
              "id": {
                "type": "string",
                "example": "maria"
              },
              "name": {
                "type": "string",
                "example": "Maria"
              }
            }
          },
          "rating": {
            "type": "integer",
            "enum": [
              1,
              3,
              5
            ],
            "description": "The customer's rating from the follow-up message (5 loved it, 3 OK, 1 not great). Left out until given."
          },
          "payment_status": {
            "type": "string",
            "enum": [
              "link_sent",
              "paid",
              "waived"
            ],
            "description": "The business's own note on the payment. Left out when none."
          },
          "credits_used": {
            "type": "integer",
            "description": "Always 0 (memberships were removed on 2026-11-10); kept so existing integrations keep parsing."
          },
          "attendance_confirmed": {
            "type": "string",
            "format": "date-time",
            "description": "When the customer tapped Confirm on a reminder."
          },
          "cancelled": {
            "type": "object",
            "description": "Only when cancelled.",
            "properties": {
              "at": {
                "type": "string",
                "format": "date-time"
              },
              "by": {
                "type": "string",
                "enum": [
                  "customer",
                  "business",
                  "api",
                  "system"
                ]
              },
              "reason": {
                "type": "string"
              }
            }
          },
          "rescheduled_from_id": {
            "type": "integer",
            "description": "The appointment this one replaced."
          },
          "link_id": {
            "type": "integer",
            "nullable": true,
            "description": "The online booking link (/book/...) it was made through, for correlation. null: none."
          },
          "notes_count": {
            "type": "integer",
            "description": "How many internal notes are written on this appointment (GET /bookings/{id}/notes). Given by the calendar routes and the list; left out of webhook events."
          },
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "rated_at": {
            "type": "string",
            "format": "date-time"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "The Booking object (GET /bookings/{id}) plus timestamp."
      },
      "samples": {
        "loved_it": {
          "id": "evt_Bk3k9m2Lw8Rt5Yp1Zs04",
          "type": "booking.rated",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "id": 42,
            "reference": "BK-7Q3M2A",
            "status": "completed",
            "contact": "61412345678",
            "contact_name": "Sample Contact",
            "contact_email": "sample@example.com",
            "service": {
              "id": "haircut",
              "name": "Haircut",
              "duration_min": 30
            },
            "start": "2026-11-09T23:00:00.000Z",
            "end": "2026-11-09T23:30:00.000Z",
            "timezone": "Australia/Sydney",
            "source": "whatsapp_flow",
            "calendar": {
              "provider": "google",
              "event_id": "evt_sample_1",
              "url": "https://calendar.google.com/calendar/event?eid=sample"
            },
            "answers": {
              "notes": "Please keep it short"
            },
            "notes": "Please keep it short",
            "provider": {
              "id": "maria",
              "name": "Maria"
            },
            "credits_used": 0,
            "created": "2026-11-06T01:00:00.000Z",
            "timestamp": "2026-11-06T01:00:00.000Z",
            "rating": 5,
            "rated_at": "2026-11-06T01:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "flow.completed",
      "group": "Bookings",
      "when": "A contact finished a form Flow of the Bookings section (kind form); a booking Flow sends booking.created instead.",
      "data": {
        "type": "object",
        "required": [
          "flow_key",
          "contact",
          "answers"
        ],
        "properties": {
          "flow_key": {
            "type": "string"
          },
          "flow_name": {
            "type": "string"
          },
          "contact": {
            "type": "string"
          },
          "contact_name": {
            "type": "string",
            "description": "The name the contact gave, when a field was called name."
          },
          "session_id": {
            "type": "integer"
          },
          "answers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "field -> the contact's answer."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "samples": {
        "enquiry": {
          "id": "evt_Bk3k9m2Lw8Rt5Yp1Zs05",
          "type": "flow.completed",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "flow_key": "enquiry",
            "flow_name": "Consultation request",
            "contact": "61412345678",
            "contact_name": "Sample Contact",
            "session_id": 1234,
            "answers": {
              "purpose": "question",
              "contact_email": "sample@example.com",
              "message": "Do you do colour corrections?"
            },
            "timestamp": "2026-11-06T01:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "booking.updated",
      "group": "Bookings",
      "when": "An appointment's details changed: the customer's name or e-mail, the notes, the answers or the staff member (in the calendar app, on the dashboard or through the API). Not sent for a move (booking.rescheduled) or a cancel.",
      "data": {
        "type": "object",
        "required": [
          "id",
          "reference",
          "changed"
        ],
        "properties": {
          "changed": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The fields that changed: name, email, notes, answers, provider."
          },
          "updated_by": {
            "type": "string",
            "description": "An e-mail or API key <name>."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "The Booking object (GET /bookings/{id}) plus changed, updated_by and timestamp."
      },
      "samples": {
        "notes_and_staff": {
          "id": "evt_Cal3k9m2Lw8Rt5Yp1Zs01",
          "type": "booking.updated",
          "created": "2026-11-11T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "id": 42,
            "reference": "BK-7Q3M2A",
            "status": "confirmed",
            "contact": "61412345678",
            "contact_name": "Sample Contact",
            "contact_email": "sample@example.com",
            "service": {
              "id": "haircut",
              "name": "Haircut",
              "duration_min": 30
            },
            "start": "2026-11-14T23:00:00.000Z",
            "end": "2026-11-14T23:30:00.000Z",
            "timezone": "Australia/Sydney",
            "source": "whatsapp_flow",
            "calendar": {
              "provider": "google",
              "event_id": "evt_sample_1",
              "url": "https://calendar.google.com/calendar/event?eid=sample"
            },
            "answers": {
              "notes": "Please keep it short"
            },
            "notes": "Please keep it short",
            "provider": {
              "id": "maria",
              "name": "Maria"
            },
            "credits_used": 0,
            "link_id": null,
            "created": "2026-11-11T01:00:00.000Z",
            "changed": [
              "notes",
              "provider"
            ],
            "updated_by": "jane@example.com",
            "timestamp": "2026-11-11T01:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "booking.note.created",
      "group": "Bookings",
      "when": "An internal note was added to a customer or an appointment (in the calendar app or through the API).",
      "data": {
        "type": "object",
        "required": [
          "id",
          "contact",
          "body"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "example": 7
          },
          "contact": {
            "type": "string",
            "example": "61412345678",
            "description": "The customer."
          },
          "appointment_id": {
            "type": "integer",
            "nullable": true,
            "description": "The appointment it was written on. null: a note on the customer alone."
          },
          "booking_reference": {
            "type": "string",
            "nullable": true,
            "example": "BK-7Q3M2A"
          },
          "body": {
            "type": "string",
            "description": "Up to 4000 characters."
          },
          "author": {
            "type": "string",
            "example": "API key Planner",
            "description": "A person's name or e-mail, or API key <name>."
          },
          "author_kind": {
            "type": "string",
            "enum": [
              "user",
              "api",
              "agent",
              "system"
            ]
          },
          "pinned": {
            "type": "boolean"
          },
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "updated": {
            "type": "string",
            "format": "date-time"
          },
          "on_this_booking": {
            "type": "boolean",
            "description": "Only in GET /bookings/{id}/notes: written on that appointment (false: another note of the same customer)."
          },
          "booking": {
            "type": "object",
            "nullable": true,
            "description": "The appointment the note is on. null: a note on the customer alone.",
            "properties": {
              "id": {
                "type": "integer"
              },
              "reference": {
                "type": "string"
              }
            }
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "The Note object plus booking and timestamp."
      },
      "samples": {
        "on_a_booking": {
          "id": "evt_Cal3k9m2Lw8Rt5Yp1Zs02",
          "type": "booking.note.created",
          "created": "2026-11-11T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "id": 7,
            "contact": "61412345678",
            "appointment_id": 42,
            "booking_reference": "BK-7Q3M2A",
            "body": "Prefers the window seat.",
            "author": "Jane Doe",
            "author_kind": "user",
            "pinned": false,
            "created": "2026-11-11T01:12:09.000Z",
            "updated": "2026-11-11T01:12:09.000Z",
            "booking": {
              "id": 42,
              "reference": "BK-7Q3M2A"
            },
            "timestamp": "2026-11-11T01:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "calendar.block.created",
      "group": "Bookings",
      "when": "Time was blocked in the calendar (in the calendar app or through the API).",
      "data": {
        "type": "object",
        "required": [
          "id",
          "start",
          "end"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "example": 3
          },
          "provider_id": {
            "type": "string",
            "example": "maria",
            "description": "The staff member it is for. Empty: the whole business."
          },
          "title": {
            "type": "string",
            "example": "Lunch",
            "description": "Up to 80 characters."
          },
          "notes": {
            "type": "string",
            "description": "Up to 500 characters."
          },
          "start": {
            "type": "string",
            "format": "date-time",
            "description": "UTC."
          },
          "end": {
            "type": "string",
            "format": "date-time",
            "description": "UTC."
          },
          "start_local": {
            "type": "string",
            "example": "2026-11-14T12:00",
            "description": "Local time in the business time zone, yyyy-MM-ddTHH:mm."
          },
          "end_local": {
            "type": "string",
            "example": "2026-11-14T13:00",
            "description": "Local time in the business time zone, yyyy-MM-ddTHH:mm."
          },
          "source": {
            "type": "string",
            "enum": [
              "calendar",
              "api"
            ],
            "description": "Made in the calendar app, or through this API."
          },
          "created_by": {
            "type": "string",
            "example": "API key Planner",
            "description": "The e-mail of the person, or API key <name>."
          },
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "updated": {
            "type": "string",
            "format": "date-time"
          },
          "by": {
            "type": "string",
            "description": "Who made / removed it: an e-mail or API key <name>."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "The Block object plus by and timestamp."
      },
      "samples": {
        "lunch": {
          "id": "evt_Cal3k9m2Lw8Rt5Yp1Zs03",
          "type": "calendar.block.created",
          "created": "2026-11-11T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "id": 3,
            "provider_id": "maria",
            "title": "Lunch",
            "notes": "",
            "start": "2026-11-14T01:00:00.000Z",
            "end": "2026-11-14T02:00:00.000Z",
            "start_local": "2026-11-14T12:00",
            "end_local": "2026-11-14T13:00",
            "source": "calendar",
            "created_by": "jane@example.com",
            "created": "2026-11-11T01:12:09.000Z",
            "updated": "2026-11-11T01:12:09.000Z",
            "by": "jane@example.com",
            "timestamp": "2026-11-11T01:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "calendar.block.deleted",
      "group": "Bookings",
      "when": "A time block was removed from the calendar.",
      "data": {
        "type": "object",
        "required": [
          "id",
          "start",
          "end"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "example": 3
          },
          "provider_id": {
            "type": "string",
            "example": "maria",
            "description": "The staff member it is for. Empty: the whole business."
          },
          "title": {
            "type": "string",
            "example": "Lunch",
            "description": "Up to 80 characters."
          },
          "notes": {
            "type": "string",
            "description": "Up to 500 characters."
          },
          "start": {
            "type": "string",
            "format": "date-time",
            "description": "UTC."
          },
          "end": {
            "type": "string",
            "format": "date-time",
            "description": "UTC."
          },
          "start_local": {
            "type": "string",
            "example": "2026-11-14T12:00",
            "description": "Local time in the business time zone, yyyy-MM-ddTHH:mm."
          },
          "end_local": {
            "type": "string",
            "example": "2026-11-14T13:00",
            "description": "Local time in the business time zone, yyyy-MM-ddTHH:mm."
          },
          "source": {
            "type": "string",
            "enum": [
              "calendar",
              "api"
            ],
            "description": "Made in the calendar app, or through this API."
          },
          "created_by": {
            "type": "string",
            "example": "API key Planner",
            "description": "The e-mail of the person, or API key <name>."
          },
          "created": {
            "type": "string",
            "format": "date-time"
          },
          "updated": {
            "type": "string",
            "format": "date-time"
          },
          "by": {
            "type": "string",
            "description": "Who made / removed it: an e-mail or API key <name>."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "The Block object (as it was) plus by and timestamp."
      },
      "samples": {
        "lunch": {
          "id": "evt_Cal3k9m2Lw8Rt5Yp1Zs04",
          "type": "calendar.block.deleted",
          "created": "2026-11-11T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "id": 3,
            "provider_id": "maria",
            "title": "Lunch",
            "notes": "",
            "start": "2026-11-14T01:00:00.000Z",
            "end": "2026-11-14T02:00:00.000Z",
            "start_local": "2026-11-14T12:00",
            "end_local": "2026-11-14T13:00",
            "source": "calendar",
            "created_by": "jane@example.com",
            "created": "2026-11-11T01:12:09.000Z",
            "updated": "2026-11-11T01:12:09.000Z",
            "by": "jane@example.com",
            "timestamp": "2026-11-11T01:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "call.incoming",
      "group": "Calling",
      "when": "A WhatsApp user calls the number (with their SDP offer). Answer with POST /calls within 30 to 60 s.",
      "data": {
        "type": "object",
        "properties": {
          "call_id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "call.status: ringing, accepted, rejected, connect, created, completed, failed, recording_available, transcription_available."
          },
          "direction": {
            "type": "string",
            "enum": [
              "user_initiated",
              "business_initiated"
            ],
            "description": "Meta's; without it, from the SDP type or the numbers."
          },
          "event": {
            "type": "string",
            "description": "Meta's event: connect, call_created, terminate ..."
          },
          "from": {
            "type": "string"
          },
          "from_user_id": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "to_user_id": {
            "type": "string"
          },
          "contact": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "wa_id": {
                "type": "string"
              },
              "user_id": {
                "type": "string"
              }
            }
          },
          "session": {
            "type": "object",
            "properties": {
              "sdp_type": {
                "type": "string",
                "enum": [
                  "offer",
                  "answer"
                ]
              },
              "sdp": {
                "type": "string",
                "description": "RFC 8866 SDP."
              }
            },
            "required": [
              "sdp_type",
              "sdp"
            ]
          },
          "start_time": {
            "type": "string",
            "format": "date-time"
          },
          "end_time": {
            "type": "string",
            "format": "date-time"
          },
          "duration_seconds": {
            "type": "integer"
          },
          "biz_opaque_callback_data": {
            "type": "string"
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "integer"
              },
              "message": {
                "type": "string"
              },
              "details": {
                "type": "string"
              }
            }
          },
          "recording": {
            "type": "object",
            "properties": {
              "media_id": {
                "type": "string"
              },
              "mime_type": {
                "type": "string"
              }
            }
          },
          "transcription": {
            "type": "object",
            "properties": {
              "media_id": {
                "type": "string"
              },
              "mime_type": {
                "type": "string"
              }
            }
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "whatsapp": {
            "type": "object",
            "properties": {},
            "description": "Meta's call or status object as received.",
            "additionalProperties": true
          }
        },
        "required": [
          "call_id"
        ]
      },
      "samples": {
        "incoming": {
          "id": "evt_Kc7m2Qw9Lp4Xr8Tz1Va1",
          "type": "call.incoming",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "call_id": "wacid.HBgLMTY1MDU1NTEyMzQVAgARGCBBQkNERUY",
            "direction": "user_initiated",
            "event": "connect",
            "from": "61412345678",
            "to": "4976659348270",
            "contact": {
              "name": "Sample Contact",
              "wa_id": "61412345678"
            },
            "session": {
              "sdp_type": "offer",
              "sdp": "v=0\r\no=- 7669997803033704573 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n..."
            },
            "timestamp": "2026-11-06T01:00:00.000Z",
            "whatsapp": {
              "id": "wacid.HBgLMTY1MDU1NTEyMzQVAgARGCBBQkNERUY",
              "from": "61412345678",
              "to": "4976659348270",
              "event": "connect",
              "timestamp": "1793926800",
              "direction": "USER_INITIATED",
              "session": {
                "sdp_type": "offer",
                "sdp": "v=0..."
              }
            }
          }
        }
      }
    },
    {
      "type": "call.status",
      "group": "Calling",
      "when": "A call rang, was accepted, rejected or connected, ended, or its recording or transcript is ready.",
      "data": {
        "type": "object",
        "properties": {
          "call_id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "call.status: ringing, accepted, rejected, connect, created, completed, failed, recording_available, transcription_available."
          },
          "direction": {
            "type": "string",
            "enum": [
              "user_initiated",
              "business_initiated"
            ],
            "description": "Meta's; without it, from the SDP type or the numbers."
          },
          "event": {
            "type": "string",
            "description": "Meta's event: connect, call_created, terminate ..."
          },
          "from": {
            "type": "string"
          },
          "from_user_id": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "to_user_id": {
            "type": "string"
          },
          "contact": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "wa_id": {
                "type": "string"
              },
              "user_id": {
                "type": "string"
              }
            }
          },
          "session": {
            "type": "object",
            "properties": {
              "sdp_type": {
                "type": "string",
                "enum": [
                  "offer",
                  "answer"
                ]
              },
              "sdp": {
                "type": "string",
                "description": "RFC 8866 SDP."
              }
            },
            "required": [
              "sdp_type",
              "sdp"
            ]
          },
          "start_time": {
            "type": "string",
            "format": "date-time"
          },
          "end_time": {
            "type": "string",
            "format": "date-time"
          },
          "duration_seconds": {
            "type": "integer"
          },
          "biz_opaque_callback_data": {
            "type": "string"
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "integer"
              },
              "message": {
                "type": "string"
              },
              "details": {
                "type": "string"
              }
            }
          },
          "recording": {
            "type": "object",
            "properties": {
              "media_id": {
                "type": "string"
              },
              "mime_type": {
                "type": "string"
              }
            }
          },
          "transcription": {
            "type": "object",
            "properties": {
              "media_id": {
                "type": "string"
              },
              "mime_type": {
                "type": "string"
              }
            }
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "whatsapp": {
            "type": "object",
            "properties": {},
            "description": "Meta's call or status object as received.",
            "additionalProperties": true
          }
        },
        "required": [
          "call_id"
        ]
      },
      "samples": {
        "completed": {
          "id": "evt_Kc7m2Qw9Lp4Xr8Tz1Va2",
          "type": "call.status",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "call_id": "wacid.HBgLMTY1MDU1NTEyMzQVAgARGCBBQkNERUY",
            "status": "completed",
            "direction": "user_initiated",
            "event": "terminate",
            "from": "61412345678",
            "to": "4976659348270",
            "start_time": "2026-11-06T00:58:00.000Z",
            "end_time": "2026-11-06T01:00:00.000Z",
            "duration_seconds": 120,
            "timestamp": "2026-11-06T01:00:00.000Z",
            "whatsapp": {
              "id": "wacid.HBgLMTY1MDU1NTEyMzQVAgARGCBBQkNERUY",
              "event": "terminate",
              "status": "COMPLETED",
              "duration": 120,
              "timestamp": "1793926800"
            }
          }
        },
        "ringing": {
          "id": "evt_Kc7m2Qw9Lp4Xr8Tz1Va3",
          "type": "call.status",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "call_id": "wacid.HBgLMTY1MDU1NTEyMzQVAgARGCBBQkNERUY",
            "status": "ringing",
            "direction": "business_initiated",
            "to": "61412345678",
            "timestamp": "2026-11-06T01:00:00.000Z",
            "whatsapp": {
              "id": "wacid.HBgLMTY1MDU1NTEyMzQVAgARGCBBQkNERUY",
              "type": "call",
              "status": "RINGING",
              "recipient_id": "61412345678",
              "timestamp": "1793926800"
            }
          }
        }
      }
    },
    {
      "type": "message.edited",
      "group": "Messages",
      "when": "A contact edited a message they sent.",
      "data": {
        "type": "object",
        "properties": {
          "message_id": {
            "type": "string",
            "description": "The edit's own id."
          },
          "original_message_id": {
            "type": "string"
          },
          "from": {
            "type": "string"
          },
          "from_user_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "description": "The new content's type, eg text or image."
          },
          "text": {
            "type": "string",
            "description": "The new text or caption."
          },
          "message": {
            "type": "object",
            "additionalProperties": true,
            "description": "The new content, as Meta sent it."
          },
          "conversation_url": {
            "type": "string"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "whatsapp": {
            "type": "object",
            "additionalProperties": true,
            "description": "Meta's object, unchanged."
          }
        },
        "required": [
          "message_id",
          "original_message_id",
          "from"
        ]
      },
      "samples": {
        "text": {
          "id": "evt_Pa3k9m2Lw8Rt5Yp1Zs01",
          "type": "message.edited",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA=",
            "original_message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgASGBJPUklHSU5BTF9NRVNTQUdFAA==",
            "from": "61412345678",
            "from_user_id": "AU.1234567890123456",
            "name": "Sample Contact",
            "type": "text",
            "text": "Is my order on its way? It is order 1234.",
            "message": {
              "type": "text",
              "text": {
                "body": "Is my order on its way? It is order 1234."
              }
            },
            "conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_SAMPLEk3XbQ9rTzP2mW",
            "timestamp": "2026-11-06T01:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "message.deleted",
      "group": "Messages",
      "when": "A contact deleted a message they sent.",
      "data": {
        "type": "object",
        "properties": {
          "message_id": {
            "type": "string"
          },
          "original_message_id": {
            "type": "string"
          },
          "from": {
            "type": "string"
          },
          "from_user_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "conversation_url": {
            "type": "string"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "whatsapp": {
            "type": "object",
            "additionalProperties": true,
            "description": "Meta's object, unchanged."
          }
        },
        "required": [
          "message_id",
          "original_message_id",
          "from"
        ]
      },
      "samples": {
        "deleted": {
          "id": "evt_Pa3k9m2Lw8Rt5Yp1Zs02",
          "type": "message.deleted",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA=",
            "original_message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgASGBJPUklHSU5BTF9NRVNTQUdFAA==",
            "from": "61412345678",
            "from_user_id": "AU.1234567890123456",
            "name": "Sample Contact",
            "conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_SAMPLEk3XbQ9rTzP2mW",
            "timestamp": "2026-11-06T01:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "contact.changed_number",
      "group": "Contacts",
      "when": "A contact changed their WhatsApp number, or their business-scoped user id changed.",
      "data": {
        "type": "object",
        "properties": {
          "change": {
            "type": "string",
            "enum": [
              "user_changed_number",
              "user_changed_user_id"
            ]
          },
          "previous": {
            "type": "object",
            "properties": {
              "phone": {
                "type": "string"
              },
              "user_id": {
                "type": "string"
              }
            }
          },
          "new": {
            "type": "object",
            "properties": {
              "phone": {
                "type": "string"
              },
              "user_id": {
                "type": "string"
              }
            }
          },
          "name": {
            "type": "string"
          },
          "body": {
            "type": "string",
            "description": "WhatsApp's text, eg 'User Ann changed from ... to ...'."
          },
          "message_id": {
            "type": "string"
          },
          "conversation_url": {
            "type": "string"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "whatsapp": {
            "type": "object",
            "additionalProperties": true,
            "description": "Meta's object, unchanged."
          }
        },
        "required": [
          "change",
          "previous",
          "new"
        ]
      },
      "samples": {
        "number": {
          "id": "evt_Pa3k9m2Lw8Rt5Yp1Zs03",
          "type": "contact.changed_number",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "change": "user_changed_number",
            "previous": {
              "phone": "61412345678",
              "user_id": "AU.9876543210987654"
            },
            "new": {
              "phone": "61498765432",
              "user_id": "AU.1234567890123456"
            },
            "name": "Sample Contact",
            "body": "User Sample Contact changed from 61412345678 to 61498765432",
            "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA=",
            "conversation_url": "https://www.app2email.com/conversation/61412345678_4976659348270_SAMPLEk3XbQ9rTzP2mW",
            "timestamp": "2026-11-06T01:00:00.000Z"
          }
        },
        "user_id": {
          "id": "evt_Pa3k9m2Lw8Rt5Yp1Zs04",
          "type": "contact.changed_number",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "change": "user_changed_user_id",
            "previous": {
              "user_id": "AU.9876543210987654"
            },
            "new": {
              "user_id": "AU.1234567890123456"
            },
            "message_id": "wamid.HBgLNjE0MTIzNDU2NzgVAgARGBJTQU1QTEVfVEVTVF9FVkVOVAA=",
            "timestamp": "2026-11-06T01:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "number.updated",
      "group": "Number",
      "when": "WhatsApp changed something about the number or its account: quality, messaging limit, throughput, display name, status, restriction, connection ...",
      "data": {
        "type": "object",
        "properties": {
          "change": {
            "type": "string",
            "enum": [
              "quality",
              "messaging_limit",
              "onboarding",
              "throughput",
              "display_name",
              "account_status",
              "account_review",
              "restriction",
              "violation",
              "username",
              "capability",
              "connection",
              "marketing_messages_onboarding",
              "security",
              "account"
            ],
            "description": "phone_number_quality_update: quality (FLAGGED, UNFLAGGED), messaging_limit (UPGRADE, DOWNGRADE), onboarding (the first limit), throughput (THROUGHPUT_UPGRADE); new_value is then the limit, eg TIER_10K or TIER_UNLIMITED."
          },
          "previous_value": {
            "type": "string"
          },
          "new_value": {
            "type": "string"
          },
          "details": {
            "type": "object",
            "additionalProperties": true,
            "description": "What WhatsApp sent with it (event, decision, rejection_reason, restriction_info ...)."
          },
          "next_step": {
            "type": "string",
            "enum": [
              "reconnect"
            ],
            "description": "reconnect: press Reconnect WhatsApp on the dashboard (a new display name, or the connection was lost)."
          },
          "whatsapp_field": {
            "type": "string",
            "description": "Meta's webhook field, eg phone_number_quality_update or account_update."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "change",
          "whatsapp_field"
        ]
      },
      "samples": {
        "messaging_limit": {
          "id": "evt_Pa3k9m2Lw8Rt5Yp1Zs05",
          "type": "number.updated",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "change": "messaging_limit",
            "previous_value": "TIER_2K",
            "new_value": "TIER_10K",
            "details": {
              "event": "UPGRADE"
            },
            "whatsapp_field": "phone_number_quality_update",
            "timestamp": "2026-11-06T01:00:00.000Z"
          }
        },
        "throughput": {
          "id": "evt_Pa3k9m2Lw8Rt5Yp1Zs018",
          "type": "number.updated",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "change": "throughput",
            "new_value": "TIER_UNLIMITED",
            "details": {
              "event": "THROUGHPUT_UPGRADE"
            },
            "whatsapp_field": "phone_number_quality_update",
            "timestamp": "2026-11-06T01:00:00.000Z"
          }
        },
        "display_name": {
          "id": "evt_Pa3k9m2Lw8Rt5Yp1Zs06",
          "type": "number.updated",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "change": "display_name",
            "previous_value": "Sample Shop",
            "new_value": "Sample Shop Sydney",
            "details": {
              "decision": "APPROVED"
            },
            "next_step": "reconnect",
            "whatsapp_field": "phone_number_name_update",
            "timestamp": "2026-11-06T01:00:00.000Z"
          }
        },
        "connection": {
          "id": "evt_Pa3k9m2Lw8Rt5Yp1Zs07",
          "type": "number.updated",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "change": "connection",
            "new_value": "access_removed",
            "details": {
              "event": "PARTNER_REMOVED"
            },
            "next_step": "reconnect",
            "whatsapp_field": "account_update",
            "timestamp": "2026-11-06T01:00:00.000Z"
          }
        },
        "restriction": {
          "id": "evt_Pa3k9m2Lw8Rt5Yp1Zs08",
          "type": "number.updated",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "change": "restriction",
            "new_value": "RESTRICTED_BIZ_INITIATED_MESSAGING",
            "details": {
              "event": "ACCOUNT_RESTRICTION",
              "restriction_info": [
                {
                  "restriction_type": "RESTRICTED_BIZ_INITIATED_MESSAGING",
                  "expiration": 1762560000
                }
              ]
            },
            "whatsapp_field": "account_update",
            "timestamp": "2026-11-06T01:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "number.error",
      "group": "Number",
      "when": "WhatsApp reported an error that is not about one message, eg too many messages in a short time.",
      "data": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "description": "Meta's error code, eg 130429."
          },
          "title": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "details": {
            "type": "string"
          },
          "href": {
            "type": "string"
          },
          "error_code": {
            "type": "string",
            "description": "app2email's code for it (/docs/api/errors)."
          },
          "how_to_fix": {
            "type": "string"
          },
          "is_retriable": {
            "type": "boolean"
          },
          "retry_after_seconds": {
            "type": "integer"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "code"
        ]
      },
      "samples": {
        "rate_limit": {
          "id": "evt_Pa3k9m2Lw8Rt5Yp1Zs09",
          "type": "number.error",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "code": 130429,
            "title": "Rate limit hit",
            "message": "Rate limit hit",
            "details": "Message failed to send because there were too many messages sent from this phone number in a short period of time.",
            "href": "https://developers.facebook.com/documentation/business-messaging/whatsapp/support/error-codes",
            "error_code": "whatsapp_rate_limit",
            "how_to_fix": "WhatsApp's rate limit was reached. Slow down and try again in a minute.",
            "is_retriable": true,
            "timestamp": "2026-11-06T01:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "flow.status_changed",
      "group": "Flows",
      "when": "A flow was published, throttled, blocked or deprecated, Meta raised or cleared an endpoint or client alert, or its Flow JSON version expires soon. WABA-wide: every number gets it.",
      "data": {
        "type": "object",
        "required": [
          "flow_id",
          "change"
        ],
        "properties": {
          "flow_id": {
            "type": "string"
          },
          "change": {
            "type": "string",
            "description": "status (FLOW_STATUS_CHANGE); else Meta's event in lower case: client_error_rate, endpoint_error_rate, endpoint_latency, endpoint_availability, flow_version_expiry_warning (and any event Meta adds); other when Meta sent no event."
          },
          "event": {
            "type": "string",
            "description": "Meta's event: FLOW_STATUS_CHANGE, CLIENT_ERROR_RATE, ENDPOINT_ERROR_RATE, ENDPOINT_LATENCY, ENDPOINT_AVAILABILITY, FLOW_VERSION_EXPIRY_WARNING."
          },
          "old_status": {
            "type": "string",
            "enum": [
              "DRAFT",
              "PUBLISHED",
              "DEPRECATED",
              "BLOCKED",
              "THROTTLED"
            ],
            "description": "Left out when the flow was just created."
          },
          "new_status": {
            "type": "string",
            "enum": [
              "DRAFT",
              "PUBLISHED",
              "DEPRECATED",
              "BLOCKED",
              "THROTTLED"
            ]
          },
          "message": {
            "type": "string",
            "description": "Meta's text."
          },
          "warning": {
            "type": "string",
            "description": "FLOW_VERSION_EXPIRY_WARNING: the Flow JSON version will freeze soon."
          },
          "alert_state": {
            "type": "string",
            "enum": [
              "ACTIVATED",
              "DEACTIVATED"
            ]
          },
          "threshold": {
            "type": "number"
          },
          "error_rate": {
            "type": "number"
          },
          "p50_latency": {
            "type": "integer"
          },
          "p90_latency": {
            "type": "integer"
          },
          "availability": {
            "type": "number"
          },
          "requests_count": {
            "type": "integer"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "error_type": {
                  "type": "string"
                },
                "error_rate": {
                  "type": "number"
                },
                "error_count": {
                  "type": "integer"
                }
              }
            }
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "samples": {
        "published": {
          "id": "evt_Xq3k9m2Lw8Rt5Yp1Zs21",
          "type": "flow.status_changed",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "flow_id": "1234567890123456",
            "change": "status",
            "event": "FLOW_STATUS_CHANGE",
            "old_status": "DRAFT",
            "new_status": "PUBLISHED",
            "message": "Flow appointment_booking changed status from DRAFT to PUBLISHED",
            "timestamp": "2026-11-06T01:00:00.000Z"
          }
        },
        "endpoint_latency": {
          "id": "evt_Xq3k9m2Lw8Rt5Yp1Zs22",
          "type": "flow.status_changed",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "flow_id": "1234567890123456",
            "change": "endpoint_latency",
            "event": "ENDPOINT_LATENCY",
            "alert_state": "ACTIVATED",
            "message": "Flow endpoint latency has reached the p90 threshold in the last 30 minutes.",
            "p90_latency": 8000,
            "p50_latency": 500,
            "requests_count": 34,
            "threshold": 7000,
            "timestamp": "2026-11-06T01:00:00.000Z"
          }
        },
        "version_expiry": {
          "id": "evt_Xq3k9m2Lw8Rt5Yp1Zs23",
          "type": "flow.status_changed",
          "created": "2026-11-06T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "flow_id": "1234567890123456",
            "change": "flow_version_expiry_warning",
            "event": "FLOW_VERSION_EXPIRY_WARNING",
            "warning": "Your current Flow version will freeze in 21 days. You won't be able to send the Flow after it expires. Please migrate to the recommended version as soon as possible.",
            "timestamp": "2026-11-06T01:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "client.created",
      "group": "Partner",
      "when": "A client signed up on your site, was made by POST /v1/partner/clients, or finished an onboarding link.",
      "data": {
        "type": "object",
        "properties": {
          "client": {
            "$ref": "#/components/schemas/PartnerClient"
          },
          "source": {
            "type": "string",
            "description": "partner_api, onboarding_link, register ..."
          },
          "changes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "client"
        ]
      },
      "samples": {
        "partner_api": {
          "id": "evt_Pt01k9m2Lw8Rt5Yp1Zs0",
          "type": "client.created",
          "created": "2026-11-06T09:00:00.000Z",
          "number": "",
          "data": {
            "client": {
              "id": "k3x9q2m7v8w1r4t",
              "email": "ann@example.com",
              "name": "Ann's Bakery",
              "status": "active",
              "created": "2026-11-05T08:00:00Z",
              "numbers": [],
              "numbers_count": 0
            },
            "source": "partner_api",
            "timestamp": "2026-11-06T09:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "client.updated",
      "group": "Partner",
      "when": "A client's name changed, or a suspended client is active again.",
      "data": {
        "type": "object",
        "properties": {
          "client": {
            "$ref": "#/components/schemas/PartnerClient"
          },
          "source": {
            "type": "string",
            "description": "partner_api, onboarding_link, register ..."
          },
          "changes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "client"
        ]
      },
      "samples": {
        "name": {
          "id": "evt_Pt02k9m2Lw8Rt5Yp1Zs0",
          "type": "client.updated",
          "created": "2026-11-06T09:00:00.000Z",
          "number": "",
          "data": {
            "client": {
              "id": "k3x9q2m7v8w1r4t",
              "email": "ann@example.com",
              "name": "Ann's Bakery",
              "status": "active",
              "created": "2026-11-05T08:00:00Z",
              "numbers": [
                "4976659348270"
              ],
              "numbers_count": 1
            },
            "changes": [
              "name"
            ],
            "timestamp": "2026-11-06T09:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "client.suspended",
      "group": "Partner",
      "when": "A client was suspended.",
      "data": {
        "type": "object",
        "properties": {
          "client": {
            "$ref": "#/components/schemas/PartnerClient"
          },
          "source": {
            "type": "string",
            "description": "partner_api, onboarding_link, register ..."
          },
          "changes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "client"
        ]
      },
      "samples": {
        "suspended": {
          "id": "evt_Pt03k9m2Lw8Rt5Yp1Zs0",
          "type": "client.suspended",
          "created": "2026-11-06T09:00:00.000Z",
          "number": "",
          "data": {
            "client": {
              "id": "k3x9q2m7v8w1r4t",
              "email": "ann@example.com",
              "name": "Ann's Bakery",
              "status": "suspended",
              "created": "2026-11-05T08:00:00Z",
              "numbers": [
                "4976659348270"
              ],
              "numbers_count": 1
            },
            "changes": [
              "status"
            ],
            "timestamp": "2026-11-06T09:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "number.created",
      "group": "Partner",
      "when": "A number was connected (Meta's Embedded Signup finished).",
      "data": {
        "type": "object",
        "properties": {
          "number": {
            "type": "string"
          },
          "client_id": {
            "type": "string",
            "nullable": true,
            "description": "The reseller's client (partner webhooks)."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "display_number": {
            "type": "string",
            "nullable": true
          },
          "service_status": {
            "type": "string",
            "nullable": true
          },
          "plan": {
            "type": "string"
          }
        },
        "required": [
          "number"
        ]
      },
      "samples": {
        "created": {
          "id": "evt_Pt04k9m2Lw8Rt5Yp1Zs0",
          "type": "number.created",
          "created": "2026-11-06T09:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "number": "4976659348270",
            "client_id": "k3x9q2m7v8w1r4t",
            "name": "Ann's Bakery",
            "display_number": "+49 7665 9348270",
            "service_status": "LIVE",
            "plan": "TRIAL",
            "timestamp": "2026-11-06T09:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "number.ready",
      "group": "Partner",
      "when": "A number went LIVE (once per number): it can send.",
      "data": {
        "type": "object",
        "properties": {
          "number": {
            "type": "string"
          },
          "client_id": {
            "type": "string",
            "nullable": true,
            "description": "The reseller's client (partner webhooks)."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "service_status": {
            "type": "string"
          },
          "plan": {
            "type": "string"
          }
        },
        "required": [
          "number"
        ]
      },
      "samples": {
        "ready": {
          "id": "evt_Pt05k9m2Lw8Rt5Yp1Zs0",
          "type": "number.ready",
          "created": "2026-11-06T09:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "number": "4976659348270",
            "client_id": "k3x9q2m7v8w1r4t",
            "name": "Ann's Bakery",
            "service_status": "LIVE",
            "plan": "standard_2000",
            "timestamp": "2026-11-06T09:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "number.disconnected",
      "group": "Partner",
      "when": "WhatsApp took app2email's access away (account offboarded, partner removed, deleted).",
      "data": {
        "type": "object",
        "properties": {
          "number": {
            "type": "string"
          },
          "client_id": {
            "type": "string",
            "nullable": true,
            "description": "The reseller's client (partner webhooks)."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "reason": {
            "type": "string",
            "description": "offboarded, access_removed, app_uninstalled, deleted, disabled."
          },
          "next_step": {
            "type": "string",
            "nullable": true,
            "description": "reconnect: press Reconnect WhatsApp on the dashboard."
          },
          "details": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "required": [
          "number",
          "reason"
        ]
      },
      "samples": {
        "access_removed": {
          "id": "evt_Pt06k9m2Lw8Rt5Yp1Zs0",
          "type": "number.disconnected",
          "created": "2026-11-06T09:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "number": "4976659348270",
            "client_id": "k3x9q2m7v8w1r4t",
            "reason": "access_removed",
            "next_step": "reconnect",
            "details": {
              "event": "PARTNER_REMOVED"
            },
            "timestamp": "2026-11-06T09:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "number.reconnected",
      "group": "Partner",
      "when": "The number's WhatsApp account is connected again.",
      "data": {
        "type": "object",
        "properties": {
          "number": {
            "type": "string"
          },
          "client_id": {
            "type": "string",
            "nullable": true,
            "description": "The reseller's client (partner webhooks)."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "reason": {
            "type": "string"
          },
          "details": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "required": [
          "number"
        ]
      },
      "samples": {
        "reconnected": {
          "id": "evt_Pt07k9m2Lw8Rt5Yp1Zs0",
          "type": "number.reconnected",
          "created": "2026-11-06T09:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "number": "4976659348270",
            "client_id": "k3x9q2m7v8w1r4t",
            "reason": "reconnected",
            "details": {
              "event": "ACCOUNT_RECONNECTED"
            },
            "timestamp": "2026-11-06T09:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "subscription.created",
      "group": "Partner",
      "when": "A client number got a plan (Stripe checkout, a free or a given plan).",
      "data": {
        "type": "object",
        "properties": {
          "subscription": {
            "$ref": "#/components/schemas/PartnerSubscription"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "subscription"
        ]
      },
      "samples": {
        "stripe": {
          "id": "evt_Pt08k9m2Lw8Rt5Yp1Zs0",
          "type": "subscription.created",
          "created": "2026-11-06T09:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "subscription": {
              "id": 4211,
              "tier_id": "growth",
              "tier_name": "Growth",
              "interval": "month",
              "messages_per_month": 2000,
              "price": {
                "amount_minor": 4900,
                "currency": "usd"
              },
              "status": "active",
              "source": "stripe",
              "cancel_at_period_end": false,
              "current_period_start": "2026-11-01T00:00:00Z",
              "current_period_end": "2026-12-01T00:00:00Z",
              "is_current": true,
              "canceled_at": null,
              "ended_reason": null,
              "test_mode": false,
              "client_id": "k3x9q2m7v8w1r4t",
              "number": "4976659348270"
            },
            "timestamp": "2026-11-06T09:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "subscription.renewed",
      "group": "Partner",
      "when": "A plan's period moved on (a renewal was paid).",
      "data": {
        "type": "object",
        "properties": {
          "subscription": {
            "$ref": "#/components/schemas/PartnerSubscription"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "subscription"
        ]
      },
      "samples": {
        "renewed": {
          "id": "evt_Pt09k9m2Lw8Rt5Yp1Zs0",
          "type": "subscription.renewed",
          "created": "2026-11-06T09:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "subscription": {
              "id": 4211,
              "tier_id": "growth",
              "tier_name": "Growth",
              "interval": "month",
              "messages_per_month": 2000,
              "price": {
                "amount_minor": 4900,
                "currency": "usd"
              },
              "status": "active",
              "source": "stripe",
              "cancel_at_period_end": false,
              "current_period_start": "2026-11-01T00:00:00Z",
              "current_period_end": "2026-12-01T00:00:00Z",
              "is_current": true,
              "canceled_at": null,
              "ended_reason": null,
              "test_mode": false,
              "client_id": "k3x9q2m7v8w1r4t",
              "number": "4976659348270"
            },
            "timestamp": "2026-11-06T09:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "subscription.payment_failed",
      "group": "Partner",
      "when": "A renewal could not be charged (status past_due or unpaid).",
      "data": {
        "type": "object",
        "properties": {
          "subscription": {
            "$ref": "#/components/schemas/PartnerSubscription"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "subscription"
        ]
      },
      "samples": {
        "past_due": {
          "id": "evt_Pt10k9m2Lw8Rt5Yp1Zs0",
          "type": "subscription.payment_failed",
          "created": "2026-11-06T09:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "subscription": {
              "id": 4211,
              "tier_id": "growth",
              "tier_name": "Growth",
              "interval": "month",
              "messages_per_month": 2000,
              "price": {
                "amount_minor": 4900,
                "currency": "usd"
              },
              "status": "past_due",
              "source": "stripe",
              "cancel_at_period_end": false,
              "current_period_start": "2026-11-01T00:00:00Z",
              "current_period_end": "2026-12-01T00:00:00Z",
              "is_current": true,
              "canceled_at": null,
              "ended_reason": null,
              "test_mode": false,
              "client_id": "k3x9q2m7v8w1r4t",
              "number": "4976659348270"
            },
            "timestamp": "2026-11-06T09:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "subscription.cancelled",
      "group": "Partner",
      "when": "A plan ended (cancelled, unpaid, replaced by another plan, or ended by you).",
      "data": {
        "type": "object",
        "properties": {
          "subscription": {
            "$ref": "#/components/schemas/PartnerSubscription"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "subscription"
        ]
      },
      "samples": {
        "ended": {
          "id": "evt_Pt11k9m2Lw8Rt5Yp1Zs0",
          "type": "subscription.cancelled",
          "created": "2026-11-06T09:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "subscription": {
              "id": 4211,
              "tier_id": "growth",
              "tier_name": "Growth",
              "interval": "month",
              "messages_per_month": 2000,
              "price": {
                "amount_minor": 4900,
                "currency": "usd"
              },
              "status": "canceled",
              "source": "stripe",
              "cancel_at_period_end": false,
              "current_period_start": "2026-11-01T00:00:00Z",
              "current_period_end": "2026-12-01T00:00:00Z",
              "is_current": false,
              "canceled_at": null,
              "ended_reason": "customer.subscription.deleted",
              "test_mode": false,
              "client_id": "k3x9q2m7v8w1r4t",
              "number": "4976659348270"
            },
            "timestamp": "2026-11-06T09:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "trial.ending",
      "group": "Partner",
      "when": "A number's trial ends within 3 days.",
      "data": {
        "type": "object",
        "properties": {
          "number": {
            "type": "string"
          },
          "client_id": {
            "type": "string",
            "nullable": true,
            "description": "The reseller's client (partner webhooks)."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "trial_ends_at": {
            "type": "string",
            "format": "date-time"
          },
          "days_left": {
            "type": "integer"
          },
          "plan_messages": {
            "type": "object",
            "properties": {
              "total_sent": {
                "type": "integer"
              },
              "limit": {
                "type": "integer"
              }
            }
          }
        },
        "required": [
          "number",
          "trial_ends_at"
        ]
      },
      "samples": {
        "ending": {
          "id": "evt_Pt12k9m2Lw8Rt5Yp1Zs0",
          "type": "trial.ending",
          "created": "2026-11-06T09:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "number": "4976659348270",
            "client_id": "k3x9q2m7v8w1r4t",
            "trial_ends_at": "2026-11-09T09:00:00.000Z",
            "days_left": 3,
            "plan_messages": {
              "total_sent": 12,
              "limit": 50
            },
            "timestamp": "2026-11-06T09:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "trial.expired",
      "group": "Partner",
      "when": "A number's trial ended without a plan.",
      "data": {
        "type": "object",
        "properties": {
          "number": {
            "type": "string"
          },
          "client_id": {
            "type": "string",
            "nullable": true,
            "description": "The reseller's client (partner webhooks)."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "trial_ended_at": {
            "type": "string",
            "format": "date-time"
          },
          "service_status": {
            "type": "string"
          }
        },
        "required": [
          "number",
          "trial_ended_at"
        ]
      },
      "samples": {
        "expired": {
          "id": "evt_Pt13k9m2Lw8Rt5Yp1Zs0",
          "type": "trial.expired",
          "created": "2026-11-06T09:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "number": "4976659348270",
            "client_id": "k3x9q2m7v8w1r4t",
            "trial_ended_at": "2026-11-06T08:00:00.000Z",
            "service_status": "EXPIRED",
            "timestamp": "2026-11-06T09:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "plan.limit_reached",
      "group": "Partner",
      "when": "A number used all messages of its plan this billing period (once per period).",
      "data": {
        "type": "object",
        "properties": {
          "number": {
            "type": "string"
          },
          "client_id": {
            "type": "string",
            "nullable": true,
            "description": "The reseller's client (partner webhooks)."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "plan": {
            "type": "string"
          },
          "plan_messages": {
            "type": "object",
            "properties": {
              "whatsapp_sent": {
                "type": "integer"
              },
              "emails_sent": {
                "type": "integer"
              },
              "total_sent": {
                "type": "integer"
              },
              "limit": {
                "type": "integer"
              }
            }
          },
          "billing_period": {
            "type": "object",
            "properties": {
              "start": {
                "type": "string",
                "format": "date-time",
                "nullable": true
              },
              "end": {
                "type": "string",
                "format": "date-time",
                "nullable": true
              }
            }
          }
        },
        "required": [
          "number"
        ]
      },
      "samples": {
        "reached": {
          "id": "evt_Pt14k9m2Lw8Rt5Yp1Zs0",
          "type": "plan.limit_reached",
          "created": "2026-11-06T09:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "number": "4976659348270",
            "client_id": "k3x9q2m7v8w1r4t",
            "plan": "standard_2000",
            "plan_messages": {
              "whatsapp_sent": 1990,
              "emails_sent": 10,
              "total_sent": 2000,
              "limit": 2000
            },
            "billing_period": {
              "start": "2026-11-01T00:00:00Z",
              "end": "2026-12-01T00:00:00Z"
            },
            "timestamp": "2026-11-06T09:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "api_key.created",
      "group": "Partner",
      "when": "A key of a number was made (Partner API, account API or dashboard).",
      "data": {
        "type": "object",
        "properties": {
          "number": {
            "type": "string"
          },
          "client_id": {
            "type": "string",
            "nullable": true,
            "description": "The reseller's client (partner webhooks)."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "key": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer"
              },
              "name": {
                "type": "string"
              },
              "scopes": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "sandbox": {
                "type": "boolean"
              },
              "created": {
                "type": "string",
                "format": "date-time"
              },
              "expires": {
                "type": "string",
                "format": "date-time",
                "nullable": true
              }
            }
          },
          "created_by": {
            "type": "string"
          }
        },
        "required": [
          "number",
          "key"
        ]
      },
      "samples": {
        "partner_api": {
          "id": "evt_Pt15k9m2Lw8Rt5Yp1Zs0",
          "type": "api_key.created",
          "created": "2026-11-06T09:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "number": "4976659348270",
            "client_id": "k3x9q2m7v8w1r4t",
            "key": {
              "id": 812,
              "name": "CRM",
              "scopes": [
                "messages:send",
                "messages:read"
              ],
              "sandbox": false,
              "created": "2026-11-06T09:00:00.000Z",
              "expires": null
            },
            "created_by": "partner_api",
            "timestamp": "2026-11-06T09:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "api_key.revoked",
      "group": "Partner",
      "when": "A key of a number was revoked.",
      "data": {
        "type": "object",
        "properties": {
          "number": {
            "type": "string"
          },
          "client_id": {
            "type": "string",
            "nullable": true,
            "description": "The reseller's client (partner webhooks)."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "key": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer"
              },
              "name": {
                "type": "string"
              }
            }
          },
          "revoked_by": {
            "type": "string"
          }
        },
        "required": [
          "number",
          "key"
        ]
      },
      "samples": {
        "partner_api": {
          "id": "evt_Pt16k9m2Lw8Rt5Yp1Zs0",
          "type": "api_key.revoked",
          "created": "2026-11-06T09:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "number": "4976659348270",
            "client_id": "k3x9q2m7v8w1r4t",
            "key": {
              "id": 812,
              "name": "CRM"
            },
            "revoked_by": "partner_api",
            "timestamp": "2026-11-06T09:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "booking.paid",
      "group": "Bookings",
      "when": "An appointment was paid online (the payment provider confirmed it, or a deposit was paid). Not sent for a payment the business recorded by hand.",
      "data": {
        "type": "object",
        "required": [
          "id",
          "reference",
          "payment"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "reference": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "contact": {
            "type": "string"
          },
          "start": {
            "type": "string",
            "format": "date-time"
          },
          "end": {
            "type": "string",
            "format": "date-time"
          },
          "payment": {
            "$ref": "#/components/schemas/Payment"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "The Booking object (GET /bookings/{id}) plus the fields below and timestamp."
      },
      "samples": {
        "online": {
          "id": "evt_Pay3k9m2Lw8Rt5Yp1Zs01",
          "type": "booking.paid",
          "created": "2026-11-11T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "id": 42,
            "reference": "BK-7Q3M2A",
            "status": "confirmed",
            "contact": "61412345678",
            "contact_name": "Sample Contact",
            "contact_email": "sample@example.com",
            "service": {
              "id": "haircut",
              "name": "Haircut",
              "duration_min": 30
            },
            "start": "2026-11-14T23:00:00.000Z",
            "end": "2026-11-14T23:30:00.000Z",
            "timezone": "Australia/Sydney",
            "source": "web",
            "answers": {},
            "provider": {
              "id": "maria",
              "name": "Maria"
            },
            "credits_used": 0,
            "payment_status": "paid",
            "created": "2026-11-11T01:00:00.000Z",
            "timestamp": "2026-11-11T01:00:00.000Z",
            "payment": {
              "id": 15,
              "kind": "booking",
              "status": "paid",
              "provider": "stripe",
              "amount": 40.0,
              "amount_label": "$40.00",
              "full_label": "$40.00",
              "discount_label": "",
              "coupon_code": "",
              "currency": "USD",
              "refunded": 0.0,
              "refunded_label": "",
              "description": "Haircut",
              "contact": "61412345678",
              "payer_name": "John Smith",
              "appointment_id": 42,
              "booking_reference": "BK-7Q3M2A",
              "package_purchase_id": null,
              "checkout_url": "",
              "link_url": "",
              "last_error": "",
              "paid": "2026-11-11T01:15:00.000Z",
              "refunded_at": null,
              "created": "2026-11-11T01:10:00.000Z"
            }
          }
        }
      }
    },
    {
      "type": "booking.refunded",
      "group": "Bookings",
      "when": "An appointment's online payment was refunded, in full or in part (from the calendar, the API, or automatically when it is cancelled).",
      "data": {
        "type": "object",
        "required": [
          "id",
          "reference",
          "payment"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "reference": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "contact": {
            "type": "string"
          },
          "start": {
            "type": "string",
            "format": "date-time"
          },
          "end": {
            "type": "string",
            "format": "date-time"
          },
          "payment": {
            "$ref": "#/components/schemas/Payment"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "refund": {
            "type": "object",
            "properties": {
              "amount": {
                "type": "number"
              },
              "amount_label": {
                "type": "string"
              },
              "full": {
                "type": "boolean"
              },
              "by": {
                "type": "string"
              }
            }
          }
        },
        "description": "The Booking object (GET /bookings/{id}) plus the fields below and timestamp."
      },
      "samples": {
        "full": {
          "id": "evt_Pay3k9m2Lw8Rt5Yp1Zs02",
          "type": "booking.refunded",
          "created": "2026-11-11T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "id": 42,
            "reference": "BK-7Q3M2A",
            "status": "confirmed",
            "contact": "61412345678",
            "contact_name": "Sample Contact",
            "contact_email": "sample@example.com",
            "service": {
              "id": "haircut",
              "name": "Haircut",
              "duration_min": 30
            },
            "start": "2026-11-14T23:00:00.000Z",
            "end": "2026-11-14T23:30:00.000Z",
            "timezone": "Australia/Sydney",
            "source": "web",
            "answers": {},
            "provider": {
              "id": "maria",
              "name": "Maria"
            },
            "credits_used": 0,
            "payment_status": "refunded",
            "created": "2026-11-11T01:00:00.000Z",
            "timestamp": "2026-11-11T01:00:00.000Z",
            "payment": {
              "id": 15,
              "kind": "booking",
              "status": "refunded",
              "provider": "stripe",
              "amount": 40.0,
              "amount_label": "$40.00",
              "full_label": "$40.00",
              "discount_label": "",
              "coupon_code": "",
              "currency": "USD",
              "refunded": 40.0,
              "refunded_label": "$40.00",
              "description": "Haircut",
              "contact": "61412345678",
              "payer_name": "John Smith",
              "appointment_id": 42,
              "booking_reference": "BK-7Q3M2A",
              "package_purchase_id": null,
              "checkout_url": "",
              "link_url": "",
              "last_error": "",
              "paid": "2026-11-11T01:15:00.000Z",
              "refunded_at": null,
              "created": "2026-11-11T01:10:00.000Z"
            },
            "refund": {
              "amount": 40.0,
              "amount_label": "$40.00",
              "full": true,
              "by": "jane@example.com"
            }
          }
        }
      }
    },
    {
      "type": "payment.paid",
      "group": "Bookings",
      "when": "A payment request or a package purchase was paid online.",
      "data": {
        "type": "object",
        "required": [
          "payment"
        ],
        "properties": {
          "payment": {
            "$ref": "#/components/schemas/Payment"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "samples": {
        "request": {
          "id": "evt_Pay3k9m2Lw8Rt5Yp1Zs03",
          "type": "payment.paid",
          "created": "2026-11-11T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "payment": {
              "id": 15,
              "kind": "request",
              "status": "paid",
              "provider": "stripe",
              "amount": 40.0,
              "amount_label": "$40.00",
              "full_label": "$40.00",
              "discount_label": "",
              "coupon_code": "",
              "currency": "USD",
              "refunded": 0.0,
              "refunded_label": "",
              "description": "Deposit for your colour",
              "contact": "61412345678",
              "payer_name": "John Smith",
              "appointment_id": null,
              "booking_reference": "",
              "package_purchase_id": null,
              "checkout_url": "",
              "link_url": "",
              "last_error": "",
              "paid": "2026-11-11T01:15:00.000Z",
              "refunded_at": null,
              "created": "2026-11-11T01:10:00.000Z"
            },
            "timestamp": "2026-11-11T01:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "package.purchased",
      "group": "Bookings",
      "when": "A prepaid package was bought online (paid) or given to a customer (granted).",
      "data": {
        "type": "object",
        "required": [
          "purchase"
        ],
        "properties": {
          "purchase": {
            "$ref": "#/components/schemas/PackagePurchase"
          },
          "payment": {
            "$ref": "#/components/schemas/Payment",
            "nullable": true
          },
          "granted": {
            "type": "boolean",
            "description": "true: given without a payment."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "samples": {
        "granted": {
          "id": "evt_Pay3k9m2Lw8Rt5Yp1Zs04",
          "type": "package.purchased",
          "created": "2026-11-11T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "purchase": {
              "id": 5,
              "contact": "61412345678",
              "contact_name": "John Smith",
              "package_id": "ten-pack",
              "package_name": "10 sessions",
              "services": [],
              "sessions_total": 10,
              "sessions_used": 2,
              "sessions_left": 8,
              "expires": "2027-11-11T01:15:00.000Z",
              "status": "active",
              "payment_id": 17,
              "created": "2026-11-11T01:15:00.000Z"
            },
            "payment": null,
            "granted": true,
            "timestamp": "2026-11-11T01:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "poll.voted",
      "group": "Bookings",
      "when": "Someone voted (or changed their vote) on a meeting poll.",
      "data": {
        "type": "object",
        "required": [
          "poll_id",
          "name",
          "choices"
        ],
        "properties": {
          "poll_id": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "contact": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "choices": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The option ids they can attend."
          },
          "comment": {
            "type": "string",
            "nullable": true
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "samples": {
        "vote": {
          "id": "evt_Pay3k9m2Lw8Rt5Yp1Zs05",
          "type": "poll.voted",
          "created": "2026-11-11T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "poll_id": 12,
            "title": "Team planning",
            "name": "Sam",
            "contact": "61412345678",
            "email": null,
            "choices": [
              "a",
              "c"
            ],
            "comment": "Mornings suit me best.",
            "timestamp": "2026-11-11T01:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "poll.closed",
      "group": "Bookings",
      "when": "A meeting poll was closed, or its winning time was booked (status booked, with chosen_option).",
      "data": {
        "type": "object",
        "required": [
          "poll_id",
          "status"
        ],
        "properties": {
          "poll_id": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "closed",
              "booked"
            ]
          },
          "chosen_option": {
            "type": "string"
          },
          "appointment_id": {
            "type": "integer",
            "nullable": true
          },
          "by": {
            "type": "string"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "samples": {
        "booked": {
          "id": "evt_Pay3k9m2Lw8Rt5Yp1Zs06",
          "type": "poll.closed",
          "created": "2026-11-11T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "poll_id": 12,
            "title": "Team planning",
            "status": "booked",
            "chosen_option": "c",
            "appointment_id": null,
            "by": "jane@example.com",
            "timestamp": "2026-11-11T01:00:00.000Z"
          }
        }
      }
    },
    {
      "type": "booking.customer.erased",
      "group": "Bookings",
      "when": "A customer's booking data was erased on request (DELETE /bookings/customers/{contact}, the calendar app, or the contact delete with booking_data=erase).",
      "data": {
        "type": "object",
        "required": [
          "contact",
          "counts"
        ],
        "properties": {
          "contact": {
            "type": "string"
          },
          "counts": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "samples": {
        "erase": {
          "id": "evt_Pay3k9m2Lw8Rt5Yp1Zs07",
          "type": "booking.customer.erased",
          "created": "2026-11-11T01:00:00.000Z",
          "number": "4976659348270",
          "data": {
            "contact": "61412345678",
            "counts": {
              "appointments": 4,
              "cancelled": 1,
              "notes": 2,
              "links": 1,
              "holds": 0,
              "votes": 0,
              "packages": 0,
              "payments": 1
            },
            "timestamp": "2026-11-11T01:00:00.000Z"
          }
        }
      }
    }
  ],
  "x-a2e-forwarded-families": [
    "/v1/account",
    "/v1/partner",
    "/mcp/manage"
  ],
  "x-a2e-error-codes": [
    {
      "code": "invalid_number_in_url",
      "status": 400,
      "meaning": "The URL must contain the full WhatsApp number you send from, digits only (country code first). Got: '…'.",
      "how_to_fix": "Use your app2email WhatsApp number without '+', spaces or dashes, eg: https://api.app2email.com/v1/61412345678/messages"
    },
    {
      "code": "invalid_json",
      "status": 400,
      "meaning": "The request body is not valid JSON, or not a JSON object.",
      "how_to_fix": "Check for missing quotes, commas or brackets near the position given (LineNumber / BytePositionInLine). A JSON validator helps."
    },
    {
      "code": "unsupported_message_type",
      "status": 400,
      "meaning": "\"type\" is not a message type this API sends.",
      "how_to_fix": "Use \"template\" to start a conversation. Within 24 hours of the contact's last message other types work too: https://www.app2email.com/docs/api/message-types"
    },
    {
      "code": "invalid_to",
      "status": 400,
      "meaning": "\"to\" is not a phone number (or a business-scoped user id).",
      "how_to_fix": "Give the number with its country code, digits only, eg \"to\": \"61412345678\". Several numbers: \"61412345678,61498765432\"."
    },
    {
      "code": "too_many_recipients",
      "status": 400,
      "meaning": "The request has more numbers than this WhatsApp number may send to in one request. Nothing was sent.",
      "how_to_fix": "Split the numbers over several requests. details.max_recipients is the limit; it goes up after messages are delivered."
    },
    {
      "code": "missing_template_name",
      "status": 400,
      "meaning": "\"template.name\" is required.",
      "how_to_fix": "Use the exact name of an approved template. GET https://api.app2email.com/v1/…/templates lists them, with an example request for each."
    },
    {
      "code": "missing_template_language",
      "status": 400,
      "meaning": "Template '…' exists in several languages, so \"template.language.code\" is required.",
      "how_to_fix": "Add \"language\": {\"code\": \"<one of the languages in details>\"}."
    },
    {
      "code": "invalid_components",
      "status": 400,
      "meaning": "\"template.components\" must be an array.",
      "how_to_fix": "See example_request."
    },
    {
      "code": "to_and_recipients",
      "status": 400,
      "meaning": "The request has both \"to\" and \"recipients\". Use one of them.",
      "how_to_fix": "Use \"to\" when every number gets the same values, or \"recipients\": [{\"to\": \"61412345678\", \"components\": [...]},...] when each number has its own values."
    },
    {
      "code": "invalid_recipients",
      "status": 400,
      "meaning": "\"recipients\" must be a list with at least one entry.",
      "how_to_fix": "\"recipients\" is a list of objects, one per number: [{\"to\": \"61412345678\", \"components\": [{\"type\": \"body\", \"parameters\": [{\"type\": \"text\", \"text\": \"John\"}]}]},...]. \"components\" holds only what differs for that number; the rest comes from template.components."
    },
    {
      "code": "duplicate_recipients",
      "status": 400,
      "meaning": "Some numbers are in \"recipients\" more than once, listed in details.duplicates. Nothing was sent.",
      "how_to_fix": "List each number once. (With \"recipients\" each number can have its own values, so we do not guess which entry you meant.)"
    },
    {
      "code": "invalid_idempotency_key",
      "status": 400,
      "meaning": "The Idempotency-Key header must be 1 to … printable ASCII characters.",
      "how_to_fix": "Use a new random value (eg a UUID) for each message or list you send, and send the same value again only when you retry that same request."
    },
    {
      "code": "missing_message_id",
      "status": 400,
      "meaning": "\"message_id\" must be the message_id of a message the contact sent (it starts with 'wamid.').",
      "how_to_fix": "Use the message_id of a message.received event or GET /messages?direction=in."
    },
    {
      "code": "invalid_number",
      "status": 400,
      "meaning": "A number is not a full phone number.",
      "how_to_fix": "Give the number with its country code, digits only, eg 61412345678."
    },
    {
      "code": "missing_numbers",
      "status": 400,
      "meaning": "The request has no \"numbers\" (or \"number\").",
      "how_to_fix": "Send {\"numbers\": [\"61412345678\", \"61498765432\"]}, or entries with a name and note: {\"numbers\": [{\"number\": \"61412345678\", \"name\": \"John\", \"note\": \"unsubscribed in our CRM\"}]}."
    },
    {
      "code": "too_many_numbers",
      "status": 400,
      "meaning": "… contacts in one request. The most is ….",
      "how_to_fix": "Split them over several requests, or use POST /contacts/import (up to 5000)."
    },
    {
      "code": "invalid_numbers",
      "status": 400,
      "meaning": "… of the numbers are not valid, listed in details.invalid. Nothing was added.",
      "how_to_fix": "Write each number with its country code, digits only, eg 61412345678 for +61 412 345 678."
    },
    {
      "code": "missing_url",
      "status": 400,
      "meaning": "\"link\" is missing: the public link of the photo.",
      "how_to_fix": "Send {\"data\": [{\"event_name\": \"Purchase\", \"user_data\": {\"ctwa_clid\": \"ARAkLkA8rmlFeiCktEJQ-QTwRiyYHAFDLMNDBH0CD3qpjd0HR4irJ6LEkR7JwFF4XvnO2E4Nx0-eM-GABDLOPaOdRMv-_zfUQ2a\"}, \"custom_data\": {\"currency\": \"AUD\", \"value\": 49.90}}]}. JPG or PNG, up to 5 MB."
    },
    {
      "code": "invalid_events",
      "status": 400,
      "meaning": "Unknown event type '…'.",
      "how_to_fix": "Use one of: …."
    },
    {
      "code": "too_many_webhooks",
      "status": 400,
      "meaning": "This number already has … webhooks, the most allowed.",
      "how_to_fix": "Delete one you no longer use: DELETE https://api.app2email.com/v1/…/webhooks/<id>."
    },
    {
      "code": "invalid_template_name",
      "status": 400,
      "meaning": "\"names\" must be template names: lower case letters, digits and underscores.",
      "how_to_fix": "eg \"order_update\"."
    },
    {
      "code": "invalid_template_language",
      "status": 400,
      "meaning": "?language= must be a WhatsApp language code like en or en_US.",
      "how_to_fix": "See WhatsApp's list of supported template languages."
    },
    {
      "code": "invalid_template_category",
      "status": 400,
      "meaning": "\"category\" must be one of: ….",
      "how_to_fix": "UTILITY for order and account updates, MARKETING for promotions, AUTHENTICATION for one-time codes. WhatsApp may change the category if it disagrees."
    },
    {
      "code": "invalid_template_components",
      "status": 400,
      "meaning": "\"components\" must be a list of objects that each have a \"type\" (HEADER, BODY, FOOTER, BUTTONS).",
      "how_to_fix": "See example_request. Components are in WhatsApp's own format. A Template Library template takes library_template_name instead."
    },
    {
      "code": "invalid_reply_to",
      "status": 400,
      "meaning": "\"reply_to\" must be the message_id of one of the contact's messages (it starts with 'wamid.').",
      "how_to_fix": "{\"text\": \"...\"} or {\"media\": {\"data\": \"<base64>\", \"filename\": \"photo.jpg\", \"mime\": \"image/jpeg\"}, \"text\": \"caption\"} or {\"template\": {\"name\": \"...\", \"language\": \"en\", \"body_params\": [\"...\"]}}, each with \"sender\": {\"name\", \"email\"}."
    },
    {
      "code": "free_form_single_recipient",
      "status": 400,
      "meaning": "A \"…\" message goes to one number. \"recipients\", \"background\" and \"send_at\" are for template messages.",
      "how_to_fix": "Send one request per contact, or use a template to message many numbers."
    },
    {
      "code": "missing_text",
      "status": 400,
      "meaning": "\"text.body\" is required for a text message.",
      "how_to_fix": "Send {\"type\": \"text\", \"text\": {\"body\": \"Your message\"}}."
    },
    {
      "code": "invalid_text",
      "status": 400,
      "meaning": "\"text\" must be 1 to … characters.",
      "how_to_fix": "Send {\"text\": \"Thanks for writing! We reply within a day.\"} (1 to 4000 characters)."
    },
    {
      "code": "invalid_send_at",
      "status": 400,
      "meaning": "\"send_at\" is not a valid time with a time zone: '…'.",
      "how_to_fix": "Use an ISO 8601 time with its time zone, eg \"2026-11-02T09:00:00+11:00\" or \"2026-11-02T09:00:00Z\", between 1 minute and 29 days from now."
    },
    {
      "code": "send_at_in_past",
      "status": 400,
      "meaning": "\"send_at\" must be at least 1 minute from now (now is …).",
      "how_to_fix": "Use an ISO 8601 time with its time zone, eg \"2026-11-02T09:00:00+11:00\" or \"2026-11-02T09:00:00Z\", between 1 minute and 29 days from now. To send now, leave \"send_at\" out."
    },
    {
      "code": "send_at_too_far",
      "status": 400,
      "meaning": "\"send_at\" is more than 29 days from now.",
      "how_to_fix": "Use an ISO 8601 time with its time zone, eg \"2026-11-02T09:00:00+11:00\" or \"2026-11-02T09:00:00Z\", between 1 minute and 29 days from now."
    },
    {
      "code": "invalid_time",
      "status": 400,
      "meaning": "'from' is not a date or time.",
      "how_to_fix": "Use eg until=2026-11-06T00:00:00Z, or leave it out (now)."
    },
    {
      "code": "invalid_limit",
      "status": 400,
      "meaning": "'limit' must be a whole number from 1 to 100.",
      "how_to_fix": "Use limit=1 to limit=100."
    },
    {
      "code": "invalid_cursor",
      "status": 400,
      "meaning": "The cursor is not valid.",
      "how_to_fix": "Pass the next_cursor of the previous answer unchanged, or leave cursor out for the first page."
    },
    {
      "code": "invalid_direction",
      "status": 400,
      "meaning": "'direction' must be in, out or left out. Got: '…'.",
      "how_to_fix": "Use direction=in for messages received, direction=out for messages sent, or leave it out for both."
    },
    {
      "code": "invalid_status",
      "status": 400,
      "meaning": "\"status\" must be pending or all.",
      "how_to_fix": "Example: GET.../approvals?status=all"
    },
    {
      "code": "invalid_phone",
      "status": 400,
      "meaning": "The contact in the URL is not a phone number or a business-scoped user id.",
      "how_to_fix": "Use the contact's full number, country code first (eg .../contacts/61412345678), or their business-scoped user id."
    },
    {
      "code": "invalid_range",
      "status": 400,
      "meaning": "'since' must be before 'until' (and before now).",
      "how_to_fix": "Use eg since=2026-10-01T00:00:00Z&until=2026-11-01T00:00:00Z."
    },
    {
      "code": "range_too_large",
      "status": 400,
      "meaning": "WhatsApp keeps analytics for 1 year: 'since' is further back.",
      "how_to_fix": "Use a 'since' within the last 365 days."
    },
    {
      "code": "invalid_months",
      "status": 400,
      "meaning": "'months' must be a whole number from 1 to …. Got: '…'.",
      "how_to_fix": "Use months=1 to months=…. The default is …."
    },
    {
      "code": "invalid_media_type",
      "status": 400,
      "meaning": "\"type\" must be image, video, document, audio or sticker.",
      "how_to_fix": "Or leave it out: the kind is taken from the file."
    },
    {
      "code": "missing_file",
      "status": 400,
      "meaning": "The form has no file (field \"file\").",
      "how_to_fix": "Send the file in the form field \"file\", eg curl -F 'file=@photo.jpg;type=image/jpeg'."
    },
    {
      "code": "missing_media",
      "status": 400,
      "meaning": "\"media.data\" (the file as base64) is empty.",
      "how_to_fix": "{\"text\": \"...\"} or {\"media\": {\"data\": \"<base64>\", \"filename\": \"photo.jpg\", \"mime\": \"image/jpeg\"}, \"text\": \"caption\"} or {\"template\": {\"name\": \"...\", \"language\": \"en\", \"body_params\": [\"...\"]}}, each with \"sender\": {\"name\", \"email\"}."
    },
    {
      "code": "nothing_to_change",
      "status": 400,
      "meaning": "The request has neither \"enabled\" nor \"config\".",
      "how_to_fix": "Send the fields you want to change; the others stay as they are."
    },
    {
      "code": "invalid_setting",
      "status": 400,
      "meaning": "'name' is over 200 characters.",
      "how_to_fix": "Use a shorter name, or leave it out."
    },
    {
      "code": "segment_and_recipients",
      "status": 400,
      "meaning": "The request has \"segment\" together with \"to\", \"recipient\" or \"recipients\". Use one of them.",
      "how_to_fix": "\"segment\": \"<segment id or name>\" sends to the segment's contacts; leave \"to\" and \"recipients\" out."
    },
    {
      "code": "segment_empty",
      "status": 400,
      "meaning": "The segment '…' has no contacts, so there is nothing to send.",
      "how_to_fix": "GET /v1/…/segments/…/contacts shows what it matches. Add contacts (POST /contacts) or change the filter."
    },
    {
      "code": "invalid_owner",
      "status": 400,
      "meaning": "\"owner\" must be one of: \"\" (normal routing), agent, human, paused. Got: '…'.",
      "how_to_fix": "Send {\"owner\": \"human\", \"reason\": \"customer asked for a person\", \"summary\": \"wants to change the delivery date\", \"until_minutes\": 120}. owner: \"\" (normal routing), agent, human or paused. The other fields are optional."
    },
    {
      "code": "invalid_contacts",
      "status": 400,
      "meaning": "Nothing to change: give \"tags\".",
      "how_to_fix": "Send one contact {\"phone\": \"61412345678\", \"name\": \"John\", \"tags\": [\"vip\"], \"custom_fields\": {\"order_id\": \"1234\"}, \"consent\": {\"marketing\": true, \"source\": \"web form\"}} or a list of them (up to 1000)."
    },
    {
      "code": "invalid_segment",
      "status": 400,
      "meaning": "\"name\" must be 1 to 100 characters and not just a number.",
      "how_to_fix": "Send {\"name\": \"VIP, consented\", \"filter\": {\"tags_any\": [\"vip\"], \"consent_marketing\": true, \"last_inbound_days\": 90}}."
    },
    {
      "code": "invalid_csv",
      "status": 400,
      "meaning": "The CSV needs a header row and at least one contact row.",
      "how_to_fix": "Send text/csv with a header row (phone,name,tags,consent_marketing,consent_source,consent_text,consent_evidence,consent_at,source and any custom field columns; tags separated by |), or application/json with a list of contacts as for POST /contacts. Up to 5000 rows."
    },
    {
      "code": "too_many_segments",
      "status": 400,
      "meaning": "This number already has … segments, the most allowed.",
      "how_to_fix": "Delete one you no longer use."
    },
    {
      "code": "missing_interactive",
      "status": 400,
      "meaning": "\"interactive\" is required for an interactive message.",
      "how_to_fix": "Send {\"type\": \"interactive\", \"interactive\": {\"type\": \"button\" | \"list\" | \"cta_url\", \"body\": {\"text\": \"...\"}, \"action\": {...}}}."
    },
    {
      "code": "invalid_interactive",
      "status": 400,
      "meaning": "\"interactive\" is not valid: its type, a text length, the buttons or the rows.",
      "how_to_fix": "button: up to 3 reply buttons. list: a menu of up to 10 rows. cta_url: one button that opens a URL. carousel: 2 to 10 cards."
    },
    {
      "code": "invalid_test_event",
      "status": 400,
      "meaning": "\"event\" must be a JSON object.",
      "how_to_fix": "Send nothing for a ping, {\"type\": \"message.received\"} for that event's sample (GET.../webhooks/samples), or {\"event\": {\"type\": \"message.received\", \"data\": {...}}} to send your own."
    },
    {
      "code": "invalid_keep_old_for_hours",
      "status": 400,
      "meaning": "\"keep_old_for_hours\" must be a whole number from 0 to ….",
      "how_to_fix": "0 (or leave it out): the old secret stops at once. 24: events are signed with both secrets for 24 hours."
    },
    {
      "code": "invalid_contact_email",
      "status": 400,
      "meaning": "The e-mail address is missing or not an e-mail address.",
      "how_to_fix": "Send eg \"contact_email\": \"ann@example.com\"."
    },
    {
      "code": "invalid_plan",
      "status": 400,
      "meaning": "\"plan\" is missing or not a plan that can be chosen, or \"yearly\" is not true or false.",
      "how_to_fix": "Use a plan id from list_plans (GET /v1/account/plans), eg \"standard_5000\"."
    },
    {
      "code": "invalid_key_request",
      "status": 400,
      "meaning": "A field of the key request is not valid: name (1 to 60 characters), scopes, sandbox or expiry (1 to 365 days).",
      "how_to_fix": "details lists the permissions there are."
    },
    {
      "code": "invalid_analytics_query",
      "status": 400,
      "meaning": "'granularity' must be half_hour, day or month.",
      "how_to_fix": "Use eg granularity=day."
    },
    {
      "code": "invalid_conversion_events",
      "status": 400,
      "meaning": "Nothing was sent: ….",
      "how_to_fix": "Send eg {\"data\": [{\"event_name\": \"Purchase\", \"user_data\": {\"ctwa_clid\": \"ARAkLkA8rmlFeiCktEJQ-QTwRiyYHAFDLMNDBH0CD3qpjd0HR4irJ6LEkR7JwFF4XvnO2E4Nx0-eM-GABDLOPaOdRMv-_zfUQ2a\"}, \"custom_data\": {\"currency\": \"AUD\", \"value\": 49.90}}]}."
    },
    {
      "code": "invalid_booking",
      "status": 400,
      "meaning": "Give the Flow a name.",
      "how_to_fix": "{ action: create | duplicate | delete | set_default | update, key, name?, kind?, from?, trigger_keywords?, enabled? }"
    },
    {
      "code": "invalid_service",
      "status": 400,
      "meaning": "\"service_id\" is missing.",
      "how_to_fix": "Use one of the ids in details.services."
    },
    {
      "code": "invalid_start",
      "status": 400,
      "meaning": "\"start\" is missing.",
      "how_to_fix": "start is yyyy-MM-ddTHH:mm in the business time zone, one of the slot ids of GET.../bookings/availability."
    },
    {
      "code": "invalid_block",
      "status": 400,
      "meaning": "A time block is not valid: the end is not after the start, it is longer than 31 days, the staff member does not exist, or a text is too long.",
      "how_to_fix": "Fix the fields named in the message. Give start and end (or date for a whole day); provider_id is one of GET /bookings/staff, or left out for everyone."
    },
    {
      "code": "invalid_note",
      "status": 400,
      "meaning": "A note is not valid: it is empty or over 4000 characters, or it has neither a contact nor a booking_id.",
      "how_to_fix": "Send a body of 1 to 4000 characters and a contact or a booking_id."
    },
    {
      "code": "invalid_link",
      "status": 400,
      "meaning": "A booking link cannot be made or changed like that: an unknown purpose, service or staff member, a reschedule or manage link without a customer, expires_in_hours outside 1 to 1440, or a public address revoked as a link.",
      "how_to_fix": "Fix the fields named in the message."
    },
    {
      "code": "invalid_slug",
      "status": 400,
      "meaning": "The public address (slug) is not valid: 3 to 40 characters of a-z, 0-9 and '-', not a reserved word.",
      "how_to_fix": "Choose another address."
    },
    {
      "code": "invalid_call_settings",
      "status": 400,
      "meaning": "'calling' must be an object.",
      "how_to_fix": "Send eg {\"data\": [{\"event_name\": \"Purchase\", \"user_data\": {\"ctwa_clid\": \"ARAkLkA8rmlFeiCktEJQ-QTwRiyYHAFDLMNDBH0CD3qpjd0HR4irJ6LEkR7JwFF4XvnO2E4Nx0-eM-GABDLOPaOdRMv-_zfUQ2a\"}, \"custom_data\": {\"currency\": \"AUD\", \"value\": 49.90}}]}."
    },
    {
      "code": "invalid_call_request",
      "status": 400,
      "meaning": "Nothing was sent to WhatsApp: ….",
      "how_to_fix": "Send eg {\"data\": [{\"event_name\": \"Purchase\", \"user_data\": {\"ctwa_clid\": \"ARAkLkA8rmlFeiCktEJQ-QTwRiyYHAFDLMNDBH0CD3qpjd0HR4irJ6LEkR7JwFF4XvnO2E4Nx0-eM-GABDLOPaOdRMv-_zfUQ2a\"}, \"custom_data\": {\"currency\": \"AUD\", \"value\": 49.90}}]}."
    },
    {
      "code": "invalid_flow_id",
      "status": 400,
      "meaning": "A flow id is a number, eg 1234567890123456. Got: '…'.",
      "how_to_fix": "GET /v1/…/flows lists them."
    },
    {
      "code": "invalid_flow_name",
      "status": 400,
      "meaning": "\"name\" must be 1 to 200 characters (customers do not see it).",
      "how_to_fix": "eg \"appointment_booking\"."
    },
    {
      "code": "invalid_flow_categories",
      "status": 400,
      "meaning": "\"categories\" must be a list with at least one of: ….",
      "how_to_fix": "eg [\"APPOINTMENT_BOOKING\"]."
    },
    {
      "code": "invalid_flow_json",
      "status": 400,
      "meaning": "\"flow_json\" ….",
      "how_to_fix": "See example_request and WhatsApp's Flow JSON reference."
    },
    {
      "code": "invalid_flow_field",
      "status": 400,
      "meaning": "\"publish\" must be true or false.",
      "how_to_fix": "Fields: name, categories, flow_json, publish, endpoint_uri, clone_flow_id."
    },
    {
      "code": "invalid_public_key",
      "status": 400,
      "meaning": "\"public_key\" is missing.",
      "how_to_fix": "Make a key pair: openssl genrsa -out private.pem 2048; openssl rsa -in private.pem -pubout -out public.pem. Send the text of public.pem as {\"public_key\": \"-----BEGIN PUBLIC KEY-----\\n...\"}."
    },
    {
      "code": "invalid_media_id",
      "status": 400,
      "meaning": "'…' is not a WhatsApp media id (digits, eg the media_id of POST /media).",
      "how_to_fix": "app2email's stored copies of received files are not deleted through this call."
    },
    {
      "code": "invalid_location",
      "status": 400,
      "meaning": "\"location\" is required: {\"latitude\":.., \"longitude\":.., \"name\"?, \"address\"?}.",
      "how_to_fix": "See example_request."
    },
    {
      "code": "invalid_contacts_message",
      "status": 400,
      "meaning": "\"contacts\" must list 1 to … contact cards.",
      "how_to_fix": "Each card: {\"name\": {\"formatted_name\": \"Jane Citizen\"}, \"phones\": [{\"phone\": \"+61 412 345 678\", \"type\": \"CELL\"}]}."
    },
    {
      "code": "invalid_reaction",
      "status": 400,
      "meaning": "\"reaction\" is required: {\"message_id\": \"wamid...\", \"emoji\": \"...\"}.",
      "how_to_fix": "See example_request."
    },
    {
      "code": "invalid_callback_data",
      "status": 400,
      "meaning": "\"callback_data\" is … characters. WhatsApp allows up to ….",
      "how_to_fix": "Send a short reference (eg your order id) and keep the rest on your side."
    },
    {
      "code": "caption_not_supported",
      "status": 400,
      "meaning": "WhatsApp does not show a caption on an audio message.",
      "how_to_fix": "Leave \"caption\" out, or send the text as its own message."
    },
    {
      "code": "invalid_marketing_api",
      "status": 400,
      "meaning": "\"marketing_api\" must be \"auto\", \"cloud_api\" or \"mm_api\" (or true / false).",
      "how_to_fix": "Leave it out to use the number's setting messages.marketing_route (GET /settings/number)."
    },
    {
      "code": "invalid_users",
      "status": 400,
      "meaning": "\"users\" is missing, empty, too long, or has an entry that is not a phone number or a business-scoped user id.",
      "how_to_fix": "eg {\"users\": [\"61412345678\"]} - numbers with their country code, digits only, or business-scoped user ids."
    },
    {
      "code": "invalid_bsuid",
      "status": 400,
      "meaning": "'…' is not a business-scoped user id (country code, a dot, letters and digits, eg US.13491208655302741918). Parent ids (with.ENT.) are not in the contact book.",
      "how_to_fix": "Use from_user_id of a message.received event."
    },
    {
      "code": "invalid_identity_key_hash",
      "status": 400,
      "meaning": "\"recipient_identity_key_hash\" is one contact's: the request has … recipients.",
      "how_to_fix": "Send it with one recipient, or per number in \"recipients\": [{\"to\": \"61412345678\", \"recipient_identity_key_hash\": \"...\"}]."
    },
    {
      "code": "invalid_profile",
      "status": 400,
      "meaning": "The profile was not changed: ….",
      "how_to_fix": "Send only the fields to change, eg {\"data\": [{\"event_name\": \"Purchase\", \"user_data\": {\"ctwa_clid\": \"ARAkLkA8rmlFeiCktEJQ-QTwRiyYHAFDLMNDBH0CD3qpjd0HR4irJ6LEkR7JwFF4XvnO2E4Nx0-eM-GABDLOPaOdRMv-_zfUQ2a\"}, \"custom_data\": {\"currency\": \"AUD\", \"value\": 49.90}}]}."
    },
    {
      "code": "invalid_display_name",
      "status": 400,
      "meaning": "\"name\" must be 3 to 512 characters on one line.",
      "how_to_fix": "Send {\"data\": [{\"event_name\": \"Purchase\", \"user_data\": {\"ctwa_clid\": \"ARAkLkA8rmlFeiCktEJQ-QTwRiyYHAFDLMNDBH0CD3qpjd0HR4irJ6LEkR7JwFF4XvnO2E4Nx0-eM-GABDLOPaOdRMv-_zfUQ2a\"}, \"custom_data\": {\"currency\": \"AUD\", \"value\": 49.90}}]}. Meta's display name guidelines: https://www.facebook.com/business/help/757569725593362"
    },
    {
      "code": "invalid_oba_request",
      "status": 400,
      "meaning": "The request was not sent: ….",
      "how_to_fix": "Send eg {\"data\": [{\"event_name\": \"Purchase\", \"user_data\": {\"ctwa_clid\": \"ARAkLkA8rmlFeiCktEJQ-QTwRiyYHAFDLMNDBH0CD3qpjd0HR4irJ6LEkR7JwFF4XvnO2E4Nx0-eM-GABDLOPaOdRMv-_zfUQ2a\"}, \"custom_data\": {\"currency\": \"AUD\", \"value\": 49.90}}]}."
    },
    {
      "code": "invalid_compliance_info",
      "status": 400,
      "meaning": "Nothing was changed: ….",
      "how_to_fix": "Send eg {\"data\": [{\"event_name\": \"Purchase\", \"user_data\": {\"ctwa_clid\": \"ARAkLkA8rmlFeiCktEJQ-QTwRiyYHAFDLMNDBH0CD3qpjd0HR4irJ6LEkR7JwFF4XvnO2E4Nx0-eM-GABDLOPaOdRMv-_zfUQ2a\"}, \"custom_data\": {\"currency\": \"AUD\", \"value\": 49.90}}]}."
    },
    {
      "code": "invalid_username",
      "status": 400,
      "meaning": "'transfer_action' must be none or force_transfer.",
      "how_to_fix": "Send eg {\"data\": [{\"event_name\": \"Purchase\", \"user_data\": {\"ctwa_clid\": \"ARAkLkA8rmlFeiCktEJQ-QTwRiyYHAFDLMNDBH0CD3qpjd0HR4irJ6LEkR7JwFF4XvnO2E4Nx0-eM-GABDLOPaOdRMv-_zfUQ2a\"}, \"custom_data\": {\"currency\": \"AUD\", \"value\": 49.90}}]}."
    },
    {
      "code": "invalid_conversation_starters",
      "status": 400,
      "meaning": "Nothing was changed: ….",
      "how_to_fix": "Send eg {\"data\": [{\"event_name\": \"Purchase\", \"user_data\": {\"ctwa_clid\": \"ARAkLkA8rmlFeiCktEJQ-QTwRiyYHAFDLMNDBH0CD3qpjd0HR4irJ6LEkR7JwFF4XvnO2E4Nx0-eM-GABDLOPaOdRMv-_zfUQ2a\"}, \"custom_data\": {\"currency\": \"AUD\", \"value\": 49.90}}]}."
    },
    {
      "code": "invalid_qr_code",
      "status": 400,
      "meaning": "No QR code was made: 'image' must be svg or png.",
      "how_to_fix": "Send eg {\"data\": [{\"event_name\": \"Purchase\", \"user_data\": {\"ctwa_clid\": \"ARAkLkA8rmlFeiCktEJQ-QTwRiyYHAFDLMNDBH0CD3qpjd0HR4irJ6LEkR7JwFF4XvnO2E4Nx0-eM-GABDLOPaOdRMv-_zfUQ2a\"}, \"custom_data\": {\"currency\": \"AUD\", \"value\": 49.90}}]}."
    },
    {
      "code": "invalid_catalog_id",
      "status": 400,
      "meaning": "'catalog_id' must be the catalog's id from Commerce Manager (digits).",
      "how_to_fix": "Send eg {\"data\": [{\"event_name\": \"Purchase\", \"user_data\": {\"ctwa_clid\": \"ARAkLkA8rmlFeiCktEJQ-QTwRiyYHAFDLMNDBH0CD3qpjd0HR4irJ6LEkR7JwFF4XvnO2E4Nx0-eM-GABDLOPaOdRMv-_zfUQ2a\"}, \"custom_data\": {\"currency\": \"AUD\", \"value\": 49.90}}]}."
    },
    {
      "code": "invalid_client_request",
      "status": 400,
      "meaning": "A field of the client request is not valid (eg \"name\" or \"send_invite\").",
      "how_to_fix": "Example: {\"email\": \"ann@example.com\", \"name\": \"Ann's Bakery\"}."
    },
    {
      "code": "invalid_onboarding_request",
      "status": 400,
      "meaning": "A field of the onboarding link request is not valid (eg \"state\" over 200 characters).",
      "how_to_fix": "\"state\" comes back unchanged in the redirect, eg \"crm-lead-4711\"."
    },
    {
      "code": "invalid_redirect_url",
      "status": 400,
      "meaning": "\"redirect_url\" is not a full https:// address of at most 500 characters.",
      "how_to_fix": "Example: \"https://crm.example.com/whatsapp/connected\"; null removes it."
    },
    {
      "code": "invalid_partner_settings",
      "status": 400,
      "meaning": "A partner setting is not valid (eg \"trial\").",
      "how_to_fix": "A trial has 10 to 10000000 messages and lasts 1 to 365 days: {\"trial\": {\"enabled\": true, \"messages\": 50, \"days\": 14}}."
    },
    {
      "code": "invalid_payment",
      "status": 400,
      "meaning": "A payment request is not valid: the amount is missing or not above 0, a session count is out of range, or a booking has no amount to mark as due.",
      "how_to_fix": "Fix the field named in the message."
    },
    {
      "code": "invalid_coupon",
      "status": 400,
      "meaning": "The coupon cannot be used: unknown, for another service, expired, used up or switched off.",
      "how_to_fix": "Check the code in config.payments.coupons, or leave coupon out."
    },
    {
      "code": "invalid_poll",
      "status": 400,
      "meaning": "A meeting poll is not valid: no title, fewer than 2 or more than 10 options, an option that is not a time, no service or length, or a vote on a closed poll.",
      "how_to_fix": "Fix the field named in the message."
    },
    {
      "code": "template_language_required",
      "status": 400,
      "meaning": "The template '…' has … languages: say which one with ?language=.",
      "how_to_fix": "Add ?language=… (one of: …)."
    },
    {
      "code": "invalid_template_field",
      "status": 400,
      "meaning": "These fields cannot be changed: ….",
      "how_to_fix": "Send it as WhatsApp's template API takes it, or leave it out."
    },
    {
      "code": "invalid_optimization_spec",
      "status": 400,
      "meaning": "\"optimization_spec\" ….",
      "how_to_fix": "Max price per 1,000 deliveries: {\"bid_amount\": 5000, \"bid_strategy\": \"LOWEST_COST_WITH_BID_CAP\"} (5000 = USD 0.05 a message in cents x 1,000). Both null to go back to the rate card."
    },
    {
      "code": "invalid_template_ids",
      "status": 400,
      "meaning": "Give \"names\" (template names: every language of each) or \"ids\" (WhatsApp template ids: one language each), not both.",
      "how_to_fix": "eg {\"names\": [\"old_promo\", \"summer_sale\"]}."
    },
    {
      "code": "too_many_templates",
      "status": 400,
      "meaning": "That is … templates; WhatsApp reports at most 10 template languages in one request.",
      "how_to_fix": "Split the list."
    },
    {
      "code": "invalid_compare_days",
      "status": 400,
      "meaning": "?days= must be 7, 30, 60 or 90.",
      "how_to_fix": "Leave it out for 30."
    },
    {
      "code": "invalid_auth_template",
      "status": 400,
      "meaning": "The authentication template request is not valid: its languages, otp_type or components.",
      "how_to_fix": "See example_request: languages and an otp_type, or WhatsApp's own components."
    },
    {
      "code": "invalid_template_preview",
      "status": 400,
      "meaning": "?languages= must be up to 60 WhatsApp language codes, comma separated (eg en_US,es_ES).",
      "how_to_fix": "Leave it out for every language."
    },
    {
      "code": "invalid_library_filter",
      "status": 400,
      "meaning": "?…= is longer than 200 characters.",
      "how_to_fix": "Use a shorter value."
    },
    {
      "code": "template_insights_confirm_required",
      "status": 400,
      "meaning": "Switching template insights on cannot be undone, so the body must be {\"confirm\": true}.",
      "how_to_fix": "Meta then adds link tracking to URL buttons and collects anonymised data from the chats. It applies to every number on this WhatsApp Business Account. Send {\"confirm\": true} if the account owner agrees."
    },
    {
      "code": "invalid_insights_request",
      "status": 400,
      "meaning": "?templates= must name 1 to 10 templates, comma separated.",
      "how_to_fix": "eg ?templates=order_update,summer_sale."
    },
    {
      "code": "invalid_webhook_headers",
      "status": 400,
      "meaning": "The webhook's headers: ….",
      "how_to_fix": "Send up to 5 headers as {\"headers\": {\"Authorization\": \"Basic dXNlcjpwYXNz\"}}, values in printable ASCII. Not allowed: Host, User-Agent, Content-*, X-App2email-*, X-Hub-*, Proxy-*, X-Forwarded-* and connection headers. In PATCH a header set to null is removed."
    },
    {
      "code": "invalid_webhook_format",
      "status": 400,
      "meaning": "A … webhook gets app2email's event envelope only (\"format\": \"app2email\").",
      "how_to_fix": "\"format\" is \"app2email\" (app2email's event envelope, the default) or \"meta\" (the events that come from WhatsApp, as Meta's own webhook body)."
    },
    {
      "code": "invalid_webhook_secret",
      "status": 400,
      "meaning": "\"secret\" must be text of 1 to … characters.",
      "how_to_fix": "Leave it out to get a new random secret, or send your receiver's secret, eg \"whsec_...\"."
    },
    {
      "code": "too_many_catchers",
      "status": 400,
      "meaning": "This number has … catchers that have not expired, the most allowed.",
      "how_to_fix": "Use one of them (GET.../webhooks/catchers), or delete one: DELETE.../webhooks/catchers/…. They expire 1 hour after they were made."
    },
    {
      "code": "missing_api_key",
      "status": 401,
      "meaning": "No API key was sent.",
      "how_to_fix": "Send 'Authorization: Bearer YOUR_API_KEY'. Keys: https://www.app2email.com/dashboard/apikey"
    },
    {
      "code": "invalid_authorization_header",
      "status": 401,
      "meaning": "The Authorization header must be 'Bearer <your API key>'.",
      "how_to_fix": "Send 'Authorization: Bearer YOUR_API_KEY' with the whole key (it starts with 'a2e_')."
    },
    {
      "code": "invalid_api_key",
      "status": 401,
      "meaning": "The API key is not valid. It is incomplete, mistyped, or not an app2email key.",
      "how_to_fix": "Copy the whole key (it starts with 'a2e_' and contains a '.'). A key is only shown once, when it is created - if you no longer have it, create a new one on https://www.app2email.com/dashboard/apikey"
    },
    {
      "code": "api_key_revoked",
      "status": 401,
      "meaning": "This API key is no longer valid for +…. It was revoked, or a newer Default key has been created.",
      "how_to_fix": "Use a key that is listed on https://www.app2email.com/dashboard/apikey. Creating a new Default key replaces the previous Default key."
    },
    {
      "code": "api_key_expired",
      "status": 401,
      "meaning": "The API key '…' expired on ….",
      "how_to_fix": "Create a new key on https://www.app2email.com/dashboard/apikey."
    },
    {
      "code": "api_key_number_mismatch",
      "status": 403,
      "meaning": "This API key belongs to the WhatsApp number +…, but the URL is for +….",
      "how_to_fix": "Send to https://api.app2email.com/v1/…/messages, or use the API key created for +… (https://www.app2email.com/dashboard/apikey while that number is selected)."
    },
    {
      "code": "insufficient_scope",
      "status": 403,
      "meaning": "The API key does not have the permission this call needs (the message names it).",
      "how_to_fix": "Use a key with that permission, or create one on https://www.app2email.com/dashboard/apikey."
    },
    {
      "code": "ip_not_allowed",
      "status": 403,
      "meaning": "The API key '…' cannot be used from this address (…).",
      "how_to_fix": "Send the request from one of the key's allowed addresses, or change the key's address list on https://www.app2email.com/dashboard/apikey."
    },
    {
      "code": "plan_not_allowed",
      "status": 403,
      "meaning": "This number's plan does not include the API.",
      "how_to_fix": "Choose a plan that includes the API (Plan in the dashboard menu)."
    },
    {
      "code": "service_not_live",
      "status": 403,
      "meaning": "The number's service is not live (paused, cancelled or not paid), so nothing can be sent.",
      "how_to_fix": "Check the service status and the plan in the dashboard; a paused service goes live with 'Go Live' on the Settings page."
    },
    {
      "code": "recipient_opted_out",
      "status": 403,
      "meaning": "+… is on your Do Not Call list (they asked to stop promotions), so marketing templates are not sent to them.",
      "how_to_fix": "Do not send marketing messages to this person. Utility templates (eg order updates) can still be sent. To remove them from the list, see the Do Not Call list in your dashboard."
    },
    {
      "code": "recipient_not_opted_in",
      "status": 403,
      "meaning": "The contact has no opt-in record, and this number requires one for marketing templates.",
      "how_to_fix": "Record their consent first: POST /v1/{number}/optins. Utility templates can still be sent."
    },
    {
      "code": "template_name_reserved",
      "status": 403,
      "meaning": "A template app2email uses itself cannot be deleted here.",
      "how_to_fix": "Choose another name."
    },
    {
      "code": "whatsapp_payment_issue",
      "status": 403,
      "meaning": "WhatsApp (Meta) error 131042.",
      "how_to_fix": "Meta could not charge your WhatsApp account. Add or fix the payment method in Meta Business Suite -> WhatsApp Manager -> Payment settings."
    },
    {
      "code": "whatsapp_account_locked",
      "status": 403,
      "meaning": "WhatsApp (Meta) error 131031.",
      "how_to_fix": "Meta has locked your WhatsApp Business account. Check the account status in WhatsApp Manager."
    },
    {
      "code": "whatsapp_account_restricted",
      "status": 403,
      "meaning": "WhatsApp (Meta) error 368.",
      "how_to_fix": "Meta has temporarily restricted your number for policy reasons. Check WhatsApp Manager for details."
    },
    {
      "code": "sandbox_key",
      "status": 403,
      "meaning": "A sandbox key cannot …: it is for testing sends without sending.",
      "how_to_fix": "Use a normal key (one without the sandbox flag) from https://www.app2email.com/dashboard/apikey."
    },
    {
      "code": "recipient_stopped_marketing",
      "status": 403,
      "meaning": "WhatsApp (Meta) error 131050.",
      "how_to_fix": "The person has turned off marketing messages from you in WhatsApp. Do not send them marketing templates. Utility templates still work."
    },
    {
      "code": "messaging_limit_restricted",
      "status": 403,
      "meaning": "WhatsApp (Meta) error 131064.",
      "how_to_fix": "Meta lowered the number's messaging limit because templates had the wrong category. Check the template categories; the limit comes back after Meta's enforcement period."
    },
    {
      "code": "display_name_not_approved",
      "status": 403,
      "meaning": "WhatsApp (Meta) error 131037.",
      "how_to_fix": "The number cannot send until WhatsApp approves its display name. Check the display name in WhatsApp Manager."
    },
    {
      "code": "username_not_eligible",
      "status": 403,
      "meaning": "WhatsApp (Meta) error 147002.",
      "how_to_fix": "This number cannot have a username yet: WhatsApp requires a higher messaging limit."
    },
    {
      "code": "account_not_confirmed",
      "status": 403,
      "meaning": "The person has not confirmed the e-mail address yet.",
      "how_to_fix": "Ask them to open the link in the e-mail (get_account_status shows what is still needed)."
    },
    {
      "code": "account_deactivated",
      "status": 403,
      "meaning": "The login of this account is deactivated.",
      "how_to_fix": "Contact support@app2email.com."
    },
    {
      "code": "booking_not_enabled",
      "status": 403,
      "meaning": "Bookings are not set up for this number yet.",
      "how_to_fix": "Apply the booking database update (apply_261106_booking_as_admin.sh and apply_261106_booking_2_as_admin.sh), then try again."
    },
    {
      "code": "link_not_usable",
      "status": 403,
      "meaning": "A booking link is expired, revoked, used up, or the online booking page is switched off.",
      "how_to_fix": "Make a new link with POST /bookings/links, or switch the online booking page on."
    },
    {
      "code": "call_permission_required",
      "status": 403,
      "meaning": "WhatsApp (Meta) error 138006.",
      "how_to_fix": "The contact has not allowed calls from this number. Send a call permission request (an interactive call_permission_request message) first; GET /calls/permissions/… shows the state."
    },
    {
      "code": "flow_blocked_by_integrity",
      "status": 403,
      "meaning": "Meta blocks creating or publishing flows on this WhatsApp account (an integrity issue).",
      "how_to_fix": "Meta blocks creating or publishing flows on this WhatsApp account (an integrity issue). Contact Meta support through WhatsApp Manager."
    },
    {
      "code": "whatsapp_permission_missing",
      "status": 403,
      "meaning": "WhatsApp did not …: …",
      "how_to_fix": "Meta has not given app2email the permission this feature needs for your WhatsApp account (the API reference shows what each operation needs from Meta). Retrying does not help; contact support@app2email.com if you need it."
    },
    {
      "code": "partner_suspended",
      "status": 403,
      "meaning": "The partner account is suspended: it can read, revoke keys and delete webhooks, nothing else.",
      "how_to_fix": "Contact support@app2email.com."
    },
    {
      "code": "partner_closed",
      "status": 403,
      "meaning": "The partner account is closed.",
      "how_to_fix": "Contact support@app2email.com."
    },
    {
      "code": "client_not_editable",
      "status": 403,
      "meaning": "This client cannot be changed here: it signed up on app2email itself, or belongs to another site.",
      "how_to_fix": "The client changes it in their profile, or contact support@app2email.com."
    },
    {
      "code": "number_not_found",
      "status": 404,
      "meaning": "+… is not an active app2email WhatsApp number.",
      "how_to_fix": "Check the number in the URL. It must be the number registered with app2email (shown on https://www.app2email.com/dashboard/main)."
    },
    {
      "code": "template_not_found",
      "status": 404,
      "meaning": "There is no template named '…' on this WhatsApp account. Names are lower case and must match exactly.",
      "how_to_fix": "Use one of the approved templates listed in details.available_templates, or create the template in Meta's WhatsApp Manager and wait for approval."
    },
    {
      "code": "template_language_not_found",
      "status": 404,
      "meaning": "Template '…' has no '…' version.",
      "how_to_fix": "Use one of the languages in details.available_languages (codes must match exactly, eg 'en' and 'en_US' are different)."
    },
    {
      "code": "message_not_found",
      "status": 404,
      "meaning": "No message '…' was received by +….",
      "how_to_fix": "Use the message_id from the send answer or a message.received event (it starts with 'wamid.'), URL-encoded if it has '/' or '+' in it."
    },
    {
      "code": "broadcast_not_found",
      "status": 404,
      "meaning": "There is no broadcast '…' for +….",
      "how_to_fix": "Use broadcast.code from the send answer, or GET https://api.app2email.com/v1/…/broadcasts for the latest ones."
    },
    {
      "code": "webhook_not_found",
      "status": 404,
      "meaning": "There is no webhook '…' for this number.",
      "how_to_fix": "GET https://api.app2email.com/v1/…/webhooks lists the webhooks and their ids."
    },
    {
      "code": "delivery_not_found",
      "status": 404,
      "meaning": "There is no delivery of event '…' for this webhook.",
      "how_to_fix": "GET.../webhooks/…/deliveries lists them. Deliveries are kept 7 days."
    },
    {
      "code": "optin_not_found",
      "status": 404,
      "meaning": "+… has no opt-in record.",
      "how_to_fix": "GET.../optins?number=… checks one number."
    },
    {
      "code": "request_not_found",
      "status": 404,
      "meaning": "No logged request '…' for this number.",
      "how_to_fix": "Only errors and requests that change something are logged, and rows are kept 30 days. Use the request_id from an API answer."
    },
    {
      "code": "conversation_not_found",
      "status": 404,
      "meaning": "There is no conversation with … yet: they have never written to this number and nothing was sent to them.",
      "how_to_fix": "A conversation with a business-scoped user id starts when the contact writes to the number."
    },
    {
      "code": "contact_not_found",
      "status": 404,
      "meaning": "There is no contact '…' for this number.",
      "how_to_fix": "GET /v1/…/bookings/customers lists the customers."
    },
    {
      "code": "segment_not_found",
      "status": 404,
      "meaning": "There is no segment '…' for this number.",
      "how_to_fix": "GET /v1/…/segments lists the segments (use the id or the exact name), POST creates one."
    },
    {
      "code": "approval_not_found",
      "status": 404,
      "meaning": "There is no held send '…' for this number.",
      "how_to_fix": "GET https://api.app2email.com/v1/…/approvals lists the held sends (they are kept 7 days after they are resolved or expire)."
    },
    {
      "code": "media_not_found",
      "status": 404,
      "meaning": "This message has no stored media file.",
      "how_to_fix": "Only inbound media messages (image, video, audio, document, sticker) received after app2email started keeping copies have a file. media in GET /messages says whether a message had one."
    },
    {
      "code": "route_not_found",
      "status": 404,
      "meaning": "There is no such webhook family.",
      "how_to_fix": "Check the method and the path against the reference: https://www.app2email.com/docs/api"
    },
    {
      "code": "key_not_found",
      "status": 404,
      "meaning": "There is no key with this id.",
      "how_to_fix": "List the keys (GET /v1/account/keys, or the number's keys) for their ids."
    },
    {
      "code": "dataset_not_found",
      "status": 404,
      "meaning": "The WhatsApp Business Account has no Conversions API dataset yet.",
      "how_to_fix": "Create it with POST /v1/…/conversions/dataset."
    },
    {
      "code": "booking_not_found",
      "status": 404,
      "meaning": "There is no such booking on this number.",
      "how_to_fix": "Reload the appointments page."
    },
    {
      "code": "block_not_found",
      "status": 404,
      "meaning": "There is no such time block on this number.",
      "how_to_fix": "GET /calendar/blocks lists the blocks with their ids."
    },
    {
      "code": "note_not_found",
      "status": 404,
      "meaning": "There is no such note on this number (or it was deleted).",
      "how_to_fix": "GET /bookings/notes?contact=... lists the notes with their ids."
    },
    {
      "code": "link_not_found",
      "status": 404,
      "meaning": "There is no such booking link on this number.",
      "how_to_fix": "GET /bookings/links lists the links with their codes."
    },
    {
      "code": "hold_not_found",
      "status": 404,
      "meaning": "There is no such held time on this number.",
      "how_to_fix": "Use the reference POST /bookings/holds answered."
    },
    {
      "code": "flow_not_found",
      "status": 404,
      "meaning": "'…' is not a Flow key.",
      "how_to_fix": "A key is 1 to 40 lower case letters, digits, - or _."
    },
    {
      "code": "flow_json_not_found",
      "status": 404,
      "meaning": "The flow … has no Flow JSON yet.",
      "how_to_fix": "Upload one with PUT /v1/…/flows/…/json."
    },
    {
      "code": "qr_code_not_found",
      "status": 404,
      "meaning": "There is no QR code '…' on this number.",
      "how_to_fix": "GET /v1/…/qr-codes lists them."
    },
    {
      "code": "client_not_found",
      "status": 404,
      "meaning": "There is no client with this id.",
      "how_to_fix": "GET /v1/partner/clients lists your clients and their ids."
    },
    {
      "code": "payment_not_found",
      "status": 404,
      "meaning": "There is no such payment on this number.",
      "how_to_fix": "GET /payments lists the payments with their ids."
    },
    {
      "code": "package_not_found",
      "status": 404,
      "meaning": "There is no such package on sale, or the customer has no active package with sessions left for the service.",
      "how_to_fix": "GET /bookings/packages lists the packages on sale; GET /bookings/packages/purchases?contact= a customer's."
    },
    {
      "code": "poll_not_found",
      "status": 404,
      "meaning": "There is no such meeting poll on this number.",
      "how_to_fix": "GET /bookings/polls lists the polls with their ids."
    },
    {
      "code": "catcher_not_found",
      "status": 404,
      "meaning": "The catcher '…' has expired (catchers last 1 hour).",
      "how_to_fix": "Make a new one: POST https://api.app2email.com/v1/…/webhooks/catchers."
    },
    {
      "code": "idempotency_request_in_progress",
      "status": 409,
      "meaning": "Another request with this Idempotency-Key was being handled at the same moment.",
      "how_to_fix": "Wait a few seconds and send the request again with the same key."
    },
    {
      "code": "idempotency_request_interrupted",
      "status": 409,
      "meaning": "The first request with this Idempotency-Key (request_id …, started …) did not finish. Some of its messages may have been sent.",
      "how_to_fix": "Check what was sent (Activity Log, or GET /v1/…/broadcasts) before sending again. To send again, use a new Idempotency-Key."
    },
    {
      "code": "template_already_exists",
      "status": 409,
      "meaning": "A template with this name and language already exists (or is being deleted).",
      "how_to_fix": "Use another name or language. A deleted template's name can be used again after about 4 weeks for the same language."
    },
    {
      "code": "broadcast_not_cancellable",
      "status": 409,
      "meaning": "The broadcast is finished or already cancelled.",
      "how_to_fix": "Only API sends that are scheduled or still sending can be cancelled."
    },
    {
      "code": "broadcast_cancelled",
      "status": 409,
      "meaning": "The broadcast was cancelled before this message was sent.",
      "how_to_fix": "Send it again in a new request if it is still needed."
    },
    {
      "code": "webhook_url_in_use",
      "status": 409,
      "meaning": "Another webhook of this number already uses this url.",
      "how_to_fix": "Change that webhook instead, or delete one of them."
    },
    {
      "code": "approval_already_resolved",
      "status": 409,
      "meaning": "This held send was resolved a moment ago.",
      "how_to_fix": "Nothing to do. Send a new request if the messages are still needed."
    },
    {
      "code": "approval_expired",
      "status": 409,
      "meaning": "This held send expired at … (48 hours after it was held), so it cannot be approved.",
      "how_to_fix": "Send the request again; it is held again for approval."
    },
    {
      "code": "segment_exists",
      "status": 409,
      "meaning": "A segment named '…' already exists.",
      "how_to_fix": "Use another name."
    },
    {
      "code": "number_already_verified",
      "status": 409,
      "meaning": "WhatsApp (Meta) error 136024.",
      "how_to_fix": "The number is already verified. No code is needed."
    },
    {
      "code": "username_taken",
      "status": 409,
      "meaning": "WhatsApp (Meta) error 147005.",
      "how_to_fix": "Another number of your business has this username. Move it to this number, or choose another username."
    },
    {
      "code": "number_not_live",
      "status": 409,
      "meaning": "The number is not live yet (no plan with the API paid, or not connected), so it has no keys.",
      "how_to_fix": "Finish the steps get_account_status lists; wait Retry-After seconds."
    },
    {
      "code": "key_limit_reached",
      "status": 409,
      "meaning": "There are as many keys as allowed (10 per number).",
      "how_to_fix": "Revoke a key you no longer use first."
    },
    {
      "code": "key_limits_unavailable",
      "status": 409,
      "meaning": "Sandbox keys, daily caps and approval thresholds are not available on this server yet.",
      "how_to_fix": "Send \"sandbox\": false without daily_cap and approval_above."
    },
    {
      "code": "plan_not_available",
      "status": 409,
      "meaning": "This plan, or this interval, cannot be bought yet.",
      "how_to_fix": "Choose another plan or interval from list_plans."
    },
    {
      "code": "plan_already_active",
      "status": 409,
      "meaning": "The number is on this plan already.",
      "how_to_fix": "Choose another plan, or nothing: it is paid."
    },
    {
      "code": "booking_slot_taken",
      "status": 409,
      "meaning": "That time is not free…",
      "how_to_fix": "Read GET.../bookings/availability again and pick one of the slots it gives."
    },
    {
      "code": "booking_cancelled",
      "status": 409,
      "meaning": "This appointment is already cancelled.",
      "how_to_fix": "Nothing to do. Make a new booking if the customer wants another time."
    },
    {
      "code": "hold_expired",
      "status": 409,
      "meaning": "The held time is not held any more: it expired, was released, or was already turned into a booking.",
      "how_to_fix": "Hold the time again with POST /bookings/holds, or read the booking it became."
    },
    {
      "code": "slug_taken",
      "status": 409,
      "meaning": "The public address (slug) is already used by another business.",
      "how_to_fix": "Choose another address."
    },
    {
      "code": "flow_not_editable",
      "status": 409,
      "meaning": "WhatsApp does not let this flow be changed.",
      "how_to_fix": "This flow cannot be edited (a deprecated flow, or an older flow without editing). Clone it (POST /flows with clone_flow_id), change the copy and publish that."
    },
    {
      "code": "flow_not_published",
      "status": 409,
      "meaning": "Only a published flow can be deprecated.",
      "how_to_fix": "Fix what the message says (upload first, fix the validation errors, wait for the encryption key), then publish again."
    },
    {
      "code": "flow_not_deletable",
      "status": 409,
      "meaning": "A published flow cannot be deleted.",
      "how_to_fix": "A published flow cannot be deleted. Deprecate it instead."
    },
    {
      "code": "flow_name_taken",
      "status": 409,
      "meaning": "The WhatsApp account has a flow with this name already.",
      "how_to_fix": "A flow with this name exists on the WhatsApp account. Choose another name."
    },
    {
      "code": "encryption_key_managed",
      "status": 409,
      "meaning": "This number's Flow encryption key is managed by Bookings (dashboard > Bookings): WhatsApp keeps one key per number, and the booking Flows need theirs.",
      "how_to_fix": "Leave the key as it is (GET /v1/…/flows/encryption-key shows it). A Flow of your own with a data endpoint needs a number without Bookings."
    },
    {
      "code": "username_not_available",
      "status": 409,
      "meaning": "WhatsApp (Meta) error 147001.",
      "how_to_fix": "This username is taken or not allowed. Try another one (GET /username/suggestions lists names reserved for your business)."
    },
    {
      "code": "client_exists",
      "status": 409,
      "meaning": "This e-mail address has an account on your site already.",
      "how_to_fix": "GET /v1/partner/clients/{client_id} shows it."
    },
    {
      "code": "payments_not_connected",
      "status": 409,
      "meaning": "The business has not connected Stripe or PayPal (or the way of paying is not offered).",
      "how_to_fix": "The account owner connects a provider on the dashboard (Bookings > Payments) and chooses the methods."
    },
    {
      "code": "refund_not_possible",
      "status": 409,
      "meaning": "The payment cannot be refunded: it is not paid, already refunded, or less is left than asked for.",
      "how_to_fix": "GET /payments/{id} shows its status and what was refunded."
    },
    {
      "code": "too_late",
      "status": 409,
      "meaning": "A customer may no longer cancel or move this appointment online: it is closer than the business's cancel notice.",
      "how_to_fix": "The customer messages the business, who can change it from the calendar or the API (the business is never limited)."
    },
    {
      "code": "template_not_editable",
      "status": 409,
      "meaning": "The template '…' (…) is …status: WhatsApp edits only APPROVED, REJECTED or PAUSED templates.",
      "how_to_fix": "Wait until WhatsApp has reviewed it (the template.status_changed event tells you), or delete it and create it again."
    },
    {
      "code": "template_category_locked",
      "status": 409,
      "meaning": "The category of an approved template cannot be changed (it is …).",
      "how_to_fix": "Create a new template in the other category, or leave \"category\" out."
    },
    {
      "code": "template_insights_not_enabled",
      "status": 409,
      "meaning": "WhatsApp did not …: …",
      "how_to_fix": "Template insights are off for this WhatsApp account. Switch them on once with POST /v1/…/template-insights {\"confirm\": true} (this cannot be undone)."
    },
    {
      "code": "delivery_in_progress",
      "status": 409,
      "meaning": "This event is being sent to this webhook right now (its first try or a planned retry).",
      "how_to_fix": "Wait a few seconds, then look at GET.../deliveries/…: it may be delivered already. Send it again only if it is not."
    },
    {
      "code": "request_too_large",
      "status": 413,
      "meaning": "The request body is larger than 1 MB.",
      "how_to_fix": "WhatsApp allows documents up to 100 MB, images up to 5 MB and videos up to 16 MB. For large files you can also send a \"link\" instead of base64 \"data\"."
    },
    {
      "code": "media_too_large",
      "status": 413,
      "meaning": "The file is larger than WhatsApp allows for its type.",
      "how_to_fix": "Send a smaller file (compress the image/video, or reduce the PDF size)."
    },
    {
      "code": "approval_body_too_large",
      "status": 413,
      "meaning": "This key holds sends to more than … contacts for approval, but a request of … KB is too big to keep (the most is … MB).",
      "how_to_fix": "Upload the media once with POST /v1/…/media and send it as {\"id\": \"<media_id>\"} instead of base64 data, or split the list."
    },
    {
      "code": "test_event_too_large",
      "status": 413,
      "meaning": "The test event is larger than … KB.",
      "how_to_fix": "Send a shorter event."
    },
    {
      "code": "flow_json_too_large",
      "status": 413,
      "meaning": "The request is larger than WhatsApp's 10 MB limit for a Flow JSON.",
      "how_to_fix": "Make the Flow JSON smaller."
    },
    {
      "code": "unsupported_content_type",
      "status": 415,
      "meaning": "The body must be JSON (Content-Type: application/json).",
      "how_to_fix": "Send the header 'Content-Type: application/json' with a JSON body. Media files go inside the JSON as base64 \"data\" or as a \"link\"."
    },
    {
      "code": "template_not_approved",
      "status": 422,
      "meaning": "The template is not APPROVED (pending, rejected, paused or disabled), so WhatsApp will not send it.",
      "how_to_fix": "Wait for approval, or fix the template in Meta's WhatsApp Manager. Only APPROVED templates can be sent."
    },
    {
      "code": "template_parameters_invalid",
      "status": 422,
      "meaning": "The components do not match the template, listed in details.problems.",
      "how_to_fix": "Compare with example_request: a complete request for this template with its own sample values."
    },
    {
      "code": "invalid_base64",
      "status": 422,
      "meaning": "The header … \"data\" is not valid base64.",
      "how_to_fix": "Send the file's bytes base64 encoded (standard alphabet, '=' padding), eg in Python: base64.b64encode(open('file','rb').read()).decode(). A 'data:<mime>;base64,' prefix is also accepted."
    },
    {
      "code": "invalid_media_link",
      "status": 422,
      "meaning": "A media \"link\" is not a valid http(s) URL.",
      "how_to_fix": "Use a full public URL, eg: https://example.com/files/photo.jpg - or send the file as base64 in \"data\"."
    },
    {
      "code": "media_download_failed",
      "status": 422,
      "meaning": "Downloading the header … from the link failed: HTTP ….",
      "how_to_fix": "Check the link opens in a browser without logging in. Links that need a login, cookies or a signed session do not work - send the file as base64 \"data\" instead."
    },
    {
      "code": "media_type_not_allowed",
      "status": 422,
      "meaning": "The file type is not allowed for this media.",
      "how_to_fix": "Convert the file to an allowed type, or set \"mime_type\" if the type could not be detected."
    },
    {
      "code": "recipient_not_allowed",
      "status": 422,
      "meaning": "WhatsApp (Meta) error 131030.",
      "how_to_fix": "This WhatsApp number is still in test mode and can only message numbers on its allowed list. Add the recipient in Meta's WhatsApp Manager, or finish the number's setup."
    },
    {
      "code": "recipient_unreachable",
      "status": 422,
      "meaning": "WhatsApp (Meta) error 131026.",
      "how_to_fix": "WhatsApp could not deliver to this number. Check it is a WhatsApp number written with its country code (digits only, eg 61412345678), and that the person uses an up to date WhatsApp."
    },
    {
      "code": "template_parameter_count_mismatch",
      "status": 422,
      "meaning": "WhatsApp (Meta) error 132000.",
      "how_to_fix": "The number of parameters does not match the template. See example_request for the parameters this template needs."
    },
    {
      "code": "template_text_too_long",
      "status": 422,
      "meaning": "WhatsApp (Meta) error 132005.",
      "how_to_fix": "With your parameter values the message is longer than WhatsApp allows. Use shorter parameter values."
    },
    {
      "code": "template_format_policy",
      "status": 422,
      "meaning": "WhatsApp (Meta) error 132007.",
      "how_to_fix": "A parameter value breaks WhatsApp's formatting rules. Remove unusual characters or formatting from the parameter values."
    },
    {
      "code": "template_parameter_format_mismatch",
      "status": 422,
      "meaning": "WhatsApp (Meta) error 132012.",
      "how_to_fix": "A parameter has the wrong type or format for this template (eg: text where media is expected). See example_request."
    },
    {
      "code": "template_paused",
      "status": 422,
      "meaning": "WhatsApp (Meta) error 132015.",
      "how_to_fix": "WhatsApp has paused this template because of low quality ratings. Use another template, or edit this one in WhatsApp Manager."
    },
    {
      "code": "template_disabled",
      "status": 422,
      "meaning": "WhatsApp (Meta) error 132016.",
      "how_to_fix": "WhatsApp has disabled this template. Create or use another template."
    },
    {
      "code": "template_parameter_invalid",
      "status": 422,
      "meaning": "WhatsApp (Meta) error 132018.",
      "how_to_fix": "A parameter value is not allowed: no new lines, tabs or more than 4 spaces in a row."
    },
    {
      "code": "required_parameter_missing",
      "status": 422,
      "meaning": "WhatsApp (Meta) error 131008.",
      "how_to_fix": "A required parameter is missing. See example_request for a complete request."
    },
    {
      "code": "parameter_value_invalid",
      "status": 422,
      "meaning": "WhatsApp (Meta) error 131009.",
      "how_to_fix": "One of the values is not valid. whatsapp_error.details says which one."
    },
    {
      "code": "media_download_error",
      "status": 422,
      "meaning": "WhatsApp (Meta) error 131052.",
      "how_to_fix": "WhatsApp could not download the header media. Send it again as base64 \"data\" or a different link."
    },
    {
      "code": "media_upload_error",
      "status": 422,
      "meaning": "WhatsApp (Meta) error 131053.",
      "how_to_fix": "WhatsApp could not process the header media. Check the file type and size, and that the file opens correctly."
    },
    {
      "code": "idempotency_key_reused",
      "status": 422,
      "meaning": "This Idempotency-Key was already used for a different request (request_id …) in the last 24 hours.",
      "how_to_fix": "Use a new key for each new message or list. Send the same key again only to retry exactly the same request (the same body)."
    },
    {
      "code": "invalid_webhook_url",
      "status": 422,
      "meaning": "The webhook URL is not a public https address that can be reached.",
      "how_to_fix": "Use a public https:// address that accepts POST requests."
    },
    {
      "code": "outside_24h_window",
      "status": 422,
      "meaning": "The contact has not written to this number in the last 24 hours (or never), so only a template message can be sent.",
      "how_to_fix": "Send an approved template message instead (\"type\": \"template\"). When the contact answers, normal messages work again for 24 hours."
    },
    {
      "code": "text_too_long",
      "status": 422,
      "meaning": "\"text\" is longer than WhatsApp allows.",
      "how_to_fix": "Shorten the text, or send it as two messages."
    },
    {
      "code": "caption_too_long",
      "status": 422,
      "meaning": "The text with a file is its caption: … characters, WhatsApp allows up to ….",
      "how_to_fix": "Shorten the text, or send the file and the text as two messages."
    },
    {
      "code": "invalid_email",
      "status": 422,
      "meaning": "An e-mail address is not valid.",
      "how_to_fix": "Give an address like name@example.com, or leave the field out."
    },
    {
      "code": "template_rejected",
      "status": 422,
      "meaning": "WhatsApp did not accept the template.",
      "how_to_fix": "Fix the template as whatsapp_error says and send it again."
    },
    {
      "code": "bsuid_not_supported",
      "status": 422,
      "meaning": "WhatsApp (Meta) error 131062.",
      "how_to_fix": "WhatsApp cannot send this message to a business-scoped user id: one-tap, zero-tap and copy-code authentication templates need the phone number. Send it to the contact's phone number."
    },
    {
      "code": "marketing_per_user_limit",
      "status": 422,
      "meaning": "WhatsApp (Meta) error 131049.",
      "how_to_fix": "WhatsApp held this marketing message back: the person has had many marketing messages lately. Do not send it again within 24 hours, because retrying sooner keeps the block longer."
    },
    {
      "code": "recipient_in_experiment",
      "status": 422,
      "meaning": "WhatsApp (Meta) error 130472.",
      "how_to_fix": "WhatsApp did not send this marketing message because the person is part of a Meta experiment. Nothing to fix; do not resend it now."
    },
    {
      "code": "template_not_marketing",
      "status": 422,
      "meaning": "WhatsApp (Meta) error 131055.",
      "how_to_fix": "Only marketing templates can go through the Marketing Messages API. Send this template the normal way."
    },
    {
      "code": "recipient_is_sender",
      "status": 422,
      "meaning": "WhatsApp (Meta) error 131021.",
      "how_to_fix": "The recipient is your own WhatsApp number. Send to a different number."
    },
    {
      "code": "whatsapp_parameter_error",
      "status": 422,
      "meaning": "WhatsApp did not …: …",
      "how_to_fix": "WhatsApp did not accept a value of the request: whatsapp_error.message and details say which. Fix it and send the request again."
    },
    {
      "code": "block_users_failed",
      "status": 422,
      "meaning": "WhatsApp did not block any of the users, listed in details.failed.",
      "how_to_fix": "Only users who wrote to you in the last 24 hours can be blocked. Check each user's error."
    },
    {
      "code": "block_list_full",
      "status": 422,
      "meaning": "WhatsApp (Meta) error 139101.",
      "how_to_fix": "The block list is full (64,000 users). Unblock some users first."
    },
    {
      "code": "username_change_limit",
      "status": 422,
      "meaning": "WhatsApp (Meta) error 2655131.",
      "how_to_fix": "A username can be changed at most 2 times in 14 days. Try again later."
    },
    {
      "code": "flow_cannot_publish",
      "status": 422,
      "meaning": "WhatsApp did not publish the flow: it is not a draft, has validation errors, or failed a publishing check.",
      "how_to_fix": "Only a draft without validation errors can be published, and the publishing checks must pass (GET /flows/…: validation_errors, health_status)."
    },
    {
      "code": "flow_rejected",
      "status": 422,
      "meaning": "WhatsApp did not accept the flow request.",
      "how_to_fix": "Fix the request as whatsapp_error says and send it again."
    },
    {
      "code": "reaction_too_old",
      "status": 422,
      "meaning": "The message was received on …. WhatsApp only allows reactions to messages up to … days old.",
      "how_to_fix": "React to a newer message, or send a text reply."
    },
    {
      "code": "message_too_old",
      "status": 422,
      "meaning": "The message arrived on …. WhatsApp only marks messages as read up to … days after they arrived.",
      "how_to_fix": "Mark a newer message as read: it marks the earlier ones of the chat too."
    },
    {
      "code": "voice_needs_ogg_opus",
      "status": 422,
      "meaning": "A voice message (\"voice\": true) must be an.ogg file with the OPUS codec. This file is of an unknown type.",
      "how_to_fix": "Convert it, eg: ffmpeg -i in.mp3 -c:a libopus -ac 1 voice.ogg. Or leave \"voice\" out to send it as a normal audio file."
    },
    {
      "code": "marketing_disabled_on_cloud_api",
      "status": 422,
      "meaning": "WhatsApp (Meta) error 131063.",
      "how_to_fix": "This WhatsApp account blocks marketing templates on the normal send path. Send with \"marketing_api\": \"mm_api\", or set messages.marketing_route to auto (PUT /settings/number)."
    },
    {
      "code": "recipient_identity_changed",
      "status": 422,
      "meaning": "WhatsApp (Meta) error 137000.",
      "how_to_fix": "The contact's identity key changed (eg a new phone) since recipient_identity_key_hash was read. Check it is still the same person, then send with the hash of their latest message.received, or without one."
    },
    {
      "code": "username_account_not_linked",
      "status": 422,
      "meaning": "WhatsApp (Meta) error 147003, 147004.",
      "how_to_fix": "The username is used by your Facebook Page or Instagram account: link this phone number to that Page or account in Meta Business Suite first."
    },
    {
      "code": "template_limit_reached",
      "status": 422,
      "meaning": "The WhatsApp account has as many templates as Meta allows.",
      "how_to_fix": "The WhatsApp account has as many templates as Meta allows (250, or 6,000 for a verified business). Delete or archive templates you do not use."
    },
    {
      "code": "template_insights_unavailable",
      "status": 422,
      "meaning": "WhatsApp did not …: …",
      "how_to_fix": "Meta does not offer template insights for this WhatsApp account (not for accounts in the EU or Japan, or not yet)."
    },
    {
      "code": "template_archive_failed",
      "status": 422,
      "meaning": "WhatsApp archived no language of '…': ….",
      "how_to_fix": "Only APPROVED or REJECTED templates can be archived."
    },
    {
      "code": "template_unarchive_failed",
      "status": 422,
      "meaning": "WhatsApp unarchived no language of '…': ….",
      "how_to_fix": "Only archived templates can be unarchived, within 28 days of archiving."
    },
    {
      "code": "template_compare_unavailable",
      "status": 422,
      "meaning": "WhatsApp did not compare the templates.",
      "how_to_fix": "WhatsApp compares only two templates of this account that were each sent at least 1,000 times in the period. Try a longer ?days=."
    },
    {
      "code": "monthly_limit_reached",
      "status": 429,
      "meaning": "This number has used all messages in its plan for this billing month. Outgoing WhatsApp messages and outgoing emails both count.",
      "how_to_fix": "Wait for the next billing month, or move to a plan with more messages."
    },
    {
      "code": "too_many_messages_to_recipient",
      "status": 429,
      "meaning": "WhatsApp (Meta) error 131056.",
      "how_to_fix": "Too many messages to this recipient in a short time. Wait a little before sending to them again."
    },
    {
      "code": "whatsapp_rate_limit",
      "status": 429,
      "meaning": "WhatsApp (Meta) error 130429, 80007, 4, 131048.",
      "how_to_fix": "WhatsApp's rate limit was reached. Slow down and try again in a minute."
    },
    {
      "code": "rate_limited",
      "status": 429,
      "meaning": "Too many requests: more than … per second (a burst of … is allowed).",
      "how_to_fix": "Wait … second(s) and send the request again. Slow down: send a list of numbers in one request instead of one request per number."
    },
    {
      "code": "daily_cap_reached",
      "status": 429,
      "meaning": "The API key '…' may send … messages per day (UTC); … are used today and this request would send … more.",
      "how_to_fix": "Wait until midnight UTC, send fewer, or raise the key's daily cap on https://www.app2email.com/dashboard/apikey."
    },
    {
      "code": "monthly_cap_reached",
      "status": 429,
      "meaning": "This number's own monthly cap is … messages (outgoing WhatsApp + emails); … are used and this request would send … more.",
      "how_to_fix": "Wait for the next billing month, send fewer, or raise the cap: PUT /v1/…/settings/number {\"caps\": {\"monthly_messages\": <n>}} (0 = no cap) - or on the dashboard's Settings page."
    },
    {
      "code": "too_many_tests",
      "status": 429,
      "meaning": "This number has sent … test events in the last hour, the most allowed.",
      "how_to_fix": "Try again in … minutes."
    },
    {
      "code": "register_limit_reached",
      "status": 429,
      "meaning": "WhatsApp (Meta) error 133016.",
      "how_to_fix": "The number was registered or deregistered too often (10 times in 72 hours). Wait 72 hours before trying again."
    },
    {
      "code": "too_many_signups",
      "status": 429,
      "meaning": "Too many sign-ups from this address or for this e-mail address.",
      "how_to_fix": "Wait retry_after_seconds, then try again. If the person already got an e-mail, use that one."
    },
    {
      "code": "media_lookups_paused",
      "status": 429,
      "meaning": "Too many media lookups at WhatsApp failed in the last hour, so they pause for 30 minutes (WhatsApp blocks the number's media lookups otherwise).",
      "how_to_fix": "Wait, then try again. Use the files app2email stored (message_id of the message) where you can."
    },
    {
      "code": "too_many_invites",
      "status": 429,
      "meaning": "Too many new clients or onboarding links today.",
      "how_to_fix": "Try again tomorrow (retry_after_seconds), or contact support@app2email.com."
    },
    {
      "code": "internal_error",
      "status": 500,
      "meaning": "Something went wrong on our side.",
      "how_to_fix": "Try again. If it keeps happening, contact support@app2email.com with the request_id."
    },
    {
      "code": "background_start_failed",
      "status": 500,
      "meaning": "The background send could not be started, so nothing was sent.",
      "how_to_fix": "Try again in a minute, or send without \"background\". If it keeps happening, contact support@app2email.com with the request_id."
    },
    {
      "code": "schedule_failed",
      "status": 500,
      "meaning": "The send could not be scheduled, so nothing will be sent.",
      "how_to_fix": "Try again in a minute. If it keeps happening, contact support@app2email.com with the request_id."
    },
    {
      "code": "template_lookup_failed",
      "status": 502,
      "meaning": "Could not read your templates from WhatsApp: …",
      "how_to_fix": "Try again in a minute. If it keeps failing, contact support@app2email.com with the request_id."
    },
    {
      "code": "media_upload_failed",
      "status": 502,
      "meaning": "WhatsApp did not accept the media upload.",
      "how_to_fix": "Check the file opens and is a supported type. If it keeps failing, try again in a few minutes."
    },
    {
      "code": "template_sample_media_failed",
      "status": 502,
      "meaning": "Downloading the header sample from the link failed: HTTP ….",
      "how_to_fix": "Check the link opens in a browser without logging in."
    },
    {
      "code": "template_delete_failed",
      "status": 502,
      "meaning": "WhatsApp did not delete the templates.",
      "how_to_fix": "Try again in a minute. A DISABLED template cannot be deleted."
    },
    {
      "code": "whatsapp_error",
      "status": 502,
      "meaning": "WhatsApp (Meta) refused the request with an error app2email has no own code for.",
      "how_to_fix": "Read whatsapp_error (Meta's code and text). Try again later; if it keeps failing, contact support@app2email.com with the request_id."
    },
    {
      "code": "block_users_error",
      "status": 502,
      "meaning": "WhatsApp had a problem with the block list (Meta error 139103, or no answer).",
      "how_to_fix": "WhatsApp had a problem with the block list. Try again in a minute."
    },
    {
      "code": "account_service_error",
      "status": 502,
      "meaning": "The account service gave an answer that is too large.",
      "how_to_fix": "Try again. If it keeps happening, contact support@app2email.com with the request_id."
    },
    {
      "code": "payment_link_failed",
      "status": 502,
      "meaning": "The payment link could not be made.",
      "how_to_fix": "Try again in a minute. If it keeps failing, contact support@app2email.com."
    },
    {
      "code": "email_not_sent",
      "status": 502,
      "meaning": "The confirmation e-mail could not be sent.",
      "how_to_fix": "Check the e-mail address and try again in a minute. If it keeps failing, contact support@app2email.com."
    },
    {
      "code": "flow_json_download_failed",
      "status": 502,
      "meaning": "WhatsApp gave no usable download link for the Flow JSON.",
      "how_to_fix": "Try again in a minute."
    },
    {
      "code": "media_lookup_failed",
      "status": 502,
      "meaning": "WhatsApp's answer had no usable download link.",
      "how_to_fix": "Try again in a minute. If it keeps failing, contact support@app2email.com with the request_id."
    },
    {
      "code": "media_delete_failed",
      "status": 502,
      "meaning": "Deleting the media at WhatsApp failed.",
      "how_to_fix": "Try again in a minute. If it keeps failing, contact support@app2email.com with the request_id."
    },
    {
      "code": "marketing_status_lookup_failed",
      "status": 502,
      "meaning": "Reading the account's Marketing Messages API status from WhatsApp failed.",
      "how_to_fix": "Try again in a minute. If it keeps failing, contact support@app2email.com with the request_id."
    },
    {
      "code": "contact_book_error",
      "status": 502,
      "meaning": "Reading the contact book from WhatsApp failed.",
      "how_to_fix": "Try again in a minute. If it keeps failing, contact support@app2email.com with the request_id."
    },
    {
      "code": "profile_photo_failed",
      "status": 502,
      "meaning": "WhatsApp gave no upload handle for the photo.",
      "how_to_fix": "Try again in a minute. If it keeps failing, contact support@app2email.com with the request_id."
    },
    {
      "code": "payment_provider_error",
      "status": 502,
      "meaning": "The payment provider (Stripe or PayPal) refused the request or could not be reached.",
      "how_to_fix": "The provider's message is in the error. Try again, or check the account at the provider."
    },
    {
      "code": "whatsapp_connection_problem",
      "status": 503,
      "meaning": "This number has no WhatsApp Business account token, so no template can be made.",
      "how_to_fix": "Reconnect the WhatsApp account on the Settings page."
    },
    {
      "code": "whatsapp_number_not_registered",
      "status": 503,
      "meaning": "WhatsApp (Meta) error 133010.",
      "how_to_fix": "Your WhatsApp number is not registered with WhatsApp Cloud API at the moment. Contact support@app2email.com."
    },
    {
      "code": "request_log_unavailable",
      "status": 503,
      "meaning": "The request log is not available right now.",
      "how_to_fix": "Try again later. If it keeps happening, contact support@app2email.com with the request_id."
    },
    {
      "code": "whatsapp_unavailable",
      "status": 503,
      "meaning": "WhatsApp (Meta) error 131016.",
      "how_to_fix": "WhatsApp is not available right now. Try again in a few minutes."
    },
    {
      "code": "whatsapp_maintenance",
      "status": 503,
      "meaning": "WhatsApp (Meta) error 131057.",
      "how_to_fix": "Your WhatsApp account is in maintenance (for example while Meta raises its throughput). Try again in a few minutes."
    },
    {
      "code": "block_list_busy",
      "status": 503,
      "meaning": "WhatsApp (Meta) error 139102.",
      "how_to_fix": "The block list was being changed at the same time. Try again in a few seconds."
    },
    {
      "code": "account_service_unavailable",
      "status": 503,
      "meaning": "The account service did not answer in time.",
      "how_to_fix": "Try again in a minute. If it keeps happening, contact support@app2email.com with the request_id."
    },
    {
      "code": "partner_service_unavailable",
      "status": 503,
      "meaning": "The Partner API cannot do this right now.",
      "how_to_fix": "Try again in a minute (retry_after_seconds). If it keeps failing, contact support@app2email.com."
    }
  ]
}
