# WhatsApp Messages Partner API — Full Documentation > Send and receive WhatsApp messages through Linq. This file is the complete documentation for WhatsApp Messages Partner API, the WhatsApp channel of Linq API Docs, concatenated for LLM ingestion. Each section below corresponds to one page of the site and is preceded by its canonical URL. The companion file [llms.txt](https://docs.linqapp.com/channel/whatsapp/llms.txt) is a shorter index pointing at individual pages. The machine-readable OpenAPI specification at https://whatsapp.messages.api.linqapp.com/v1/openapi.yaml is the canonical definition of every endpoint, request body, response shape, and webhook event. **Pages included:** 177 --- # WhatsApp URL: https://docs.linqapp.com/channel/whatsapp/ Send and receive WhatsApp messages through a single API. Linq handles delivery, retries, templates, the customer window, per-chat event history, and webhooks. Building with an AI agent? Feed these docs straight to your LLM or coding agent: [`llms-full.txt`](https://docs.linqapp.com/channel/whatsapp/llms-full.txt) is the complete WhatsApp documentation in one file, and [`llms.txt`](https://docs.linqapp.com/channel/whatsapp/llms.txt) is a concise index. Both cover this channel only — iMessage and Apple Messages publish their own. [Connect WhatsApp ](/channel/whatsapp/getting-started/connect-whatsapp/index.md)Complete Embedded Signup, number verification, and registration. [Quickstart ](/channel/whatsapp/getting-started/quickstart/index.md)Go from an API key to an accepted message and its final outcome. [API reference ](/channel/whatsapp/api/index.md)All operations and wire shapes from the published OpenAPI contract. [Sending messages ](/channel/whatsapp/guides/messaging/sending-messages/index.md)Destination-first and chat-first sends, parts, templates, and idempotency. [Attachments ](/channel/whatsapp/guides/messaging/attachments/index.md)Send media by upload or by public URL, and download what customers send. [Events and recovery ](/channel/whatsapp/guides/events/index.md)Consume live signals without losing the durable source of truth. --- # Authentication URL: https://docs.linqapp.com/channel/whatsapp/getting-started/authentication/ Send the API key issued at onboarding as a bearer token: ``` Authorization: Bearer sk_live_… ``` A key is bound to exactly one brand and one environment. An identifier owned by another brand returns the same `404` as an identifier that does not exist, so the API never confirms cross-tenant resource existence. Keep keys server-side, load them from a secret store, and never put them in browser code, logs, tickets, or webhook payloads. Use the key exactly as issued: keys begin `sk_live_`, and the prefix must not be edited. --- # Best practices URL: https://docs.linqapp.com/channel/whatsapp/getting-started/best-practices/ - Use a stable idempotency key for every logical send, and reuse it only when retrying that same request. - Interpret `202` as durable acceptance, then wait for a terminal receipt. - Persist account and per-chat cursors separately; they are different cursor domains. - Reconcile from the event log and chat journal after disconnects instead of assuming a live stream delivered everything. - Deduplicate events by `id` and order a chat by `data.seq_from`. A `message.received` with attachments can arrive after later events of the same chat; never discard it as stale. - Ignore unknown event kinds and error codes unless you explicitly handle them. - Read `customer_window` before choosing free-form content or a template. - Fetch template state at send time; an approved template can later be paused. - Keep API keys and webhook signing secrets in a secret store. ## Review your setup with an agent Give your coding agent the current OpenAPI document and the message-part schemas your integration uses. Ask it to verify authentication, idempotency, cursor persistence, unknown-event handling, customer-window behavior, and terminal receipt handling against those files. The served contract is more current than copied examples. Copy this prompt into your own AI coding agent to check your integration against the guidelines above. It is the same prompt the **Copy agent prompt** button in the header carries. Audit your WhatsApp integration Copy prompt ``` You are auditing a codebase that integrates with Linq's WhatsApp Messages Partner API. This is read-only: do not change code unless I ask. First fetch the current OpenAPI contract from `https://whatsapp.messages.api.linqapp.com/v1/openapi.yaml` and the part schemas the integration uses (`GET /v1/parts/{type}`). If you cannot obtain them, stop instead of auditing from memory. Locate every API call, send path, SSE consumer, webhook handler, and cursor store. Verify that: - authentication uses the issued bearer key server-side and never changes its `sk_live_` prefix; - every logical send has a stable `Idempotency-Key`, transport retries reuse the same key and body, and unrelated sends never share a key; - HTTP 202 is treated as durable acceptance rather than delivery; - free-form content is sent only in the open customer window, with an approved template used outside it; - customer ids (`customer`, and the send `to`) are stored and compared as opaque strings, never parsed or formatted as phone numbers, because a customer who uses a username arrives as an id like `US.13491208655302741918`; replies copy `customer` into `to` unchanged; - one-time-code authentication templates are not sent to a customer known only by a username id, and error `4011` is handled as terminal for that send; - unknown event kinds, error types, and error codes are handled generically rather than crashing a consumer; - SSE IDs, opaque account-event cursors, and numeric per-chat sequence cursors are persisted in separate domains; - reconnect recovery uses `GET /v1/event_log` and `GET /v1/chats/{chat}/events`, and never assumes the live stream contained every event; - one inbound message cannot trigger duplicate replies from its received, window-opened, delivered, or read events; - a `message.received` with a lower `data.seq_from` than one already seen is never discarded as stale (a message with attachments can be announced after later events of its chat); events are deduplicated by `id` and a chat is ordered by `data.seq_from`; - incoming media parts are downloaded by `url`, a `409` is retried as `Retry-After` directs (including `unavailable_reason` `timed_out`), `410` is final, and an unknown `unavailable_reason` is treated as `capture_failed`; - webhook signatures are verified over the exact raw body, event IDs are deduplicated, and signing-secret rotation accepts both active secrets before the old one is retired; - 429 responses honor `Retry-After`, terminal failures are not retried, and an unresolved outcome is never blindly resent; - a failed message is recognised by `status`, with `failure.code` read as optional additive detail (`sender_deregistered`, `quality_hold_expired`, `recipient_country_restricted`, `payment_method_required`, `recipient_phone_number_required`), an unrecognised or absent code handled as "no published reason", and `failure.message` never branched on; - a mark-as-read call treats `409` `nothing_unread` and `nothing_readable` as "nothing to do", not as a failure to retry or escalate; - logs include `request_id` and stable resource IDs without credentials or message content. Report a table with Check, Status (pass/gap/n-a/unknown), Where (file and line), and Fix. Follow it with a short action list ordered by data-loss, duplicate-send, and security risk. Ground every finding in code you actually read. ``` --- # Connect WhatsApp URL: https://docs.linqapp.com/channel/whatsapp/getting-started/connect-whatsapp/ Connecting WhatsApp usually takes about five minutes. Start from the [WhatsApp page in your Linq account](https://zero.linqapp.com/whatsapp/). Request beta access first Ask your Linq contact to enable WhatsApp beta access for your account before starting. The WhatsApp page is not available until access is enabled. Use your personal Meta login Log in to Meta with your normal personal Facebook or Meta account—the one that has admin access to your business. The phone number you connect is not your Meta login. Use the number shown by Linq The number entered in Meta must exactly match the Linq number shown during setup. A different number will not connect. ## Complete Embedded Signup 1. Confirm that the line shown is the one you want to use, then select **Connect**. 2. Select **Copy number**, then **Get ready** and **Open Meta**. 3. Meta asks for your WhatsApp phone number first. Select **Add a new number** and paste the Linq number you copied. Do not choose **Use a display name only**. You can edit the display name later. 4. Choose **Text message** as the verification method. 5. When Meta sends the code, return to the Linq tab without closing the Meta window. Copy the verification code that appears in Linq, return to Meta, and paste it there. 6. Next, create a Business Portfolio and WhatsApp Business Account, or select existing ones. 7. If Meta asks for a payment method, you can skip it during initial setup. 8. Select **Finish** or **Skip and finish setup**, whichever Meta shows, then return to the Linq tab and keep it open while setup finishes. Do not refresh or close it. ## Troubleshoot verification ### Phone verification reports a rate limit If phone verification reports too many attempts or a rate limit, stop requesting codes and wait at least 24 hours from that response before trying again. Follow a longer wait shown on screen. The 24-hour cooldown is recommended guidance and does not guarantee that verification will be available then. Avoid repeated code requests in both Embedded Signup and WhatsApp Manager during the cooldown. When it has passed, return to the WhatsApp page in your Linq account and continue through the normal setup flow. Starting with a new setup link does not clear the rate limit. If the previous setup has expired, use the **Restart setup** option when it is available. If it is not available or you remain blocked after the cooldown, contact Linq support with the exact error and the time it appeared. Never share the verification code. ### The code was accepted, but setup did not finish An accepted SMS code is only one step. Select **Finish** or **Skip and finish setup**, whichever Meta shows, then return to the Linq tab and keep it open while setup finishes. Wait until it says **Your WhatsApp account is ready**. ## Save your credential When the page says **Your WhatsApp account is ready**, immediately select **Copy key** or **Download your credential**. The API key is shown only once and will not be available after you leave or refresh the page. The downloaded credential also includes the API URL. The OpenAPI contract is available from the setup page and from [the public contract endpoint](https://whatsapp.messages.api.linqapp.com/v1/openapi.yaml). Confirm that the credential can read your connected number: Terminal window ``` curl -sS https://whatsapp.messages.api.linqapp.com/v1/phone_numbers \ -H "Authorization: Bearer $API_KEY" ``` Then follow the [Quickstart](/channel/whatsapp/getting-started/quickstart/index.md) to test sending and receiving end to end. ## Verify your business Business verification is not required to complete initial setup, but doing it early can help avoid limits later. In Meta Business Settings, open **Security Center → Business verification** and make sure the legal business name, address, phone number, and website exactly match your official documents. See Meta’s [business verification guide](https://www.facebook.com/business/help/2058515294227817) for the full process. You can skip adding a payment method during initial setup. Completing signup does not confirm that messaging is ready. Add a payment method in Meta when prompted, and resolve any account restrictions before testing messaging. See [pricing](/channel/whatsapp/guides/messaging/sending-messages#pricing/index.md). --- # Key concepts URL: https://docs.linqapp.com/channel/whatsapp/getting-started/key-concepts/ ## Chats are 1:1 Each chat represents one customer conversation. You can send by destination and let Linq resolve the chat, or send to a known chat ID. ## Customer ids are opaque A chat’s `customer` is usually a phone number in digits, but a customer who uses a WhatsApp username can appear as a username id such as `US.13491208655302741918` instead. Store it as an opaque string, never parse it as a phone number, and copy it unchanged into `to` when you reply. See [customers who use a username](/channel/whatsapp/guides/messaging/sending-messages#customers-who-use-a-username/index.md). ## The customer window controls free-form sends An inbound customer message opens or extends the customer-service window. While it is open, you can send free-form content. Outside it, send an approved template. The API refuses an invalid choice; it never silently substitutes a template or coerces content. ## Acceptance is not delivery Successful send requests return `202` after durable acceptance. Delivery, read, and failure receipts arrive later. Treat an unresolved outcome as unknown; do not blindly resend it. A failed message may also say [why it failed](/channel/whatsapp/guides/messaging/sending-messages#why-a-message-failed/index.md). ## Events address durable state SSE and webhooks tell you which chat sequence range moved. The per-chat journal contains the message content and forms the durable recovery source. Account events also have a pageable log for bounded catch-up. ## Parts are the content contract Each send currently carries one member of the sealed `parts` union. The JSON Schemas served by `GET /v1/parts/{type}` are authoritative and can be used directly as tool schemas for your agent. --- # Quickstart URL: https://docs.linqapp.com/channel/whatsapp/getting-started/quickstart/ Your Linq contact gives you an API key during onboarding. Terminal window ``` export BASE_URL="https://whatsapp.messages.api.linqapp.com" export API_KEY="sk_live_…" # use the exact key issued to you ``` Beta, with no SLA Published wire shapes change additively, but the service has no uptime, latency, support-response, or blanket retention commitment during beta. ## 1. Fetch the contract The OpenAPI document and individual message-part schemas are public: Terminal window ``` curl -s "$BASE_URL/v1/openapi.yaml" -o openapi.yaml curl -s "$BASE_URL/v1/parts/text" | jq . ``` ## 2. Start the event stream Open the stream before sending so you see each transition: Terminal window ``` curl -N \ -H "Authorization: Bearer $API_KEY" \ "$BASE_URL/v1/streams/events" ``` Persist each SSE `id` as a resume cursor. The event envelope contains the chat and the range that moved, not message content; read content from the chat journal. Unknown event kinds must be ignored so additive events do not break your consumer. ## 3. Send a message `POST /v1/messages` lets Linq select the eligible line and chat for a destination. Supply an idempotency key for every logical send. Terminal window ``` curl -sS -X POST "$BASE_URL/v1/messages" \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: first-message-001" \ -d '{ "to": "+15551234567", "parts": [{"type": "text", "body": "Hello from Linq"}] }' | jq . ``` HTTP `202` means the send is durably accepted. It does not mean delivered. Watch for `message.delivered`, `message.read`, or `message.failed`, then read the addressed range from `GET /v1/chats/{chat}/events`. ## 4. Recover after a disconnect Resume SSE with `Last-Event-ID`, or page the same durable account sequence: Terminal window ``` curl -sS \ -H "Authorization: Bearer $API_KEY" \ "$BASE_URL/v1/event_log?limit=100" | jq . ``` Use the response’s opaque `next_cursor` on the next request. Keep account-event cursors separate from per-chat sequence cursors. Next, read [Sending messages](/channel/whatsapp/guides/messaging/sending-messages/index.md) and [Events and recovery](/channel/whatsapp/guides/events/index.md). --- # Events and recovery URL: https://docs.linqapp.com/channel/whatsapp/guides/events/ The API separates notification from durable content: 1. `GET /v1/streams/events` delivers live account events over SSE. 2. `GET /v1/event_log` pages the same account sequence for bounded recovery. 3. `GET /v1/chats/{chat}/events` returns the detailed, gapless journal for one chat. An account event identifies a chat and a `seq_from`–`seq_to` range. Fetch that range from the chat journal to read the content. Do not treat every event as a reply trigger: one customer message may also produce a window-opened event, and an outbound message may later produce delivered and read events. A `message.failed` event points at the message; the message row you fetch is what carries the [published failure reason](/channel/whatsapp/guides/messaging/sending-messages#why-a-message-failed/index.md), when there is one. ## Cursor rules - Persist the SSE `id` and send it back as `Last-Event-ID` after reconnecting. - The event-log cursor is opaque; pass `next_cursor` back unchanged. - A chat cursor is the last gapless numeric `seq` you processed. - Keep all three cursor domains separate. - A cursor older than retained account history returns HTTP `410` with `error.code` [2032](/channel/whatsapp/error/codes/2xxx/2032/index.md); reconnect without a cursor to continue from the current position. - Ignore unknown event kinds so newly added kinds remain backward compatible. - `template.updated` is an account event, not a chat event: it has no `chat_id` or sequence range. See [Template events](#template-events). Webhooks carry the same stable event identity as the stream. Deduplicate the two sinks by event ID if you consume both. With [zero-day retention](/channel/whatsapp/guides/platform/data-retention#zero-day-retention/index.md), the stream and the event log carry empty `parts` and `zero_retention: true`. ## Template events `template.updated` fires when a template’s `status` or `category` changes: approval, rejection, a pause and the approval that lifts it, and a recategorisation. It arrives on the stream and in the event log for production keys, and at webhook endpoints that are not scoped to phone numbers. An endpoint with no `event_kinds` receives it; select it with `event_kinds: ["template.updated"]`. ``` { "id": "evt_4b1d…", "type": "template.updated", "timestamp": "2026-10-27T14:03:11.208Z", "data": { "name": "order_shipped", "language": "en_US", "category": "utility", "status": "approved", "previous_category": "utility", "previous_status": "pending" } } ``` - `previous_status` and `previous_category` are absent when the template is newly listed, for example one created outside this API, and when templates are announced again after your account is reconnected. - Your own create is normally not announced, but it may be followed by one event with `previous_status: "draft"`. Rely on neither. - An approved template whose variables cannot be addressed by name is reported as `paused`, so its first event can read `pending` to `paused`. - Treat the event as a prompt to read, not as the template. After an approval, `send_schema` can still be `null` for up to about fifteen minutes. Keep `GET /v1/templates` as the authority and read it on start-up and after any gap in your event handling. See [Templates](/channel/whatsapp/guides/templates/index.md) for the full lifecycle. ## Messages with attachments For all WhatsApp accounts, a `message.received` event for a message carrying an image, video, audio, document or sticker waits until every attachment has been captured or has failed, or ten minutes have elapsed since Linq received the message, whichever comes first. It is not released earlier while capture is pending. The event takes its position in the stream and the event log when it is recorded. At the deadline, any still-pending attachment is marked `availability: unavailable` and `unavailable_reason: timed_out`. Capture continues, so the attachment may become downloadable later; the recorded event remains unchanged. See [Download incoming attachments](/channel/whatsapp/guides/messaging/sending-messages#download-incoming-attachments/index.md). The ten-minute deadline bounds the capture wait, not webhook delivery or retries. Such an event can arrive after events for later messages of the same chat, on webhooks, the event stream and the event log alike. Its `data.seq_from` can be lower than one you already received, and its `chat.window.opened` event can arrive first. - Never discard an event because its `seq_from` is lower than one already received. - Deduplicate by the event `id`. - Order a chat by `data.seq_from`. - For live processing, buffer briefly or reconcile with `GET /v1/chats/{chat}/events`. Events for messages without attachments, and every other event kind, keep their order. --- # Attachments URL: https://docs.linqapp.com/channel/whatsapp/guides/messaging/attachments/ A `media` part carries one image, video, audio file, document or sticker. On a send you tell the API where the bytes are in one of two ways; on a read the part tells you where to fetch them. The three identifiers are separate namespaces and never overlap: | Field | Direction | Meaning | | ------------ | --------- | ----------------------------------------------------------------------------------------- | | `upload_ref` | send | Your durable handle from `POST /v1/media`, reusable in this account and partition. | | `source_url` | send | A public `https` address the API fetches once, before accepting the send. | | `media_id` | read only | The channel’s transient inbound identifier. Never accepted on a send. | | `url` | read only | The authenticated download address for a retained inbound file. Never accepted on a send. | A sent part carries exactly one of `upload_ref` or `source_url`. Both, or neither, is refused with HTTP `422` and a JSON Pointer at the offending field. ## Option 1: upload, then send the handle Post the exact bytes to `POST /v1/media` with their media type, then reference the returned `upload_ref` from the part. The handle is reusable across sends in the same account and test/live partition; it has no fixed expiry but is not permanent. Terminal window ``` UPLOAD_REF=$(curl -sS -X POST "https://whatsapp.messages.api.linqapp.com/v1/media?kind=image" \ -H "Authorization: Bearer ${LINQ_WHATSAPP_API_KEY}" \ -H "Content-Type: image/png" \ --data-binary @photo.png | jq -r .upload_ref) ``` ``` { "to": "+15551234567", "parts": [{ "type": "media", "kind": "image", "upload_ref": "upload.0123456789abcdef0123456789abcdef" }] } ``` Use this route for large files, for bytes you will send more than once, and whenever the file is not already reachable on the public internet. ## Option 2: name a public URL If the file is already served from a public `https` host, put its address in `source_url` and skip the upload. The API fetches the address exactly once, before it accepts the send, and stores the exact bytes as an upload in your account. The accepted message — and every later transcript read and webhook — carries that upload’s `upload_ref`, never the address. No retry fetches the address again, and the address is never forwarded to the channel. ``` { "to": "+15551234567", "parts": [{ "type": "media", "kind": "image", "source_url": "https://cdn.example.com/menu.jpg" }] } ``` The response’s part shows what was stored: ``` { "id": "msg_158ff7124ea56816e5006438177a773c", "status": "accepted", "parts": [{ "type": "media", "kind": "image", "upload_ref": "upload.4293e657b84aa6a0c561219cdee74b71" }] } ``` Send with an `Idempotency-Key`: a replay of the same request under the same key returns the same message and the same `upload_ref` without fetching again, which is what makes a timed-out send safe to retry. ### What the address must satisfy - Absolute `https` on the default port, with no credentials and no fragment. - Resolves to a public destination — on every redirect hop, at most three. Private, loopback, link-local, multicast and cloud-metadata destinations are refused, whatever name resolves to them. - Answers `200` with the complete bytes, their exact `Content-Type`, and no `Content-Encoding`, within the fetch deadline. The API never sniffs a media type from bytes and never decodes a compressed answer. - The bytes satisfy the same media-type allowlist and size ceiling that `POST /v1/media` applies to the part’s `kind`. Nothing is converted or truncated. ### Refusals Every refusal is HTTP `422` with `error.param` at `/parts/0/source_url`, except capacity, which is a `503` you may retry shortly. | Code | Meaning | | ------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------- | | [5007](/channel/whatsapp/error/codes/5xxx/5007/index.md) `media_source_invalid` | The address failed the policy: scheme, port, credentials, a non-public destination or too many redirects. Fix the address. | | [5008](/channel/whatsapp/error/codes/5xxx/5008/index.md) `media_source_unavailable` | The host was unreachable, timed out, answered something other than `200`, or delivered fewer bytes than promised. | | [5009](/channel/whatsapp/error/codes/5xxx/5009/index.md) `media_source_unsupported` | The bytes do not fit the kind: wrong media type, over the ceiling, an unreadable sticker, or an encoded or untyped body. | | [5010](/channel/whatsapp/error/codes/5xxx/5010/index.md) `media_source_capacity_exhausted` | No fetch capacity was free. Retry shortly, or upload the bytes instead. | For large or slowly served files, prefer the upload route: the fetch runs inside the send request and has a bounded deadline. ## Send a voice note Set `"voice": true` on an outbound `audio` part to send it as a voice note, shown with a waveform and a play button. `false`, or leaving it out, sends an ordinary audio file. Terminal window ``` curl -sS -X POST "https://whatsapp.messages.api.linqapp.com/v1/chats/${CHAT_ID}/messages" \ -H "Authorization: Bearer ${LINQ_WHATSAPP_API_KEY}" \ -H "Idempotency-Key: ${IDEMPOTENCY_KEY}" \ -H "Content-Type: application/json" \ -d '{"parts":[{"type":"media","kind":"audio","upload_ref":"upload.0123456789abcdef0123456789abcdef","voice":true}]}' ``` - The audio must be mono Opus in an OGG container, stored as `audio/ogg`: upload it to `POST /v1/media` with `kind=audio` and `Content-Type: audio/ogg`, or name a `source_url` that serves `audio/ogg`. - The bytes are sent exactly as supplied — never converted or inspected — so encode them as mono Opus before uploading. - A voice note of 512 KB or less shows a play button. A larger one still arrives as a voice note, but the recipient must download it before it plays. The ordinary audio size ceiling still applies. `voice: true` on an upload that is not stored as `audio/ogg`, `voice` on any kind other than `audio`, and `"voice": null` are all refused with HTTP `422`, `error.code` [1004](/channel/whatsapp/error/codes/1xxx/1004/index.md) `invalid_content`, and a JSON Pointer at the field, such as `/parts/0/voice`. ## Kinds, types and ceilings `kind` selects the rules. Captions apply to image, video and document; a filename applies to documents only. The allowed media types and byte ceilings per kind are the upload operation’s, published in its `x-media-upload-profiles` extension in the [API reference](/channel/whatsapp/api/resources/media/index.md). ## Download incoming attachments An incoming `media` part carries a response-only `url` that requires your account’s Bearer key. Its response-only `availability` says whether the download answers the bytes: `available`, or `unavailable` with an `unavailable_reason` (`timed_out`, `capture_failed` or `expired` today). A `message.received` event waits until every attachment has been captured or has failed, or ten minutes have elapsed since Linq received the message, whichever comes first. This behavior is enabled for all WhatsApp accounts. At the deadline, an attachment still being captured is marked `unavailable` with reason `timed_out`. Capture continues, so it may become downloadable later. The ten-minute deadline bounds the capture wait, not webhook delivery or retries. Historical events may omit `availability`; retry a pending download as its `409` response’s `Retry-After` directs. The full procedure — including what each value means and the pending, expired and not-found answers — is in [Sending messages → Download incoming attachments](/channel/whatsapp/guides/messaging/sending-messages#download-incoming-attachments/index.md). ## Related - [Sending messages](/channel/whatsapp/guides/messaging/sending-messages/index.md) — routes, the customer window and idempotency - [Errors](/channel/whatsapp/guides/platform/errors/index.md) — the envelope and the code ranges - [API reference: media](/channel/whatsapp/api/resources/media/index.md) and [attachments](/channel/whatsapp/api/resources/attachments/index.md) --- # Message types URL: https://docs.linqapp.com/channel/whatsapp/guides/messaging/message-types/ A message’s content is its `parts` array, and each part’s `type` decides what the customer sees. Send one part per request, with either `POST /v1/messages` or the chat route `POST /v1/chats/{chat}/messages`. A request with two parts is refused with `error.code` [1019](/channel/whatsapp/error/codes/1xxx/1019/index.md). | `type` | Customer sees | In window | Outside window | | ----------------------------------------------- | -------------------- | --------- | -------------- | | [`text`](#text) | Text | Yes | No | | [`media`](#media) | Image, video, file | Yes | No | | [`location`](#location) | Map pin | Yes | No | | [`contacts`](#contacts) | Contact cards | Yes | No | | [`reaction`](#reaction) | Emoji on a message | Yes | No | | [`interactive_buttons`](#interactive_buttons) | Reply buttons | Yes | No | | [`interactive_list`](#interactive_list) | Pick-list menu | Yes | No | | [`interactive_cta_url`](#interactive_cta_url) | Link button | Yes | No | | [`interactive_carousel`](#interactive_carousel) | Scrolling cards | Yes | No | | [`location_request`](#location_request) | Send-location button | Yes | No | | [`contact_request`](#contact_request) | Share-contact button | Yes | No | | [`template`](#template) | Approved template | Yes | Yes | The window is the 24-hour customer window. Outside it only an approved `template` sends; anything else is refused with `error.code` [2036](/channel/whatsapp/error/codes/2xxx/2036/index.md). See [Sending messages](/channel/whatsapp/guides/messaging/sending-messages#choose-content-from-the-customer-window/index.md) for the window, idempotency and outcomes. The exact schema for each part is served at `GET /v1/parts/{type}`. Content that breaks a limit is rejected with a JSON Pointer to the field, never truncated or converted. Examples below show the request body for the chat route, `POST /v1/chats/{chat}/messages`. With `POST /v1/messages`, add the customer’s address as `to`. ## text Plain text. URLs render as tappable links. ``` { "parts": [{ "type": "text", "body": "Your order is on its way." }] } ``` - `body`: required, up to 4,096 characters, not blank. - `preview_url`: `true` shows a preview card for the first URL. Default `false`. ## media One image, video, audio file, document or sticker. Name the bytes with exactly one of `upload_ref` (from `POST /v1/media`) or `source_url` (a public `https` address fetched once, before the send is accepted). [Attachments](/channel/whatsapp/guides/messaging/attachments/index.md) covers both routes. ``` { "parts": [ { "type": "media", "kind": "image", "upload_ref": "upload.example", "caption": "Today's menu" } ] } ``` - `kind`: `image`, `video`, `audio`, `document` or `sticker`. - `caption`: up to 1,024 characters; `image`, `video` and `document` only. - `filename`: up to 240 characters; `document` only. - `source_url`: up to 2,048 characters. | `kind` | Upload limit (bytes) | Media types | | ---------- | --------------------------------- | ---------------------------------------- | | `image` | 5,000,000 | JPEG, PNG | | `video` | 16,000,000 | MP4, 3GPP | | `audio` | 16,000,000 | AAC, AMR, MPEG, MP4, Ogg | | `document` | 100,000,000 | Plain text, PDF, Word, Excel, PowerPoint | | `sticker` | 100,000 static / 500,000 animated | WebP | ### Voice notes An `audio` part with `"voice": true` arrives as a voice note instead of an audio file. ``` { "parts": [ { "type": "media", "kind": "audio", "upload_ref": "upload.example", "voice": true } ] } ``` - The upload must be `audio/ogg` holding mono Opus audio. Bytes are never converted. - 512 KB or smaller shows a play button; larger is delivered but must be downloaded first. ## location A map pin. ``` { "parts": [ { "type": "location", "latitude": 37.7749, "longitude": -122.4194, "name": "Downtown store", "address": "100 Main St, San Francisco, CA" } ] } ``` - `latitude` (−90 to 90) and `longitude` (−180 to 180): required, never defaulted. - `name`, `address`: optional, up to 1,000 characters each. ## contacts One or more contact cards. ``` { "parts": [ { "type": "contacts", "contacts": [ { "name": { "formatted_name": "Ana Ruiz" }, "phones": [{ "phone": "+15550101234", "kind": "CELL" }] } ] } ] } ``` - 1 to 5 cards. - `name.formatted_name`: required, up to 512 characters, not blank. - Optional `phones`, `emails`, `urls`, `addresses`, `org`, `birthday` (`YYYY-MM-DD`). - `origin` is response-only and appears on inbound cards; a send carrying it is refused. See [`contact_request`](#contact_request). ## reaction An emoji on an earlier message in the chat. ``` { "parts": [{ "type": "reaction", "message_id": "msg_example", "emoji": "👍" }] } ``` - `message_id`: the API’s own message id, not `channel_message_id`. - `emoji`: required; an empty string removes your earlier reaction. - Ends at `sent`: no delivered or read receipt. See [React to a message](/channel/whatsapp/guides/messaging/sending-messages#react-to-a-message/index.md). ## interactive\_buttons Body text with up to three reply buttons. A tap arrives as an [`interactive_reply`](#messages-you-receive) with `kind: "button_reply"` and the button’s `id`. ``` { "parts": [ { "type": "interactive_buttons", "body": "Did your order arrive?", "buttons": [ { "id": "arrived-yes", "title": "Yes" }, { "id": "arrived-no", "title": "No" } ] } ] } ``` - `body`: up to 1,024 characters. - `buttons`: 1 to 3. `title` up to 20 characters, `id` up to 256; both unique. - `header` (text, up to 60) or `media_header` (`image`, `video` or `document` by `upload_ref`), not both. - `footer`: up to 60 characters. ## interactive\_list Body text with a button that opens a sectioned list. A pick arrives as an [`interactive_reply`](#messages-you-receive) with `kind: "list_reply"` and the row’s `id`. ``` { "parts": [ { "type": "interactive_list", "body": "Choose a delivery slot.", "button": "See slots", "sections": [ { "rows": [ { "id": "slot-am", "title": "Morning", "description": "8am to 12pm" }, { "id": "slot-pm", "title": "Afternoon", "description": "12pm to 5pm" } ] } ] } ] } ``` - `button`: up to 20 characters. `body`: up to 1,024. - `sections`: 1 to 10; a section `title` (up to 24) is required once there are two or more. - Up to 10 rows in total across all sections. Row `id` up to 200, unique across sections. - Row `title` up to 24, `description` up to 72. - `header`, `footer`: text only, up to 60 characters. ## interactive\_cta\_url Body text with one button that opens a URL. ``` { "parts": [ { "type": "interactive_cta_url", "body": "Track your parcel.", "display_text": "Track", "url": "https://example.com/track/A-1042" } ] } ``` - `display_text`: up to 20 characters. - `url`: absolute `http` or `https`, up to 2,000 characters. - `header` (text, up to 60) or `media_header`, not both. - `footer`: text only, up to 60 characters. ### Media header `media_header` shows an uploaded image, video or document above the body. Upload the file with `POST /v1/media`, then name it with the matching `kind`: ``` { "parts": [ { "type": "interactive_cta_url", "media_header": { "kind": "document", "upload_ref": "upload.example", "filename": "Menu.pdf" }, "body": "This week's menu", "display_text": "Order now", "url": "https://example.com/order" } ] } ``` - `kind`: `image`, `video` or `document`, matching the upload’s kind. - `filename`: up to 240 characters; `document` only. - `header` with `media_header`, or `filename` on an image or video header, is refused with `422 invalid_content` and a pointer at the member. - A missing upload is refused with `422 upload_ref_not_found`; an upload of another kind with `422 upload_ref_invalid`. ## interactive\_carousel A body above 2 to 10 cards that scroll sideways, each showing an image or a video. For image cards, upload each image with `POST /v1/media`, then list the cards in `card_index` order. ``` { "parts": [ { "type": "interactive_carousel", "body": "Three new listings near you", "cards": [ { "card_index": 0, "header": { "kind": "image", "upload_ref": "upload.example0" }, "body": "2 bed, garden", "reply_buttons": [{ "id": "listing-0-like", "title": "Like" }] }, { "card_index": 1, "header": { "kind": "image", "upload_ref": "upload.example1" }, "body": "Loft, city view", "reply_buttons": [{ "id": "listing-1-like", "title": "Like" }] }, { "card_index": 2, "header": { "kind": "image", "upload_ref": "upload.example2" }, "body": "Studio, near park", "reply_buttons": [{ "id": "listing-2-like", "title": "Like" }] } ] } ] } ``` - `body`: up to 1,024 characters. - `cards`: 2 to 10. `card_index` starts at 0 and matches the card’s position. - Card `header`: an `image` by `upload_ref`, or a `video` by `url` ([video cards](#video-cards)). - Every card has the same header kind: all images or all videos. - Card `body`: optional, up to 160 characters and two line breaks. - Each card has one `url_button` (`display_text` up to 20, absolute `https` `url` up to 2,000) or 1 to 2 `reply_buttons`. - Every card has the same kind of button, and the same number of reply buttons. - Reply button `id`: up to 256, unique across the whole carousel. `title`: up to 20, unique within a card. A reply-button tap arrives as a [`template_reply`](#messages-you-receive) whose `payload` is the button’s `id`. Nothing else names the card, so the `id` is the card’s identity. A URL-button tap sends you no event. ### Video cards A video card names the public `https` address its video plays from, in `header.url`, instead of an upload: ``` { "parts": [ { "type": "interactive_carousel", "body": "Take a tour before you visit", "cards": [ { "card_index": 0, "header": { "kind": "video", "url": "https://cdn.example.com/tour-0.mp4" }, "body": "Virtual tour", "url_button": { "display_text": "Book", "url": "https://example.com/book/0" } }, { "card_index": 1, "header": { "kind": "video", "url": "https://cdn.example.com/tour-1.mp4" }, "body": "Garden walk-through", "url_button": { "display_text": "Book", "url": "https://example.com/book/1" } } ] } ] } ``` - An image card takes `upload_ref` and a video card takes `url`; the other way round is refused. - `url`: up to 2,000 characters, absolute `https`, with its host named by a DNS name (no IP address, no percent-escapes in the host), no port (omit it), no credentials, no fragment, and no spaces or control characters. Anything else is refused with `422 invalid_content`, never rewritten. - The video is never fetched before the send: the address is sent exactly as written, so it must be publicly reachable and serve a playable video. - A link the customer’s WhatsApp cannot fetch is accepted, then reported as `message.failed` with the failure code `channel_refused`. See [Why a message failed](/channel/whatsapp/guides/messaging/sending-messages#why-a-message-failed/index.md). - WhatsApp fetches each linked video before delivering, so a carousel with video cards can arrive after messages you send behind it. If order matters, wait for its `message.delivered` before sending the next message. ## location\_request A prompt with a send-location button. The answer arrives as a `location` part. ``` { "parts": [ { "type": "location_request", "body": "Share your location so we can find the nearest store." } ] } ``` - `body`: required, up to 1,024 characters. `address_request` also appears in the reference. It is reserved and cannot be sent yet. ## contact\_request A prompt with a button that shares the customer’s own contact card with one tap. Useful when you know a customer only by a [username](/channel/whatsapp/guides/messaging/sending-messages#customers-who-use-a-username/index.md) and need a phone number. ``` { "parts": [ { "type": "contact_request", "body": "Share your number so we can call you back." } ] } ``` - `body`: required, up to 1,024 characters, not blank. The shared card arrives as an ordinary inbound [`contacts`](#contacts) part. Each inbound card may carry `origin`: | `origin` | Meaning | | ----------------- | ---------------------------------------------- | | `contact_request` | The customer tapped your share-contact button. | | `other` | The customer sent a card themselves. | | absent | Not reported. | New values may appear; treat any other value as unrecognised. The shared card is not linked as a reply, so its message carries no `reply_to_message_id`: match it to your request by `origin` and timing. ``` { "parts": [ { "type": "contacts", "contacts": [ { "name": { "formatted_name": "Ana Ruiz" }, "phones": [ { "phone": "+15550101234", "messaging_id": "15550101234" } ], "origin": "contact_request" } ] } ] } ``` ## template An approved template, and the one type that sends outside the window. Read each template’s `send_schema` from `GET /v1/templates` and fill its named `parameters`. ``` { "parts": [ { "type": "template", "name": "order_shipped", "language": "en_US", "parameters": { "order_id": "A-1042" } } ] } ``` - `name`: lowercase letters, digits and underscores, up to 512 characters. - `language`: a code such as `en_US`, up to 32 characters. - `header`, `buttons`, `cards`: only when the template’s `send_schema` asks for them. - Authentication templates take one parameter, `code`, 1 to 15 characters. See [Templates](/channel/whatsapp/guides/templates/index.md) to register one. ## Messages you receive Inbound messages use the same `parts` array. These types arrive inbound; the last seven are never sendable. | `type` | What it is | | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `text` | Text from the customer. | | `media` | A file. Carries `media_id` and a download `url`; see [Download incoming attachments](/channel/whatsapp/guides/messaging/sending-messages#download-incoming-attachments/index.md). | | `location` | A shared location, including an answer to `location_request`. | | `contacts` | Contact cards, including an answer to `contact_request`. Each card may carry `origin`; see [`contact_request`](#contact_request). | | `reaction` | An emoji on a message. Carries `channel_message_id`, and `message_id` when the chat holds the target. | | `interactive_reply` | A tap on `interactive_buttons` (`button_reply`) or `interactive_list` (`list_reply`). `id` is yours. | | `template_reply` | A tap on a template quick-reply button or a carousel reply button. `payload` is the button’s value or `id`; `text` is its label. | | `address_reply` | A structured address the customer submitted. | | `order` | An order placed from a product catalog. | | `referral` | The ad or post a first message came from. Opens a longer window. | | `system` | A chat event, such as the customer changing number. `body` is readable. | | `unsupported` | A message kind not yet typed. `raw` holds the original payload. | For a template tap, the message’s `reply_to_message_id` names the template message that carried the button. --- # Sending messages URL: https://docs.linqapp.com/channel/whatsapp/guides/messaging/sending-messages/ There are two ways to send. `POST /v1/messages` takes a destination and lets Linq select the eligible line and existing chat. `POST /v1/chats/{chat}/messages` sends within a chat you already know. Both return the same accepted-message shape and support idempotency. For every part type you can send, with examples and limits, see [Message types](/channel/whatsapp/guides/messaging/message-types/index.md). To message a customer outside the customer window, see [Templates](/channel/whatsapp/guides/templates/index.md). WhatsApp separates service messages, sent during the customer window, from template messages in marketing, utility, and authentication categories. See [service messages](https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-messages/) and [marketing, utility, and authentication templates](https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates/) for the channel rules. The Linq part schemas remain the authority for shapes accepted by this API. ## Pricing Since October 1, 2026, Meta charges for service messages as well as templates. Each business phone number gets 1,000 free service messages per month. The allowance resets monthly and does not roll over. After that, Meta charges each service message at the market’s utility rate. A utility template sent while the customer window is open is also charged. Meta’s rules are on its [non-template message pricing](https://developers.facebook.com/documentation/business-messaging/whatsapp/pricing/non-template-messages) page. Meta bills these charges to the payment method on your WhatsApp Business Account. Replies inside the customer window count toward your Linq spend limits. A daily cap still lets those replies through. The monthly account cap stops every send, replies included, until the cap resets at the start of the next UTC month. ## Always make sends idempotent Set `Idempotency-Key` to a stable value for the logical send. If a timeout leaves the response unknown, retry the same route with the same key and body. Do not generate a new key for a transport retry, and do not reuse a key for different content. With zero-day retention, an idempotent retry returns empty `parts` and `zero_retention: true`; the original response still includes the content. ## Choose content from the customer window The chat read exposes `customer_window`. While it is open, you may send free-form parts such as text or media. Outside it, send one approved `template` part. An out-of-window free-form request is refused with HTTP `422` and `error.code` [2036](/channel/whatsapp/error/codes/2xxx/2036/index.md); Linq does not replace your content. ``` { "to": "+15551234567", "parts": [{ "type": "text", "body": "How can we help?" }] } ``` ``` { "to": "+15551234567", "parts": [ { "type": "template", "name": "order_update", "language": "en_US", "parameters": { "order_number": "A-1042" } } ] } ``` The values above are illustrative. Read `GET /v1/templates` and validate each send against the selected template’s `send_schema`. The part schema served by `GET /v1/parts/{type}` defines the common template fields. Validation rejects invalid content and returns JSON Pointers to the most specific identifiable field. ## Customers who use a username A customer can use a WhatsApp username and keep their phone number hidden. For that customer, the chat’s `customer` is a username id rather than a phone number. Events such as `message.received` identify the chat by `chat_id`; read the chat with `GET /v1/chats/{chat}` to get its `customer`: ``` { "to": "US.13491208655302741918", "parts": [{ "type": "text", "body": "Thanks, we're on it." }] } ``` The id is a two-letter country code, a period, and up to 128 letters and digits; a longer form such as `US.ENT.…` also exists. Treat every customer id as opaque: - store it as a string, and never parse it, validate it, or format it as a phone number; - reply by copying `customer` into `to` exactly as delivered, or send on `POST /v1/chats/{chat}/messages`, which needs no address. Every message type works with a username id except one-time-code authentication templates (copy code, one-tap, or zero-tap autofill), which can be delivered only to a phone number. Such a send is refused with HTTP `422` and `error.code` [4011](/channel/whatsapp/error/codes/4xxx/4011/index.md), and nothing is sent; deliver the code another way. If the refusal can only be known after acceptance, the message fails with `recipient_phone_number_required` instead. ## Follow the outcome HTTP `202` means accepted, not delivered. Consume event signals, then read `GET /v1/chats/{chat}/events` for the message’s current state. Terminal outcomes are delivered, read, or failed. If no terminal evidence arrives, keep the outcome unresolved rather than blindly resending. ## Why a message failed A message whose `status` is `failed` may carry a `failure` object beside it: a `code` you can branch on and a `message` written for a person reading it. It is present only when the channel’s refusal has a reason in the published vocabulary, so a message that failed on the wire may carry no `failure` at all. Its absence means “no published reason”, never “no reason”. `status` stays the thing to branch on. Codes are added over time, so treat a code you do not recognise exactly as you treat a message with no `failure`: the message failed, terminally, and `status` already told you that. Never branch on `message` — the wording is written for a person and is not stable. The reason lives on the message itself, not on the event that announces it. Read it from the message rows of `GET /v1/chats/{chat}/events`, including the message a `message.failed` [webhook](/channel/whatsapp/guides/webhooks/index.md) or [stream event](/channel/whatsapp/guides/events/index.md) points you to; the event carries only the chat id and its sequence range. ``` { "id": "msg_example", "chat_id": "chat_example", "direction": "outbound", "status": "failed", "failure": { "code": "recipient_country_restricted", "message": "the business behind the sending number is not currently permitted to message customers in this recipient's country, so the message was not delivered and sending it again cannot succeed" }, "parts": [{ "type": "text", "body": "How can we help?" }], "created_at": "2026-09-16T14:02:11Z" } ``` The ids and `message` above are illustrative. The published codes today: | Code | Meaning | What to do | | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `sender_deregistered` | The number this message was going out from is no longer a registered sending number, and the message never left. Terminal: it is not a pause and it does not clear, so retrying the same message cannot succeed and that conversation is over. | Reach this customer by starting a new conversation on another of your numbers with a template, exactly as you would any customer whose 24-hour window has closed. `GET /v1/chats` shows which number each conversation uses. | | `quality_hold_expired` | This marketing message remained held by an automatic safety control on its sending line for ten minutes and was not sent. Terminal: retrying the same message cannot succeed on that conversation. | Send marketing from another of your numbers with a template, or contact support about the sending line. | | `recipient_country_restricted` | The business behind the sending number is not currently permitted to message customers in this recipient’s country, so the message was not delivered. Terminal for the message: sending it again cannot succeed while the restriction stands. It can arrive as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. | Most often the business has not yet completed business verification: complete it, and until then message customers in the sending number’s own country. If the business is already verified, review the messaging policy for the business’s category. There is no way to ask about the restriction ahead of a send. | | `payment_method_required` | The business behind the sending number has no working payment method on its messaging account, so the message was not sent. Terminal for the message: sending it again cannot succeed until a payment method is added. It can arrive as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. | Add or update the payment method in the messaging account’s billing settings, then send again as a new message. A number’s replies inside an open 24-hour customer window keep being delivered while they stay within its 1,000 free service messages for the month, so a working free-form reply beside a failed template is possible. Past that allowance, replies need the payment method too. See [pricing](#pricing). | | `recipient_phone_number_required` | This customer is known only by a username id, not a phone number, and this message can be delivered only to a phone number, so it was not sent. Terminal for the message: sending it again to this customer cannot succeed. It can arrive as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. | One-time-code authentication templates are the usual cause; deliver the code another way. Other messages, including templates without a one-time-code button, can still be sent to this customer. See [customers who use a username](#customers-who-use-a-username). | | `business_restricted` | The business behind the sending number is most likely restricted on its messaging account, so the message was not sent. Terminal for the message: sending it again will not succeed while the restriction stands. It can arrive as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. | Review the status of the business’s messaging account. If the business believes it complies with the messaging policies, request a review of the restriction. | | `channel_refused` | The message was refused before delivery and was not sent, for a reason that has no more specific code yet. It is not retried automatically. It can arrive as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. A more specific code may be published for some of these later. | Contact support with the message’s `id` to learn the reason and whether sending it again can succeed. Treat a code you do not recognise exactly as you treat this one. | You are not billed for a message that failed with any of these codes. ## Send media A `media` part names its bytes either by an `upload_ref` from `POST /v1/media` or by a public `https` address in `source_url`, which the API fetches once before accepting the send. The [attachments guide](/channel/whatsapp/guides/messaging/attachments/index.md) covers both routes, the address policy, and the refusal codes. ## React to a message A `reaction` part carries an emoji and the message it belongs to. Address the target with `message_id` — this API’s own `Message.id`, the value returned when the message was accepted and shown in the transcript — not the channel’s `channel_message_id`, which is inbound-only and refused on a send with `error.code` [1006](/channel/whatsapp/error/codes/1xxx/1006/index.md). ``` { "parts": [{ "type": "reaction", "message_id": "msg_example", "emoji": "👍" }] } ``` Send the same target with an empty `emoji` to remove your earlier reaction. An absent `emoji` is rejected rather than read as a removal. A reaction is a free-form part, so it follows the customer window like text. The target must also be a message this account can see in the chat you are sending to, and one the channel has acknowledged if this API sent it: | Refusal | Meaning | | -------------------------------------------------------- | -------------------------------------------------------------------------- | | [2049](/channel/whatsapp/error/codes/2xxx/2049/index.md) | No message with that id is visible to this account. | | [1040](/channel/whatsapp/error/codes/1xxx/1040/index.md) | The message belongs to a different chat than the one you are sending to. | | [2050](/channel/whatsapp/error/codes/2xxx/2050/index.md) | This API accepted the message but the channel has not acknowledged it yet. | All three are HTTP `422` pointered at `/parts/0/message_id`. Two behaviours differ from other sends and are easy to get wrong. **A reaction ends at `sent`.** The channel reports no delivered or read receipt for one, so do not wait for a terminal outcome beyond `sent` the way you would for a text. It can still end `failed` if the channel refuses it. **For [2050](/channel/whatsapp/error/codes/2xxx/2050/index.md), poll the target’s `status` until it reads `sent`** — the same moment its `channel_message_id` appears — and then resend. Do not wait on the target’s `message.sent` event: that fires when this API accepts a send, not when the channel acknowledges it, so it has usually already arrived when the refusal happens. The channel will not deliver a reaction whose target is more than 30 days old, deleted, missing from the thread, or itself a reaction. That is refused on the wire after your send was accepted, so it surfaces as a failed message rather than a `422`. ## Mark a chat read `POST /v1/chats/{chat}/read` marks the customer’s messages read, and with `{"typing": true}` also shows a typing indicator. It targets the newest unread inbound message the channel can mark read. HTTP `202` means the command was accepted; the `chat.read` event names the message it targeted. **Unsupported messages are never targeted.** Some things a customer can send, such as a poll, reach you as an `unsupported` part, and the channel refuses to mark those read. The command skips them and targets the newest supported message instead. An unsupported message stays unread on the customer’s phone even after a later message is marked read. | Refusal | Meaning | | -------------------------------------------------------- | ---------------------------------------------------------------- | | [2035](/channel/whatsapp/error/codes/2xxx/2035/index.md) | `nothing_unread`: the chat has no unread inbound message. | | [2056](/channel/whatsapp/error/codes/2xxx/2056/index.md) | `nothing_readable`: every unread inbound message is unsupported. | Both are HTTP `409`, and neither changes anything. If you mark a chat read after every inbound message, treat both as “nothing to do” rather than a failure. ## Download incoming attachments A fresh `message.received` [webhook](/channel/whatsapp/guides/webhooks/index.md) includes `data.message`, so you can read its `parts` without fetching the message again. Look for a `media` part with a `url`. For example, an incoming document: ``` { "type": "media", "kind": "document", "filename": "invoice.pdf", "media_id": "example-inbound-media-id", "url": "https://whatsapp.messages.api.linqapp.com/v1/attachments/media_example/content", "availability": "available" } ``` Use the returned `url` with `GET /v1/attachments/{attachment}/content`. It requires your account’s Bearer API key on every download; it is not a public file link. Download from your server and keep the key out of browser code and logs. Only attach credentials to the trusted WhatsApp API origin shown below, and do not follow redirects. Terminal window ``` # Use the document part's returned URL, not its media_id or upload_ref. ATTACHMENT_URL='https://whatsapp.messages.api.linqapp.com/v1/attachments/media_example/content' file=$(mktemp) || exit 1 trap 'rm -f "$file"' EXIT status=$(curl --silent --show-error \ --proto '=https' --max-time 30 \ --header "Authorization: Bearer ${LINQ_WHATSAPP_API_KEY}" \ --output "$file" --write-out '%{http_code}' \ "$ATTACHMENT_URL") || exit 1 if [ "$status" = 200 ]; then mv "$file" invoice.pdf else printf 'Attachment download returned HTTP %s\n' "$status" >&2 exit 1 fi ``` This example makes one request and saves the original bytes on HTTP `200`. It intentionally omits `--location`, so credentials are not forwarded through a redirect. In your application, accept only `200` as a successful download and choose the local output filename yourself. See the [attachment reference](/channel/whatsapp/api/resources/attachments/index.md) for the response contract and [error handling](/channel/whatsapp/guides/platform/errors/index.md). ### When the file is ready For all WhatsApp accounts, a `message.received` event for a message with attachments waits until every attachment has been captured or has failed, or ten minutes have elapsed since Linq received the message, whichever comes first. It is not released earlier while capture is pending. At the deadline, any still-pending attachment is marked `unavailable` with reason `timed_out`; capture continues and the file may become downloadable later. The ten-minute deadline bounds the capture wait, not webhook delivery or retries. Each incoming `media` part may carry two response-only fields: | `availability` | `unavailable_reason` | Download | | -------------- | -------------------- | ------------------------------------------------------------------------------------------ | | `available` | — | `200` at once. | | `unavailable` | `timed_out` | Not captured within ten minutes. Capture continues: `409` until ready, then `200`. | | `unavailable` | `capture_failed` | Could not be retrieved. `410`, or `404` once the file is no longer known. | | `unavailable` | `expired` | No longer retained, or no longer known. `410` or `404`. | | `pending` | — | Capture not finished. Returned only by reads of the conversation, never by an event. | | absent | — | Historical event or message; may still be capturing. Retry `409` as `Retry-After` directs. | - `unavailable_reason` is an open string. Treat an unknown value as `capture_failed`. - The fields describe the file, not the exact answer of a later download, which can also refuse for capacity or authorization. - An event keeps the values it was recorded with. Reads of the conversation, such as `GET /v1/chats/{chat}/events`, return the current ones. - A missing `byte_size` is not final: it appears once the bytes are captured. - Both fields are refused on sends. Because an event can wait for its attachments, it can arrive after events for later messages of the same chat. See [Events and recovery → Messages with attachments](/channel/whatsapp/guides/events#messages-with-attachments/index.md). ### Download responses | Response | Action | | -------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `409`, code [2007](/channel/whatsapp/error/codes/2xxx/2007/index.md) | Capture is still pending. Wait at least `Retry-After` before retrying. Use a bounded policy, such as at most three attempts within 30 seconds; if the requested wait exceeds the remaining budget, stop and schedule a later attempt. A `timed_out` attachment can keep answering `409` and later download. | | `410`, code [2043](/channel/whatsapp/error/codes/2xxx/2043/index.md) | The attachment failed or expired. This is final: stop retrying this download. | | `404`, code [2003](/channel/whatsapp/error/codes/2xxx/2003/index.md) | No downloadable attachment is visible to this key, including missing or pruned files. Check the URL and account credentials; do not retry blindly. | Older events may contain only a chat and sequence range. Read `GET /v1/chats/{chat}/events` when `data.message` is absent, and download only parts that actually include a `url`. The URL is response-only; do not include it when sending a message. --- # Phone numbers URL: https://docs.linqapp.com/channel/whatsapp/guides/phone-numbers/ `GET /v1/phone_numbers` returns the Linq lines attached to your account and their current channel state. Sends select among eligible lines. The `quality` field preserves the token reported by the channel. Empty means no rating has been reported. An unfamiliar non-empty token remains visible without a `quality_band`; a recognized token carries both. Treat `quality_band` as Linq’s provisional placement, not a replacement for the original token. The messaging-tier token is also reported verbatim. This API version does not publish a numeric ceiling, so do not infer one from a token or hard-code a vendor table. --- # Data retention URL: https://docs.linqapp.com/channel/whatsapp/guides/platform/data-retention/ By default, we keep message content under the standard policy described throughout this API. Two opt-in settings remove it sooner: **ephemeral messages** and **zero-day retention**. They only apply to messages created after they’re turned on, and if both are on, zero-day retention wins. Both settings remove message **content**: text, attachments, and the other parts of a message. The record that a message existed stays. That means its IDs, chat, phone numbers, timestamps, direction, delivery status, and billing records. Capture content when you first see it Nothing tells you when content is removed. If your integration needs a message’s text or an attachment later, save it the first time you see it: in the response to your send, or in the webhook when you receive it. ## What’s removed and what’s kept | Removed | Kept | | --------------------------------------- | -------------------------------------------------------------------------------- | | Message text | Message and chat IDs | | Attachment files | Phone numbers | | Every other part of a message’s content | Timestamps and direction | | | Delivery status and `message.sent` / `message.delivered` / `message.read` events | | | Billing records | | | The attachment’s ID | ## What these settings cover They cover the copies Linq holds: our databases, storage, queues, and backups. They don’t reach Meta. WhatsApp messages sent and received through Linq go through Meta’s hosted WhatsApp Business Platform. Meta decrypts and processes the content on its own servers and keeps its own copy under its own terms. Turning on either setting doesn’t change what Meta keeps or for how long. ## Ephemeral messages Content is removed after a window set for your account, anywhere from **1 to 24 hours** (24 hours by default). The window applies to your whole account, to messages you send and messages you receive, and it starts when the message is created. A message you’re still sending keeps its content until delivery finishes, even if that runs past the window. The same goes for a message whose delivery result we’re still waiting on. Messages you receive don’t have that hold. Once the window has passed: - The message disappears from transcript reads, the event log, the live stream, and replays. Transcripts normally have no gaps in their sequence numbers, and expired ephemeral messages are the one exception. - Its IDs, timestamps, phone numbers, direction, delivery status, and billing records stay, and keep working normally. - There’s no expiry timestamp in the API. If you need to know when a message will go, add your window to its `created_at`. - An idempotent retry of the send returns empty `parts` once the content is removed. Removal isn’t instant. Treat the window as a minimum; content usually goes within a few minutes after it. ## Zero-day retention ### The rule, in one table | | Messages you send | Messages you receive | | ------------------------------------------ | --------------------------------- | ----------------------------------------------------------------------------- | | **Where you see the content** | The response to your send request | Your webhook deliveries for that message | | **Transcript, event log, stream, replays** | No content, ever | No content, ever | | **How long we hold it** | Until delivery finishes | Until every webhook endpoint has it, or has spent 35 minutes returning errors | An idempotent retry of a send returns empty `parts` and `zero_retention: true`. For messages you receive, the webhook is the only way to get the content. The live stream and the event log never carry it, even right after the message arrives. Zero-day messages need a webhook If a number doesn’t have an enabled webhook endpoint, you won’t receive the content of its zero-day inbound messages anywhere. We remove it shortly after it arrives. Content you receive is removed once every webhook endpoint subscribed to it has received it successfully, or has spent **35 minutes returning errors**. Only time when your endpoint is returning errors counts. Network trouble, problems on our side, and scheduling delays don’t. One endpoint running out its 35 minutes never removes content another endpoint is still owed. An attachment on a zero-day message has its own clock. It’s removed after your first completed download, or about 35 minutes after the webhook that carried it was received, whichever comes first. Time when our download endpoint is failing doesn’t count. ### How to tell a message is zero-day Zero-day messages carry `zero_retention: true`, both in webhooks and when you read them back. On every other message the field is absent. Check this field on each payload rather than keeping your own list of which numbers are zero-day, because settings can change. message.received webhook on a zero-day number ``` { "id": "evt_example", "type": "message.received", "timestamp": "2026-09-24T11:00:00Z", "data": { "message": { "id": "msg_example", "direction": "inbound", "parts": [{ "type": "text", "body": "I'd like to reschedule" }], "zero_retention": true } } } ``` Reading the same message back later ``` { "id": "msg_example", "direction": "inbound", "parts": [], "zero_retention": true } ``` The values are just examples. An empty `parts` on a zero-day message is expected, not an error. ## Attachments The same attachment can belong to more than one message, for example one upload sent to several customers. We keep it until every message that uses it is due for removal and no delivery in progress still needs it. If any message using it has standard retention, the attachment stays available. Once an attachment is removed, downloading it returns an error instead of the file. ## Edge cases A few things work differently from the rules above. In each case we keep content longer than the setting says; we never remove it early. - **Backups.** A backup taken before content was removed can briefly still hold it. - **Messages received during a database outage.** If we accept a message while we can’t check your settings, it’s kept under standard retention, even after things recover. We never apply a setting to it later. - **Messages we couldn’t process.** If a message runs into a processing problem after we accept it, we keep it until someone on our side resolves it by hand. This is the one case with no time limit. ## Sending and delivery don’t change Messages under either setting send, deliver, and report status like any other message. `POST /v1/messages`, `POST /v1/chats/{chat}/messages`, and the usual `message.sent`, `message.delivered`, and `message.read` events all work normally. Only how long we keep the content changes. Nothing tells you when content has been removed. Save what you need from the send response or the webhook when it arrives, because that may be your only chance. ## Best practices - **Save what you need when you first see it.** For zero-day messages, the send response and the webhook are the only places the content appears. - **Make sure every zero-day number has a webhook endpoint.** Without one, you never receive its inbound content. - **Download zero-day attachments right away.** They’re removed after your first download, or about 35 minutes after the webhook. - **Don’t treat an empty `parts` as an error** on a zero-day message, or a missing message in a transcript on an ephemeral account. - **Check `zero_retention` on each payload** instead of guessing from the number or chat. ## Related - [Sending messages](/channel/whatsapp/guides/messaging/sending-messages/index.md) — send routes, idempotency, and delivery outcomes - [Attachments](/channel/whatsapp/guides/messaging/attachments/index.md) — upload, download, and the authenticated attachment URL - [Webhooks](/channel/whatsapp/guides/webhooks/index.md) — registering endpoints and verifying deliveries - [Events and recovery](/channel/whatsapp/guides/events/index.md) — the live stream and the event log - [Errors](/channel/whatsapp/guides/platform/errors/index.md) — the envelope and the code ranges --- # Errors URL: https://docs.linqapp.com/channel/whatsapp/guides/platform/errors/ Every failure uses the same envelope: ``` { "success": false, "error": { "status": 422, "code": 1001, "message": "Field required.", "doc_url": "https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1001/", "param": "/parts/0/body", "details": [ { "code": "field_required", "param": "/parts/0/body", "message": "Body is required." } ] }, "request_id": "req_…" } ``` `error.status` is the HTTP status the response was written with, `error.code` is a number, and `error.message` is for a human reading a log — it may be reworded at any time, so never match on it. Every code has a page in the [error code reference](/channel/whatsapp/error/index.md), which also carries the complete tables. ## Branch on the code, fall back to the range Codes are allocated into five ranges. The range says what kind of failure it is; together with `error.status` it says whether the request or the service was at fault. | Range | Category | Retry? | | ----------------------------------------------------------------------------------- | ------------------------------------- | ------------------------------------------------------------ | | [1xxx](/channel/whatsapp/error#1xxx--request-errors/index.md) | Request errors | No — correct the request first | | [2xxx](/channel/whatsapp/error#2xxx--resource-permission-and-state-errors/index.md) | Resource, permission and state errors | No — inspect or reconcile that state | | [3xxx](/channel/whatsapp/error#3xxx--service-errors/index.md) | Service errors | Yes — bounded backoff, unless the code’s page says otherwise | | [4xxx](/channel/whatsapp/error#4xxx--operational-and-send-refusals/index.md) | Operational and send refusals | Sometimes — follow the code’s remedy | | [5xxx](/channel/whatsapp/error#5xxx--attachment-and-file-errors/index.md) | Attachment and file errors | Sometimes — follow the code’s remedy | The set of codes grows additively. Branch on the integers you know, and treat an integer you do not know by its range plus the HTTP status that came with it — a `3xxx` with a `503` is retryable, a `1xxx` with a `422` is not, and an integer outside every range is a generic failure. Do not model the codes as a closed enum. A number is never removed and never reassigned to a different failure: once it means something, it means that forever, so a branch you write today stays correct. ## Honor `retry_after` When `error.retry_after` is present, it overrides the range guidance above: wait that many seconds, then retry. It appears exactly when the response also carries a `Retry-After` header, with the same value, so either source is safe to read. A `3xxx` with no `retry_after` is retried with bounded exponential backoff, starting at 1 second and capping at 30. Sends are idempotent on `Idempotency-Key`, so retrying a send that actually succeeded returns the original result rather than sending twice. ## Read the optional members - `param` is present only when the response is about exactly one field and is that field’s JSON Pointer. A fault about the whole body points at the root, which is the empty string, so `param` may be present and empty. - `details` lists every field-level finding on a validation failure. Each entry has a string `code`, a JSON Pointer `param` naming the most specific request location the API could identify, and a `message`. Validation rejects and points; it never coerces a value into something acceptable. - `context` carries typed facts about the failure you may need to branch on, such as whether a customer window ever opened. Its members are documented on the codes that set them. - `doc_url` is the absolute address of the code’s page in the [error code reference](/channel/whatsapp/error/index.md), present on every response whose code has a published page and absent for a code reachable only on a surface that has not been released yet; it is derived from the code alone, so link to it rather than building the address yourself. - `trace_id` appears when a valid trace context exists. None of these is guaranteed on every error. ## Log what support needs Log the HTTP status, `request_id`, and `error.code`. Never log credentials or message content. Include `request_id` when contacting Linq support; it identifies the exact request in our logs. These codes belong to WhatsApp. Every channel numbers its own errors, so the same integer means something different on another channel — branch on the code only in code paths you know are talking to this API, and follow the `doc_url` it gives you rather than one from another channel. --- # Limits URL: https://docs.linqapp.com/channel/whatsapp/guides/platform/limits/ JSON request bodies are capped at 64 KiB. Larger bodies are rejected rather than truncated. Media uploads have kind-specific ceilings documented on the upload operation. Paging inputs are refused rather than clamped. Send a supported `limit` and preserve returned cursors exactly. ## Request rate Each API key has a request rate limit and a cap on open event streams. Going over returns HTTP `429` with `error.code` [4012](/channel/whatsapp/error/codes/4xxx/4012/index.md) or [4013](/channel/whatsapp/error/codes/4xxx/4013/index.md) and a `Retry-After` header. Wait that long and retry, and close event streams you don’t use. Handle HTTP `429` on every operation. It carries a registered numeric `error.code` and, wherever a retry time is honest, a `Retry-After` header mirrored by `error.retry_after`. What the wait means depends on the code — for [4006](/channel/whatsapp/error/codes/4xxx/4006/index.md) (a spend cap) it is the exact reset of the cap window; for [4008](/channel/whatsapp/error/codes/4xxx/4008/index.md) (the distinct-customer ceiling below) it is a minimum, and a retry then may still be refused. See [error handling](/channel/whatsapp/guides/platform/errors/index.md). The channel’s portfolio-level messaging tier is separate from this API’s request rate. The phone-number read exposes the reported tier token but does not publish a numeric ceiling in this version. --- # Templates URL: https://docs.linqapp.com/channel/whatsapp/guides/templates/ A template is reviewed copy you register once and send many times. It is the only message you can send outside the 24-hour customer window. Register with `POST /v1/templates`, read status and send shape with `GET /v1/templates`, and send it as a `template` part. Every other part type is on [Message types](/channel/whatsapp/guides/messaging/message-types/index.md). | Step | Call | What to read | | -------- | -------------------------------------------------- | ------------------------------------------ | | Register | `POST /v1/templates` | `status` (almost always `pending`) | | Wait | `template.updated` event, then `GET /v1/templates` | `status` until `approved`; `category` | | Compose | `GET /v1/templates` | `parameters` and `send_schema` | | Send | `POST /v1/messages` | `202` accepted; outcome on events | | Reply | inbound `template_reply` part | `payload` of the tapped quick-reply button | For WhatsApp’s template categories, review rules, and lifecycle, see the [WhatsApp Business Platform message template documentation](https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates/). Linq’s template endpoints are the authority for the request and response shapes you use with this API. ## Status Only an `approved` template can be sent. Approval is not permanent: a template may later be paused for quality and become approved again. Read the registry rather than caching approval forever. | `status` | Meaning | Sendable | | ---------- | --------------------------------------------------------------- | -------- | | `draft` | A submission attempt has not produced a registered template. | No | | `pending` | Under review. | No | | `approved` | Sendable once `send_schema` is published. | Yes | | `rejected` | Refused. `rejected_reason` may say why. | No | | `paused` | Held, usually for quality. Can return to `approved` on its own. | No | | `disabled` | No longer usable. | No | - Review takes minutes to several days. Do not poll for the outcome: listen for the [`template.updated` event](/channel/whatsapp/guides/events#template-events/index.md) and reconcile with `GET /v1/templates`, which stays the source of truth. - `send_schema` appears up to about fifteen minutes after approval; until then a send is refused. - `category` is the one review assigned, which can differ from what you submitted. It sets pricing and whether marketing rules apply. - A `draft` may be resubmitted only when `retry_allowed` is `true`. - New status values may appear. Treat any you do not recognise as not sendable. - `rejected_reason` and `quality` are free text. Never branch on their wording. ## Register a template ``` { "name": "order_shipped", "language": "en_US", "category": "utility", "body": { "text": "Your order {{order_id}} is on its way.", "examples": { "order_id": "A-1029" } } } ``` | Field | Limits | | --------------- | ----------------------------------------------------------------------------------- | | `name` | Lowercase letters, digits, underscores; up to 512. Permanent once submitted. | | `language` | A locale such as `en_US`, up to 32. Each language is registered separately. | | `category` | `utility`, `marketing` or `authentication`. | | `body.text` | Up to 1,024. Variables are `{{named}}`; numbered `{{1}}` is refused. At most 32. | | `body.examples` | One per variable, required. 1–1,024 characters; no line break, tab or four spaces. | | `footer` | Up to 60, no variables. | | `buttons` | Up to 10: at most two `url`, quick replies kept together. Label up to 25. | | `media_header` | `image`, `video` or `document` by `upload_ref`. JPEG, PNG, MP4 or PDF, up to 5 MiB. | - A `name` and `language` pair already registered beyond `draft` answers `409`. Pick another name, or register a new language under it. - A request refused before submission records nothing, and the name stays reusable. - An unknown submission outcome ([2039](/channel/whatsapp/error/codes/2xxx/2039/index.md)) is permanent: do not resubmit that name. ### Buttons A `url` button opens an `https` address baked into the template. It may end in `{{1}}`, filled at send, and then needs an `example`. A `quick_reply` button returns a payload you set at send. ``` { "name": "order_tracking", "language": "en_US", "category": "utility", "body": { "text": "Order {{order_id}} has shipped.", "examples": { "order_id": "A-1029" } }, "buttons": [ { "type": "url", "text": "Track order", "url": "https://example.com/orders/{{1}}", "example": "A-1029" }, { "type": "quick_reply", "text": "Talk to us" } ] } ``` - `url`: absolute `https`, up to 2,000. Only the final `{{1}}` may vary. Percent-encode the value yourself. - `type` defaults to `url`. ### Authentication templates An `authentication` template has fixed, localized copy, so omit `body` and send `authentication` instead. ``` { "name": "login_code", "language": "en_US", "category": "authentication", "authentication": { "otp_type": "copy_code", "code_expiration_minutes": 10 } } ``` | Field | Limits | | --------------------------------- | ----------------------------------------------- | | `otp_type` | `copy_code`, `one_tap` or `zero_tap`. Required. | | `package_name`, `signature_hash` | Required for `one_tap` and `zero_tap`. | | `zero_tap_terms_accepted` | Must be `true` for `zero_tap`. | | `code_expiration_minutes` | 1 to 90. | | `message_send_ttl_seconds` | 30 to 900. | | `copy_code_text`, `autofill_text` | Up to 25. | | `add_security_recommendation` | Boolean. | An authentication template cannot carry a `carousel` or `media_header`. ### Carousel templates A `carousel` holds 2 to 10 cards, each with `image` or `video` media, an optional body and up to two buttons. Every card uses the same media kind, body presence and button order. A carousel cannot be combined with `footer`, `media_header` or `buttons`, and needs category `marketing` or `utility`. Card media is named by an `asset_handle` from the channel’s template upload, not an `upload_ref`. ## Read the send shape `GET /v1/templates` lists templates in every status, newest first. Filter on `status == "approved"`. Pages hold up to 100 (`limit`); while `has_more` is `true`, pass `next_cursor` as `cursor` for the next page. | Field | Use | | ------------- | --------------------------------------------------------------------------------------------------------------------- | | `parameters` | JSON Schema for the named variables. Empty `properties`: no variables. `null`: cannot be sent by name. | | `send_schema` | The complete schema for this template’s `template` part, including header, buttons and cards. `null` until published. | | `content` | The copy and fixed buttons, for a human preview. Never rebuild copy from `send_schema`. | Hand `parameters` to a model verbatim as a tool definition. Send `header` only when `send_schema` requires that exact media kind. ## Send a template ``` { "to": "15550101234", "parts": [ { "type": "template", "name": "order_shipped", "language": "en_US", "parameters": { "order_id": "A-1042" } } ] } ``` | Field | Use | | ------------------ | ----------------------------------------------------------------------------------------------------- | | `name`, `language` | Identify the exact approved template on the sending account. | | `parameters` | Named values. Omit for a template with no variables. | | `header` | `kind` and `upload_ref`, only when `send_schema` requires a media header. | | `buttons` | `index`, `type`, `payload` per dynamic button, in index order. | | `cards` | Per-card values for a carousel template: `card_index`, `kind`, `upload_ref`, `parameters`, `buttons`. | Each parameter value is 1 to 1,024 characters, not whitespace-only, with no line break, tab or four consecutive spaces. ### Button values ``` { "to": "15550101234", "parts": [ { "type": "template", "name": "order_tracking", "language": "en_US", "parameters": { "order_id": "A-1042" }, "buttons": [ { "index": 0, "type": "url", "payload": "A-1042" }, { "index": 1, "type": "quick_reply", "payload": "talk-A-1042" } ] } ] } ``` - A `url` slot is required. Its payload replaces `{{1}}`. - A `quick_reply` slot is optional. Omit it and a tap returns the button’s label. - Fixed buttons have no slot. Payloads are up to 256. ### Authentication codes An authentication template takes exactly one parameter, `code`: the one-time code you generate, 1 to 15 characters. The message shows it in its body and behind its code button. ``` { "to": "15550101234", "parts": [ { "type": "template", "name": "login_code", "language": "en_US", "parameters": { "code": "482913" } } ] } ``` - A missing `code`, or any other parameter, is refused with [4007](/channel/whatsapp/error/codes/4xxx/4007/index.md). - A code over 15 characters is refused, never shortened. An authentication template with a one-time-code button (copy code, one-tap, or zero-tap autofill) needs the customer’s phone number. Sent to a customer known only by a [username id](/channel/whatsapp/guides/messaging/sending-messages#customers-who-use-a-username/index.md), it cannot be delivered. When the stored template already identifies the one-time-code button, the send is refused with HTTP `422` and `error.code` [4011](/channel/whatsapp/error/codes/4xxx/4011/index.md), and nothing is sent. If the refusal can only be known after acceptance, the message fails with `status: failed` and `failure.code: recipient_phone_number_required` instead. ## The customer window Outside the 24-hour customer window only an approved `template` sends; any other part is refused with [2036](/channel/whatsapp/error/codes/2xxx/2036/index.md). Inside the window a template is an ordinary send. Templates skip only the window check: validation, spend limits and suppressions still apply. See [Sending messages](/channel/whatsapp/guides/messaging/sending-messages#choose-content-from-the-customer-window/index.md). ## Quick-reply taps A tap on a quick-reply button arrives as an inbound `template_reply` part. The message’s `reply_to_message_id` names the template message that carried the button. ``` { "type": "template_reply", "payload": "talk-A-1042", "text": "Talk to us" } ``` - `payload`: the slot’s payload from your send, or the label if you left the slot out. Up to 256. - `text`: the label the customer saw. Up to 25. - Branch on `payload`, not `text`. The same part answers reply buttons on an [`interactive_carousel`](/channel/whatsapp/guides/messaging/message-types#interactive_carousel/index.md). ## Category changes Meta can change a template’s category after approval, most often from utility to marketing. The template stays `approved` and can still be sent, but it is priced as marketing and marketing rules apply. The change appears in `category` on `GET /v1/templates` and as a [`template.updated` event](/channel/whatsapp/guides/events#template-events/index.md). Meta decides this for each language, so one template name can hold both categories. A new language whose category differs from one already on the name can be refused with [1024](/channel/whatsapp/error/codes/1xxx/1024/index.md). Nothing is created, and the draft shows `retry_allowed: true`. Sending the same request again repeats the refusal for 15 minutes without reaching Meta, so don’t retry in a loop. ### Request a review Reviews happen in Meta, not through this API, and Linq doesn’t file them for you. Meta sends category notices to people with **Full control** of the messaging account, so start with one of them. 1. In Meta Business Support Home, open your messaging account and go to **Template category updates**. 2. Select the template and choose **Request review**. Meta allows 60 days from a category update, and the page shows each template’s date. 3. Check the result on the same page. **Reversed** means the review succeeded and **Unchanged** means it didn’t. Rely on these tabs rather than the email, which can read like a rejection even when the review succeeded. After a reversal, `category` updates within about fifteen minutes. You can then retry any language that was refused for this reason. Meta doesn’t offer a review in every case. See [Meta’s template categorization guide](https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/template-categorization/) for the current rules. ## Refusals A template send is validated against the registry before acceptance. A missing or non-approved template, wrong language, or mismatched parameter set is refused with HTTP `422` and `error.code` [4007](/channel/whatsapp/error/codes/4xxx/4007/index.md). Linq never substitutes a different template. The detail points at the field to fix, such as `/parts/0/name`, `/parts/0/language` (listing the registered languages) or `/parts/0/parameters/order_id`. | Code | When | | -------------------------------------------------------- | -------------------------------------------------------------- | | [1017](/channel/whatsapp/error/codes/1xxx/1017/index.md) | Registration: the definition failed validation. | | [1024](/channel/whatsapp/error/codes/1xxx/1024/index.md) | Registration: the channel refused the template. | | [2038](/channel/whatsapp/error/codes/2xxx/2038/index.md) | Registration: the name and language already exist. | | [2039](/channel/whatsapp/error/codes/2xxx/2039/index.md) | Registration: outcome unknown. Do not resubmit the name. | | [3011](/channel/whatsapp/error/codes/3xxx/3011/index.md) | Registration: the media header could not be prepared. | | [3021](/channel/whatsapp/error/codes/3xxx/3021/index.md) | Registration: media still preparing. Retry the same body. | | [3012](/channel/whatsapp/error/codes/3xxx/3012/index.md) | The template channel did not answer. | | [2034](/channel/whatsapp/error/codes/2xxx/2034/index.md) | The account has no channel account yet. | | [4007](/channel/whatsapp/error/codes/4xxx/4007/index.md) | Send: the template cannot be sent as addressed. | | [4011](/channel/whatsapp/error/codes/4xxx/4011/index.md) | Send: one-time code to a customer without a phone number. | | [2036](/channel/whatsapp/error/codes/2xxx/2036/index.md) | Send: a non-template part outside the window. | | [4006](/channel/whatsapp/error/codes/4xxx/4006/index.md) | Send: a spend cap. At a daily cap, template sends are refused. | --- # Webhooks URL: https://docs.linqapp.com/channel/whatsapp/guides/webhooks/ Register a destination with `POST /v1/webhook_endpoints`. The created response returns signing-secret material once; store it immediately in a secret manager. Endpoint reads expose configuration and health, never the secret value. Verify every request against the exact raw body before parsing JSON. Respond quickly after durable acceptance in your system, and process asynchronously. Use the event ID as the deduplication key. An endpoint with no `event_kinds` receives every kind, including `template.updated`; skip kinds you do not handle, or subscribe with `event_kinds` to receive only the ones you want. Deliveries to one endpoint and chat are sent in the order their events were recorded. For all WhatsApp accounts, a `message.received` for a message with attachments waits until every attachment has been captured or has failed, or ten minutes have elapsed since Linq received the message, whichever comes first. That deadline bounds the capture wait, not webhook delivery or retries. The event can follow deliveries for later messages of the same chat with a lower `data.seq_from`. Never discard it as stale: deduplicate by event ID and order the chat by `data.seq_from`. See [Events and recovery → Messages with attachments](/channel/whatsapp/guides/events#messages-with-attachments/index.md). `GET /v1/webhook_deliveries` exposes delivery attempts and outcomes. If a bounded historical range needs redelivery, create a replay under the endpoint and poll that replay’s status. Replay creation has its own idempotency key; use a stable key when retrying the same replay request. Adding a signing secret starts a rotation window. Deploy verification for both active secrets before retiring the old one. Disabling an endpoint is a cutoff, not a pause: events produced while disabled are not silently queued for later. ## Scope an endpoint to specific numbers By default an endpoint receives events for every number the account has now and adds later; endpoint reads report `phone_number_ids` as `null`. To narrow it, pass `phone_number_ids` on `POST /v1/webhook_endpoints` or `PATCH /v1/webhook_endpoints/{endpoint}`: up to 100 exact ids from `GET /v1/phone_numbers` (see the [phone numbers guide](/channel/whatsapp/guides/phone-numbers/index.md)). The endpoint then receives only the chat events of those numbers. Account-wide events that carry no phone number reach only unscoped endpoints, so keep one unscoped endpoint if you need them. `template.updated`, which reports a template’s status or category change, is one of them; see [Events and recovery → Template events](/channel/whatsapp/guides/events#template-events/index.md). An id the account cannot use — unknown, another account’s, the other mode’s, or not an active number of this account — is refused with HTTP `422` and `error.code` [1041](/channel/whatsapp/error/codes/1xxx/1041/index.md). The pointer is the list, `/phone_number_ids`, never the id, so a refusal does not say whose number it is; only a malformed id (empty, or over 128 bytes) is pointered at its own index, `/phone_number_ids/{i}`. Either way nothing is created or changed. An update replaces the list outright; an empty array restores every current and future number. The change affects only events fanned out after the update: deliveries already queued keep their destination, and a replay accepted earlier keeps the scope it was accepted under. Field details are on the [create](/channel/whatsapp/api/resources/webhook_endpoints/methods/create/index.md) and [update](/channel/whatsapp/api/resources/webhook_endpoints/methods/update/index.md) reference pages. --- # Error Codes URL: https://docs.linqapp.com/channel/whatsapp/error/ Every error returns the same JSON envelope: a `success: false` flag, a nested `error` object, and a `request_id` naming the request that failed. The `error` object always carries the HTTP `status` the response was written with, a numeric `code`, and a human-readable `message`. ``` { "success": false, "error": { "status": 422, "code": 1001, "message": "Field required.", "doc_url": "https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1001/", "param": "/parts/0/body", "details": [ { "code": "field_required", "param": "/parts/0/body", "message": "Body is required." } ] }, "request_id": "req_01JQZ8X4K2N3P5R7T9V1W3Y5Z7" } ``` `error.code` is a number and is the field to branch on. `error.message` is written for a human reading a log and may be reworded at any time, so matching on it will break. A code is never removed and never reassigned to a different failure: once a number means something, it means that forever. The optional members carry the specifics. `param` is present only when the response is about exactly one field and is that field’s JSON Pointer; with zero or several faults it is absent. `details` lists every field-level finding on a validation failure, each with a string `code`, a JSON Pointer `param` and a `message`. `retry_after` is present exactly when the response also carries a `Retry-After` header, with the same value in seconds. `trace_id` appears when a valid trace context exists. `doc_url` is present on every response whose code has a published page and is the absolute address of that page, `https://docs.linqapp.com/channel/whatsapp/error/codes/xxx//`, so a client can link straight to it; it is derived from the code alone, and a code reachable only on a surface that has not been released yet carries no `doc_url`. **These codes belong to WhatsApp.** Every channel numbers its own errors, which is why this reference is namespaced to `/channel/whatsapp/` — the same integer means something different on another channel, so branch on the code only in code paths you know are talking to this API. Tip Include `request_id` when contacting Linq support. It identifies the exact request in our logs. ## Error code ranges The set of codes grows over time. Branch on the integers you know, and treat an integer you do not know by its range plus the HTTP `status` that came with it — the range says what kind of failure it is, and the status says whether the request or the service was at fault. | Range | Category | Retry? | | --------------------------------------------------- | ------------------------------------- | ------------------------------------------------------------ | | [1xxx](#1xxx--request-errors) | Request Errors | No — correct the request first | | [2xxx](#2xxx--resource-permission-and-state-errors) | Resource, Permission and State Errors | No — inspect or reconcile that state | | [3xxx](#3xxx--service-errors) | Service Errors | Yes — bounded backoff, unless the code’s page says otherwise | | [4xxx](#4xxx--operational-and-send-refusals) | Operational and Send Refusals | Sometimes — follow the code’s remedy | | [5xxx](#5xxx--attachment-and-file-errors) | Attachment and File Errors | Sometimes — follow the code’s remedy | When `retry_after` is present, it overrides the guidance above: wait that many seconds, then retry. ## 1xxx — Request Errors The request never reached the thing it was about. Correct the request and send it again; retrying it unchanged fails identically. Validation rejects and points at the most specific location it can identify — it never coerces a value into something acceptable. | Code | Message | HTTP | Troubleshooting | | -------------------------------------------------------- | -------------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [1001](/channel/whatsapp/error/codes/1xxx/1001/index.md) | Field required. | 422 | Inspect error.param (or details\[].param) for the exact JSON Pointer to the missing field. | | [1002](/channel/whatsapp/error/codes/1xxx/1002/index.md) | Body missing. | 400 | Check that your client actually transmits the body (a GET-style call with no body on a POST route is the usual cause). | | [1003](/channel/whatsapp/error/codes/1xxx/1003/index.md) | Body unreadable. | 400 | Validate the body with a JSON linter and confirm it is a single object with no trailing bytes. | | [1004](/channel/whatsapp/error/codes/1xxx/1004/index.md) | Invalid content. | 422 | Read details\[] for the exact param (a JSON Pointer into your request) and each field’s own fault code. | | [1005](/channel/whatsapp/error/codes/1xxx/1005/index.md) | Value invalid. | 422 | Inspect error.param / details\[].param and the accompanying message, which names the rule. | | [1006](/channel/whatsapp/error/codes/1xxx/1006/index.md) | Channel message id inbound only. | 422 | Address a reply with reply\_to\_message\_id, using the message id this API returned or delivered in an event. | | [1007](/channel/whatsapp/error/codes/1xxx/1007/index.md) | Duplicate value. | 422 | Inspect details\[].param for the second occurrence. | | [1008](/channel/whatsapp/error/codes/1xxx/1008/index.md) | Event kind unknown. | 422 | Inspect details\[].param for the offending index in event\_kinds and compare it with the event kinds listed on the webhook endpoint operation. | | [1009](/channel/whatsapp/error/codes/1xxx/1009/index.md) | Field not allowed. | 422 | Inspect details\[].param; GET /v1/parts/{type} documents which fields each shape accepts. | | [1010](/channel/whatsapp/error/codes/1xxx/1010/index.md) | Field type. | 400 / 422 | Inspect error.param / details\[].param and the message, which names the expected type. | | [1012](/channel/whatsapp/error/codes/1xxx/1012/index.md) | From ambiguous. | 503 | Resend with from set to the E.164 number you want this conversation to use; it becomes the pinned sender. | | [1013](/channel/whatsapp/error/codes/1xxx/1013/index.md) | From not available. | 422 | Call GET /v1/phone\_numbers to list the numbers this account may send from, and use one of them. | | [1014](/channel/whatsapp/error/codes/1xxx/1014/index.md) | Idempotency key invalid. | 400 / 422 | Send one Idempotency-Key header per request, generated per logical operation, and reuse it only to replay that same request. | | [1016](/channel/whatsapp/error/codes/1xxx/1016/index.md) | Invalid paging. | 400 / 422 | Inspect details\[].param (/query/limit, /query/cursor, /query/order or /headers/Last-Event-ID) and resend with a valid value; drop the cursor to start from the end the operation reads from. | | [1017](/channel/whatsapp/error/codes/1xxx/1017/index.md) | Invalid template. | 422 | Read details\[] for the exact param (a JSON Pointer into your request) and each field’s own fault code. | | [1018](/channel/whatsapp/error/codes/1xxx/1018/index.md) | Method not allowed. | 405 | Read the Allow header on this response and GET /v1/openapi.yaml for the operation’s method. | | [1019](/channel/whatsapp/error/codes/1xxx/1019/index.md) | Multiple parts not available. | 422 | Send one request per part; separate requests are independent and no cross-request order is promised. | | [1020](/channel/whatsapp/error/codes/1xxx/1020/index.md) | Mutually exclusive. | 422 | Inspect details\[].param and GET /v1/parts/{type} for which fields form the choice. | | [1021](/channel/whatsapp/error/codes/1xxx/1021/index.md) | Not available. | 422 | Remove the reserved field or part named by details\[].param. | | [1022](/channel/whatsapp/error/codes/1xxx/1022/index.md) | Part not supported. | 422 | Use a supported part type; GET /v1/openapi.yaml lists the sendable union. | | [1023](/channel/whatsapp/error/codes/1xxx/1023/index.md) | Reply target wrong chat. | 422 | Use a message id from the same chat, or address the send to the chat the message belongs to. | | [1024](/channel/whatsapp/error/codes/1xxx/1024/index.md) | Template refused. | 422 | Revise the template per the message and submit again under a new name if the refusal was permanent. | | [1025](/channel/whatsapp/error/codes/1xxx/1025/index.md) | Too few items. | 422 | Inspect details\[].param; GET /v1/parts/{type} states each array’s minimum. | | [1026](/channel/whatsapp/error/codes/1xxx/1026/index.md) | Too many items. | 422 | Inspect details\[].param; GET /v1/parts/{type} states each array’s maximum. | | [1027](/channel/whatsapp/error/codes/1xxx/1027/index.md) | Unknown field. | 422 | Inspect details\[].param and remove or correct the field; compare against GET /v1/openapi.yaml or GET /v1/parts/{type}. | | [1028](/channel/whatsapp/error/codes/1xxx/1028/index.md) | Unknown part type. | 422 | GET /v1/openapi.yaml lists the part union; each member’s schema is at GET /v1/parts/{type}. | | [1029](/channel/whatsapp/error/codes/1xxx/1029/index.md) | Value too long. | 422 | Inspect details\[].param and shorten the value; limits are counted in characters, not bytes. | | [1030](/channel/whatsapp/error/codes/1xxx/1030/index.md) | Webhook field invalid. | 422 | Read details\[] for the exact param (a JSON Pointer into your request) and each field’s own fault code. | | [1031](/channel/whatsapp/error/codes/1xxx/1031/index.md) | Webhook status invalid. | 422 | Read the endpoint with GET /v1/webhook\_endpoints/{endpoint} and choose a documented status. | | [1032](/channel/whatsapp/error/codes/1xxx/1032/index.md) | Webhook url invalid. | 422 | Inspect details\[].param (/url) and supply an https URL on a public host. | | [1033](/channel/whatsapp/error/codes/1xxx/1033/index.md) | Parameter invalid. | 400 | Compare the named parameter against its schema in GET /v1/openapi.yaml. | | [1034](/channel/whatsapp/error/codes/1xxx/1034/index.md) | Parameter missing. | 400 | Add the named parameter or header and resend. | | [1036](/channel/whatsapp/error/codes/1xxx/1036/index.md) | Replay range too large. | 422 | Narrow after\_cursor / through\_cursor or the event kinds and request the replay in slices. | | [1037](/channel/whatsapp/error/codes/1xxx/1037/index.md) | Cursor invalid. | 400 / 422 | Take cursors from this collection’s own responses and restart the listing without one when in doubt. | | [1038](/channel/whatsapp/error/codes/1xxx/1038/index.md) | Part not sendable. | 422 | Use a sendable part type; GET /v1/openapi.yaml marks which are outbound. | | [1039](/channel/whatsapp/error/codes/1xxx/1039/index.md) | Send at not available. | 422 | Omit send\_at and send when you want the message delivered. | | [1040](/channel/whatsapp/error/codes/1xxx/1040/index.md) | Reaction target wrong chat. | 422 | Use a message id from the same chat, or address the send to the chat the message belongs to. | | [1041](/channel/whatsapp/error/codes/1xxx/1041/index.md) | Webhook phone number not found. | 422 | Choose ids returned by GET /v1/phone\_numbers using the same credential and mode. | ## 2xxx — Resource, Permission and State Errors The request was well formed and the thing it named was missing, not yours, or not in a state that allows this. Inspect or reconcile that state before sending again. An id that belongs to another account answers exactly like one that does not exist. That is deliberate: it keeps one account from probing another’s ids. | Code | Message | HTTP | Troubleshooting | | -------------------------------------------------------- | --------------------------------- | ---- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [2001](/channel/whatsapp/error/codes/2xxx/2001/index.md) | Chat not found. | 404 | Verify the chat id came from GET /v1/chats or a message this account sent or received, in the same livemode. | | [2002](/channel/whatsapp/error/codes/2xxx/2002/index.md) | Credential not permitted. | 403 | Use a partner API key for this call; rotating the key you sent will not help. | | [2003](/channel/whatsapp/error/codes/2xxx/2003/index.md) | Attachment not found. | 404 | Take attachment ids from the message or event that delivered them, in the same livemode. | | [2004](/channel/whatsapp/error/codes/2xxx/2004/index.md) | Credential invalid. | 401 | Send exactly one Authorization: Bearer header with a current partner API key or capability credential. | | [2005](/channel/whatsapp/error/codes/2xxx/2005/index.md) | Not permitted. | 403 | Confirm the key’s livemode matches the resource and that it belongs to the account that owns the resource. | | [2007](/channel/whatsapp/error/codes/2xxx/2007/index.md) | Attachment not ready. | 409 | Wait error.retry\_after seconds and retry the same GET /v1/attachments/{attachment}/content. | | [2009](/channel/whatsapp/error/codes/2xxx/2009/index.md) | Idempotency conflict. | 409 | Use a fresh Idempotency-Key for a new operation. | | [2010](/channel/whatsapp/error/codes/2xxx/2010/index.md) | Webhook endpoint not found. | 404 | List endpoints with GET /v1/webhook\_endpoints and use an id from that account. | | [2011](/channel/whatsapp/error/codes/2xxx/2011/index.md) | Not found. | 404 | Verify the id came from this account’s own reads or events, in the same livemode. | | [2012](/channel/whatsapp/error/codes/2xxx/2012/index.md) | Operation forbidden. | 403 | Mint a capability credential whose operation class covers this operation, or use the account’s partner API key. | | [2013](/channel/whatsapp/error/codes/2xxx/2013/index.md) | Part type not found. | 404 | GET /v1/openapi.yaml lists every part type. | | [2014](/channel/whatsapp/error/codes/2xxx/2014/index.md) | Reply target not found. | 422 | Use a message id from this chat’s transcript (GET /v1/chats/{chat}/events). | | [2015](/channel/whatsapp/error/codes/2xxx/2015/index.md) | Route not found. | 404 | GET /v1/openapi.yaml is the API’s own map of what exists. | | [2029](/channel/whatsapp/error/codes/2xxx/2029/index.md) | Webhook replay not found. | 404 | Use the replay id returned by POST /v1/webhook\_endpoints/{endpoint}/replays and the endpoint it was created on. | | [2030](/channel/whatsapp/error/codes/2xxx/2030/index.md) | Replay in progress. | 409 | Poll GET /v1/webhook\_endpoints/{endpoint}/replays/{replay} until the running replay completes, then request the next one. | | [2031](/channel/whatsapp/error/codes/2xxx/2031/index.md) | Capability outcome indeterminate. | 409 | Do not retry blindly; read the affected resource (the chat, template or endpoint) to learn its current state first. | | [2032](/channel/whatsapp/error/codes/2xxx/2032/index.md) | Cursor expired. | 410 | Use the chat and transcript reads (GET /v1/chats/{chat}/events) to backfill anything you missed before resuming. | | [2033](/channel/whatsapp/error/codes/2xxx/2033/index.md) | Last active secret. | 409 | Add a new secret with POST /v1/webhook\_endpoints/{endpoint}/secrets first, then retire the old one. | | [2034](/channel/whatsapp/error/codes/2xxx/2034/index.md) | No channel account. | 503 | Complete channel onboarding for the account, then retry. | | [2035](/channel/whatsapp/error/codes/2xxx/2035/index.md) | Nothing unread. | 409 | Read the chat’s transcript (GET /v1/chats/{chat}/events) to confirm its state before sending another read command. | | [2036](/channel/whatsapp/error/codes/2xxx/2036/index.md) | Outside customer window. | 422 | Read error.context.expires\_at: a timestamp means the window lapsed, null means the customer has never messaged this number. | | [2037](/channel/whatsapp/error/codes/2xxx/2037/index.md) | Reply target not ready. | 422 | Read the target message’s status. If it reads failed or unknown, do not wait, because it may never reach sent. Send without reply\_to\_message\_id or quote a message that was sent. A send naming a target that reads unknown may be accepted and fail later with target\_message\_failed, or may be refused as not ready. | | [2038](/channel/whatsapp/error/codes/2xxx/2038/index.md) | Template exists. | 409 | List templates with GET /v1/templates and reuse the existing one, or submit under a new name. | | [2039](/channel/whatsapp/error/codes/2xxx/2039/index.md) | Template outcome indeterminate. | 409 | Do not resubmit under the same name; read GET /v1/templates after registry reconciliation, or contact support with the request\_id. | | [2040](/channel/whatsapp/error/codes/2xxx/2040/index.md) | Too many active secrets. | 409 | Retire a secret with the retire operation, then add the new one; a rotation needs two active secrets at most. | | [2041](/channel/whatsapp/error/codes/2xxx/2041/index.md) | Webhook endpoint exists. | 409 | List endpoints with GET /v1/webhook\_endpoints and update the existing one instead of creating a duplicate. | | [2042](/channel/whatsapp/error/codes/2xxx/2042/index.md) | Webhook endpoint limit. | 422 | Remove an unused endpoint with DELETE /v1/webhook\_endpoints/{endpoint}, then retry. | | [2043](/channel/whatsapp/error/codes/2xxx/2043/index.md) | Attachment unavailable. | 410 | Download attachments promptly after the event that delivers them; retention is documented on the attachment operation. | | [2047](/channel/whatsapp/error/codes/2xxx/2047/index.md) | No sending number. | 503 | Complete number provisioning, then retry; contact support if a number should already be attached. | | [2049](/channel/whatsapp/error/codes/2xxx/2049/index.md) | Reaction target not found. | 422 | Use a message id from this chat’s transcript (GET /v1/chats/{chat}/events). | | [2050](/channel/whatsapp/error/codes/2xxx/2050/index.md) | Reaction target not ready. | 422 | Read the target message’s status. If it reads failed or unknown, do not wait, because it may never reach sent. React to a message that was sent. A send naming a target that reads unknown may be accepted and fail later with target\_message\_failed, or may be refused as not ready. | | [2051](/channel/whatsapp/error/codes/2xxx/2051/index.md) | Webhook delivery in progress. | 409 | Read the delivery with GET /v1/webhook\_deliveries?delivery\_id=… and retry once its state is pending again. | | [2052](/channel/whatsapp/error/codes/2xxx/2052/index.md) | Webhook delivery terminal. | 409 | For a retry\_exhausted or permanent\_refusal delivery, replay its event with POST /v1/webhook\_endpoints/{endpoint}/replays. | | [2053](/channel/whatsapp/error/codes/2xxx/2053/index.md) | Webhook delivery not found. | 404 | Use a delivery id from GET /v1/webhook\_deliveries under the same key and mode. | | [2054](/channel/whatsapp/error/codes/2xxx/2054/index.md) | Environment has no sending line. | 422 | Move a number into this environment where the account’s numbers are managed, then send again. | | [2055](/channel/whatsapp/error/codes/2xxx/2055/index.md) | Environment stream unavailable. | 403 | Register a webhook endpoint with POST /v1/webhook\_endpoints under this key; it receives exactly this environment’s events. | | [2056](/channel/whatsapp/error/codes/2xxx/2056/index.md) | Nothing readable. | 409 | Nothing is owed on these messages; send a read command again after the customer’s next supported message, which it will target. | | [2057](/channel/whatsapp/error/codes/2xxx/2057/index.md) | Webhook account not connected. | 409 | Finish connecting the account’s messaging account, then repeat the request. | ## 3xxx — Service Errors Transient, and ours. Retry with bounded exponential backoff, starting at 1 second and capping at 30, unless the code’s own page says otherwise. Sends are idempotent on `Idempotency-Key`, so a retry of a send that actually succeeded returns the original result rather than sending twice. | Code | Message | HTTP | Troubleshooting | | -------------------------------------------------------- | --------------------------------- | ---- | ---------------------------------------------------------------------------------------------------------------------------- | | [3001](/channel/whatsapp/error/codes/3xxx/3001/index.md) | Attachment read unavailable. | 503 | Wait error.retry\_after seconds and retry the same download. | | [3002](/channel/whatsapp/error/codes/3xxx/3002/index.md) | Authentication unavailable. | 503 | Retry the same request with bounded backoff; nothing was recorded. | | [3003](/channel/whatsapp/error/codes/3xxx/3003/index.md) | Capability audit unavailable. | 503 | Retry the same request with bounded backoff; nothing was recorded. | | [3004](/channel/whatsapp/error/codes/3xxx/3004/index.md) | Entitlement unavailable. | 503 | Retry the same request with bounded backoff; nothing was recorded. | | [3006](/channel/whatsapp/error/codes/3xxx/3006/index.md) | Internal error. | 500 | Retry with bounded backoff. | | [3008](/channel/whatsapp/error/codes/3xxx/3008/index.md) | Response failed. | 500 | Read the affected resource before retrying a mutation. | | [3009](/channel/whatsapp/error/codes/3xxx/3009/index.md) | Sending guard unavailable. | 503 | Retry the same request with bounded backoff; nothing was recorded. | | [3010](/channel/whatsapp/error/codes/3xxx/3010/index.md) | Stream unavailable. | 503 | Use GET /v1/event\_log if it is available, or contact support. | | [3011](/channel/whatsapp/error/codes/3xxx/3011/index.md) | Template asset unavailable. | 503 | Retry the unchanged submission later; if it persists, upload the asset again and contact support with the request\_id. | | [3012](/channel/whatsapp/error/codes/3xxx/3012/index.md) | Template channel unavailable. | 503 | Retry the same request with bounded backoff; nothing was recorded. | | [3013](/channel/whatsapp/error/codes/3xxx/3013/index.md) | Webhook registration unavailable. | 503 | Retry later; if it persists, contact support. | | [3014](/channel/whatsapp/error/codes/3xxx/3014/index.md) | Webhook replay unavailable. | 503 | Contact support if you need a replay. | | [3015](/channel/whatsapp/error/codes/3xxx/3015/index.md) | Event log unavailable. | 503 | Use GET /v1/streams/events if it is available, or contact support. | | [3016](/channel/whatsapp/error/codes/3xxx/3016/index.md) | Event payload invalid. | 500 | Retry the same read; if it persists, contact support and quote the request\_id. | | [3017](/channel/whatsapp/error/codes/3xxx/3017/index.md) | Webhook replay failed. | 500 | Retry with the same Idempotency-Key. | | [3019](/channel/whatsapp/error/codes/3xxx/3019/index.md) | Not implemented. | 501 | Check the operation’s first description line in GET /v1/openapi.yaml; it says Not yet available until the operation is live. | | [3020](/channel/whatsapp/error/codes/3xxx/3020/index.md) | Rate not configured. | 503 | Contact support rather than retrying; retries return the same answer until a rate is assigned. | | [3021](/channel/whatsapp/error/codes/3xxx/3021/index.md) | Template submission in progress. | 503 | Resend the identical request after a short wait; a changed body starts a new submission instead. | | [3022](/channel/whatsapp/error/codes/3xxx/3022/index.md) | Unavailable. | 503 | Retry the same request with bounded backoff; nothing was recorded. | ## 4xxx — Operational and Send Refusals The send was understood and refused for an operational reason: a sending number that cannot carry it, a paused account, or a limit that was reached. Each code names its own remedy; a retry without that remedy is refused the same way. | Code | Message | HTTP | Troubleshooting | | -------------------------------------------------------- | -------------------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [4001](/channel/whatsapp/error/codes/4xxx/4001/index.md) | Exclude leaves no sender. | 422 | Read error.context.pinned\_from when present: your exclude named the number this conversation already uses. | | [4003](/channel/whatsapp/error/codes/4xxx/4003/index.md) | From not sendable. | 422 | Call GET /v1/phone\_numbers and choose a number whose status admits sending. | | [4004](/channel/whatsapp/error/codes/4xxx/4004/index.md) | Pinned line unsendable. | 422 | Read error.context.pinned\_from (the current number, absent when it is no longer yours) and error.context.available\_from (a number that could serve instead). | | [4005](/channel/whatsapp/error/codes/4xxx/4005/index.md) | Sending paused. | 503 | Retry later with bounded backoff. | | [4006](/channel/whatsapp/error/codes/4xxx/4006/index.md) | Spend limit exceeded. | 422 / 429 | When error.retry\_after is present, wait that many seconds; the reset is the UTC day or month boundary. | | [4007](/channel/whatsapp/error/codes/4xxx/4007/index.md) | Template not sendable. | 422 | Read the template with GET /v1/templates to confirm its status and send\_schema; details\[].param names the discriminating field. | | [4008](/channel/whatsapp/error/codes/4xxx/4008/index.md) | Tier quota exceeded. | 422 / 429 | Wait at least error.retry\_after seconds when present; replies inside an open customer window are not counted. | | [4009](/channel/whatsapp/error/codes/4xxx/4009/index.md) | Replay capacity reached. | 429 | Wait error.retry\_after seconds and request the replay again. | | [4010](/channel/whatsapp/error/codes/4xxx/4010/index.md) | Pinned line outside environment. | 422 | Read error.context.pinned\_from (the conversation’s current number) and error.context.available\_from (a number in this environment that could serve, when one exists). | | [4011](/channel/whatsapp/error/codes/4xxx/4011/index.md) | Recipient phone number required. | 422 | Deliver the one-time code another way; every other message type, including templates without a one-time-code button, can still be sent to this customer. | | [4012](/channel/whatsapp/error/codes/4xxx/4012/index.md) | Request rate exceeded. | 429 | Wait error.retry\_after seconds, then retry; back off further if the refusal repeats. | | [4013](/channel/whatsapp/error/codes/4xxx/4013/index.md) | Event stream limit reached. | 429 | Reuse one stream per consumer rather than opening a new stream per task, and close streams you no longer read. | ## 5xxx — Attachment and File Errors The file’s bytes: its kind, its size, where it came from, or storing it. An attachment that is merely missing or not yet readable is a 2xxx resource error instead. | Code | Message | HTTP | Troubleshooting | | -------------------------------------------------------- | -------------------------------- | ---- | ---------------------------------------------------------------------------------------------------------------------------- | | [5001](/channel/whatsapp/error/codes/5xxx/5001/index.md) | Download capacity exhausted. | 503 | Wait error.retry\_after seconds and retry the same download; nothing about the attachment changed. | | [5002](/channel/whatsapp/error/codes/5xxx/5002/index.md) | Media id inbound only. | 422 | Upload outbound bytes with POST /v1/media and reference the returned upload\_ref in the part. | | [5003](/channel/whatsapp/error/codes/5xxx/5003/index.md) | Media invalid. | 422 | Read details\[] for the exact param (a JSON Pointer into your request) and each field’s own fault code. | | [5004](/channel/whatsapp/error/codes/5xxx/5004/index.md) | Upload capacity exhausted. | 503 | Wait error.retry\_after seconds and retry the same upload. | | [5005](/channel/whatsapp/error/codes/5xxx/5005/index.md) | Upload ref invalid. | 422 | Use the upload\_ref exactly as returned by POST /v1/media, in the same livemode. | | [5006](/channel/whatsapp/error/codes/5xxx/5006/index.md) | Upload ref not found. | 422 | Upload the bytes again with POST /v1/media and send promptly with the new upload\_ref. | | [5007](/channel/whatsapp/error/codes/5xxx/5007/index.md) | Media source invalid. | 422 | Serve the file from a public https host on port 443 and supply that address without credentials. | | [5008](/channel/whatsapp/error/codes/5xxx/5008/index.md) | Media source unavailable. | 422 | Confirm the address serves the file directly with a 200 answer, without authentication or a redirect to a page. | | [5009](/channel/whatsapp/error/codes/5xxx/5009/index.md) | Media source unsupported. | 422 | Set kind to match the file the address serves, and serve it under a media type the upload operation documents for that kind. | | [5010](/channel/whatsapp/error/codes/5xxx/5010/index.md) | Media source capacity exhausted. | 503 | Retry the same request shortly. | --- # 1001: Field required. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1001/ **HTTP status:** `422`. May also be reported as a field-level finding in `error.details[]`. The field named by param is required for this operation or part and was missing, null or empty. Supply a value and resend; nothing was recorded. ## Troubleshooting - Inspect error.param (or details\[].param) for the exact JSON Pointer to the missing field. - Compare the part against GET /v1/parts/{type}, which lists every required field. ## Related - [Part schemas](/channel/whatsapp/api/resources/contract/methods/part_schema/index.md) - [Sending a message](/channel/whatsapp/api/resources/chats/subresources/messages/methods/send/index.md) --- # 1002: Body missing. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1002/ **HTTP status:** `400`. This operation expects a JSON object body and none was sent. Send the documented body with Content-Type: application/json. ## Troubleshooting - Check that your client actually transmits the body (a GET-style call with no body on a POST route is the usual cause). ## Related - [Sending a message](/channel/whatsapp/api/resources/chats/subresources/messages/methods/send/index.md) --- # 1003: Body unreadable. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1003/ **HTTP status:** `400`. The body could not be parsed as a single UTF-8 JSON value: malformed JSON, invalid UTF-8, a trailing second value, or a byte count past the route’s cap. Fix the encoding and resend. ## Troubleshooting - Validate the body with a JSON linter and confirm it is a single object with no trailing bytes. - For POST /v1/media the raw bytes are the body; do not wrap them in JSON. ## Related - [Sending a message](/channel/whatsapp/api/resources/chats/subresources/messages/methods/send/index.md) --- # 1004: Invalid content. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1004/ **HTTP status:** `422`. May also be reported as a field-level finding in `error.details[]`. One or more parts in the request do not satisfy the published part schema or a content rule. The request is refused whole; nothing was sent or recorded. ## Troubleshooting - Read details\[] for the exact param (a JSON Pointer into your request) and each field’s own fault code. - Fetch the offending part’s schema from GET /v1/parts/{type}; validation rejects and points, it never coerces. ## Related - [Part schemas](/channel/whatsapp/api/resources/contract/methods/part_schema/index.md) - [Sending messages guide](/channel/whatsapp/guides/messaging/sending-messages/index.md) --- # 1005: Value invalid. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1005/ **HTTP status:** `422`. May also be reported as a field-level finding in `error.details[]`. The value at param is well-typed and within bounds but violates a rule such as a pattern, a range or a forbidden character run. Correct the value and resend. ## Troubleshooting - Inspect error.param / details\[].param and the accompanying message, which names the rule. - For to, from, exclude and reply\_to\_message\_id the accepted forms are documented on the send operation. ## Related - [Part schemas](/channel/whatsapp/api/resources/contract/methods/part_schema/index.md) --- # 1006: Channel message id inbound only. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1006/ **HTTP status:** `422`. channel\_message\_id is an inbound-only fact the channel assigns; a send must not carry one. Remove the field and resend. ## Troubleshooting - Address a reply with reply\_to\_message\_id, using the message id this API returned or delivered in an event. ## Related - [Sending a message](/channel/whatsapp/api/resources/chats/subresources/messages/methods/send/index.md) --- # 1007: Duplicate value. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1007/ **HTTP status:** `422`. May also be reported as a field-level finding in `error.details[]`. Two entries in the part carry the same value where uniqueness is required, such as two rows or buttons with the same id. Make each value unique and resend. ## Troubleshooting - Inspect details\[].param for the second occurrence. ## Related - [Part schemas](/channel/whatsapp/api/resources/contract/methods/part_schema/index.md) --- # 1008: Event kind unknown. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1008/ **HTTP status:** `422`. May also be reported as a field-level finding in `error.details[]`. The webhook endpoint request names an event kind this API does not emit. Only documented kinds can be subscribed to. ## Troubleshooting - Inspect details\[].param for the offending index in event\_kinds and compare it with the event kinds listed on the webhook endpoint operation. ## Related - [Creating a webhook endpoint](/channel/whatsapp/api/resources/webhook_endpoints/methods/create/index.md) - [Events guide](/channel/whatsapp/guides/events/index.md) --- # 1009: Field not allowed. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1009/ **HTTP status:** `422`. May also be reported as a field-level finding in `error.details[]`. The field at param exists on the part type but is not permitted in this particular shape (for example a caption on audio or a filename on an image). Remove it and resend. ## Troubleshooting - Inspect details\[].param; GET /v1/parts/{type} documents which fields each shape accepts. ## Related - [Part schemas](/channel/whatsapp/api/resources/contract/methods/part_schema/index.md) --- # 1010: Field type. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1010/ **HTTP status:** `400` or `422`, depending on the request. May also be reported as a field-level finding in `error.details[]`. The value at param is the wrong JSON type for the field, or is null on a field the contract does not declare nullable. A top-level body field caught by the decoder answers 400; a field inside a part or a strict body answers 422 with the pointer in details. ## Troubleshooting - Inspect error.param / details\[].param and the message, which names the expected type. ## Related - [Part schemas](/channel/whatsapp/api/resources/contract/methods/part_schema/index.md) --- # 1012: From ambiguous. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1012/ **HTTP status:** `503`. The account holds several eligible sending numbers for this destination and none is pinned, so the send cannot choose. Nothing was sent. ## Troubleshooting - Resend with from set to the E.164 number you want this conversation to use; it becomes the pinned sender. ## Related - [Phone numbers guide](/channel/whatsapp/guides/phone-numbers/index.md) - [Sending a message](/channel/whatsapp/api/resources/chats/subresources/messages/methods/send/index.md) --- # 1013: From not available. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1013/ **HTTP status:** `422`. The number named in from is not registered to this account (a number belonging to another account answers identically). Nothing was sent. ## Troubleshooting - Call GET /v1/phone\_numbers to list the numbers this account may send from, and use one of them. ## Related - [Phone numbers guide](/channel/whatsapp/guides/phone-numbers/index.md) - [Phone numbers](/channel/whatsapp/api/resources/phone_numbers/methods/list/index.md) --- # 1014: Idempotency key invalid. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1014/ **HTTP status:** `400` or `422`, depending on the request. The Idempotency-Key header must be supplied exactly once as 1-255 visible ASCII bytes on every operation that requires it. A missing or malformed header is refused before the operation runs (400); one refused by the operation itself answers 422. The request was not accepted. ## Troubleshooting - Send one Idempotency-Key header per request, generated per logical operation, and reuse it only to replay that same request. ## Related - [Sending a message](/channel/whatsapp/api/resources/chats/subresources/messages/methods/send/index.md) --- # 1016: Invalid paging. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1016/ **HTTP status:** `400` or `422`, depending on the request. May also be reported as a field-level finding in `error.details[]`. Paging parameters are refused rather than clamped: limit must be 1-100, cursor must be a position this collection has had, and order must be one of the values the operation publishes. Chat, transcript, event-log and stream reads answer 422; a listing that validates its paging before reading answers 400. Nothing was read. ## Troubleshooting - Inspect details\[].param (/query/limit, /query/cursor, /query/order or /headers/Last-Event-ID) and resend with a valid value; drop the cursor to start from the end the operation reads from. ## Related - [Limits](/channel/whatsapp/guides/platform/limits/index.md) - [Listing chats](/channel/whatsapp/api/resources/chats/methods/list/index.md) --- # 1017: Invalid template. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1017/ **HTTP status:** `422`. The template’s name, language, category or components do not satisfy the template rules. Nothing was submitted. ## Troubleshooting - Read details\[] for the exact param (a JSON Pointer into your request) and each field’s own fault code. - Compare the body against the template creation operation’s documented shape. ## Related - [Templates guide](/channel/whatsapp/guides/templates/index.md) - [Sending a message](/channel/whatsapp/api/resources/chats/subresources/messages/methods/send/index.md) --- # 1018: Method not allowed. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1018/ **HTTP status:** `405`. The path is a real route and the HTTP method is not one it serves. The Allow header lists the methods it does accept. ## Troubleshooting - Read the Allow header on this response and GET /v1/openapi.yaml for the operation’s method. ## Related - [API reference](/channel/whatsapp/api/index.md) --- # 1019: Multiple parts not available. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1019/ **HTTP status:** `422`. Each send must carry exactly one part; the API neither fans a multi-part request out nor offers an atomic batch. Nothing was sent. ## Troubleshooting - Send one request per part; separate requests are independent and no cross-request order is promised. ## Related - [Sending messages guide](/channel/whatsapp/guides/messaging/sending-messages/index.md) --- # 1020: Mutually exclusive. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1020/ **HTTP status:** `422`. May also be reported as a field-level finding in `error.details[]`. The part or request declares a choice between fields and the request either set both or set none. Supply exactly one. ## Troubleshooting - Inspect details\[].param and GET /v1/parts/{type} for which fields form the choice. ## Related - [Part schemas](/channel/whatsapp/api/resources/contract/methods/part_schema/index.md) --- # 1021: Not available. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1021/ **HTTP status:** `422`. May also be reported as a field-level finding in `error.details[]`. A reserved field or part you supplied has no implementation yet and is refused rather than ignored, so a value you expected to take effect can never quietly fail to. It appears in details\[] under a 422 refusal. ## Troubleshooting - Remove the reserved field or part named by details\[].param. ## Related - [Part schemas](/channel/whatsapp/api/resources/contract/methods/part_schema/index.md) --- # 1022: Part not supported. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1022/ **HTTP status:** `422`. The part is valid in shape but this channel does not support sending it yet (for example address\_request). Nothing was sent. ## Troubleshooting - Use a supported part type; GET /v1/openapi.yaml lists the sendable union. ## Related - [Part schemas](/channel/whatsapp/api/resources/contract/methods/part_schema/index.md) - [Sending messages guide](/channel/whatsapp/guides/messaging/sending-messages/index.md) --- # 1023: Reply target wrong chat. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1023/ **HTTP status:** `422`. reply\_to\_message\_id names a message in another conversation than the one this send addresses. Nothing was sent. ## Troubleshooting - Use a message id from the same chat, or address the send to the chat the message belongs to. ## Related - [Sending a message](/channel/whatsapp/api/resources/chats/subresources/messages/methods/send/index.md) --- # 1024: Template refused. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1024/ **HTTP status:** `422`. The template was submitted and the channel refused it (content policy, category or component rules). The refusal reason is in message. ## Troubleshooting - Revise the template per the message and submit again under a new name if the refusal was permanent. - If the message says another language of the name holds a different category, compare categories with GET /v1/templates and retry with a matching one. A reclassification is appealed through your messaging account’s business tools, not this API. ## Related - [Templates guide](/channel/whatsapp/guides/templates/index.md) - [Sending a message](/channel/whatsapp/api/resources/chats/subresources/messages/methods/send/index.md) --- # 1025: Too few items. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1025/ **HTTP status:** `422`. May also be reported as a field-level finding in `error.details[]`. The array at param has fewer items than the part requires (usually it is empty). Supply at least the minimum and resend. ## Troubleshooting - Inspect details\[].param; GET /v1/parts/{type} states each array’s minimum. ## Related - [Part schemas](/channel/whatsapp/api/resources/contract/methods/part_schema/index.md) --- # 1026: Too many items. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1026/ **HTTP status:** `422`. May also be reported as a field-level finding in `error.details[]`. The array at param has more items than the part allows. Remove items and resend. ## Troubleshooting - Inspect details\[].param; GET /v1/parts/{type} states each array’s maximum. ## Related - [Part schemas](/channel/whatsapp/api/resources/contract/methods/part_schema/index.md) --- # 1027: Unknown field. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1027/ **HTTP status:** `422`. May also be reported as a field-level finding in `error.details[]`. A field at param is not part of this operation or part. Undeclared fields are refused rather than ignored, so a misspelling can never silently fail to take effect. ## Troubleshooting - Inspect details\[].param and remove or correct the field; compare against GET /v1/openapi.yaml or GET /v1/parts/{type}. ## Related - [Part schemas](/channel/whatsapp/api/resources/contract/methods/part_schema/index.md) --- # 1028: Unknown part type. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1028/ **HTTP status:** `422`. May also be reported as a field-level finding in `error.details[]`. The type at param is not one of the published part types. Nothing was sent. ## Troubleshooting - GET /v1/openapi.yaml lists the part union; each member’s schema is at GET /v1/parts/{type}. ## Related - [Part schemas](/channel/whatsapp/api/resources/contract/methods/part_schema/index.md) --- # 1029: Value too long. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1029/ **HTTP status:** `422`. May also be reported as a field-level finding in `error.details[]`. The string at param is longer than the part allows; the message states the actual and maximum length. ## Troubleshooting - Inspect details\[].param and shorten the value; limits are counted in characters, not bytes. ## Related - [Part schemas](/channel/whatsapp/api/resources/contract/methods/part_schema/index.md) --- # 1030: Webhook field invalid. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1030/ **HTTP status:** `422`. May also be reported as a field-level finding in `error.details[]`. A field on the endpoint request (description, event\_kinds, secret or similar) failed validation. Nothing was created or changed. ## Troubleshooting - Read details\[] for the exact param (a JSON Pointer into your request) and each field’s own fault code. ## Related - [Creating a webhook endpoint](/channel/whatsapp/api/resources/webhook_endpoints/methods/create/index.md) --- # 1031: Webhook status invalid. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1031/ **HTTP status:** `422`. May also be reported as a field-level finding in `error.details[]`. status must be one of the documented endpoint states and the transition must be allowed from the current one. Note that disabling is a cutoff, not a pause. ## Troubleshooting - Read the endpoint with GET /v1/webhook\_endpoints/{endpoint} and choose a documented status. ## Related - [Webhook endpoints](/channel/whatsapp/api/resources/webhook_endpoints/index.md) --- # 1032: Webhook url invalid. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1032/ **HTTP status:** `422`. May also be reported as a field-level finding in `error.details[]`. The URL must be an absolute https URL to a publicly reachable host; cleartext, private, loopback or link-local destinations are refused. ## Troubleshooting - Inspect details\[].param (/url) and supply an https URL on a public host. ## Related - [Creating a webhook endpoint](/channel/whatsapp/api/resources/webhook_endpoints/methods/create/index.md) - [Webhooks guide](/channel/whatsapp/guides/webhooks/index.md) --- # 1033: Parameter invalid. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1033/ **HTTP status:** `400`. A request parameter is not in the form this operation expects, was supplied more than once, or could not be read. The message names the parameter. ## Troubleshooting - Compare the named parameter against its schema in GET /v1/openapi.yaml. ## Related - [API reference](/channel/whatsapp/api/index.md) --- # 1034: Parameter missing. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1034/ **HTTP status:** `400`. The message names the required parameter or header that was not supplied. ## Troubleshooting - Add the named parameter or header and resend. ## Related - [API reference](/channel/whatsapp/api/index.md) --- # 1036: Replay range too large. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1036/ **HTTP status:** `422`. A webhook replay is bounded to 10,000 events and the requested cursor range and filters select more. Nothing was scheduled. ## Troubleshooting - Narrow after\_cursor / through\_cursor or the event kinds and request the replay in slices. ## Related - [Replaying deliveries](/channel/whatsapp/api/resources/webhook_endpoints/subresources/replays/methods/create/index.md) --- # 1037: Cursor invalid. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1037/ **HTTP status:** `400` or `422`, depending on the request. The cursor was not issued for this collection, was issued for a state the collection no longer has, or points past the committed tail. Replays and exports answer 422; a listing that validates its cursor before reading answers 400. Nothing was read or scheduled. ## Troubleshooting - Take cursors from this collection’s own responses and restart the listing without one when in doubt. ## Related - [Limits](/channel/whatsapp/guides/platform/limits/index.md) - [Event log](/channel/whatsapp/api/resources/event_log/methods/list/index.md) --- # 1038: Part not sendable. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1038/ **HTTP status:** `422`. May also be reported as a field-level finding in `error.details[]`. The part at param is a real type (for example interactive\_reply, order, referral, system, unsupported) that only arrives from customers and cannot be sent. ## Troubleshooting - Use a sendable part type; GET /v1/openapi.yaml marks which are outbound. ## Related - [Part schemas](/channel/whatsapp/api/resources/contract/methods/part_schema/index.md) - [Sending messages guide](/channel/whatsapp/guides/messaging/sending-messages/index.md) --- # 1039: Send at not available. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1039/ **HTTP status:** `422`. send\_at is reserved and never ignored: a send accepted now would go out now. Nothing was sent. ## Troubleshooting - Omit send\_at and send when you want the message delivered. ## Related - [Sending a message](/channel/whatsapp/api/resources/chats/subresources/messages/methods/send/index.md) --- # 1040: Reaction target wrong chat. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1040/ **HTTP status:** `422`. The reaction part’s message\_id names a message in another conversation than the one this send addresses. Nothing was sent. ## Troubleshooting - Use a message id from the same chat, or address the send to the chat the message belongs to. --- # 1041: Webhook phone number not found. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/1xxx/1041/ **HTTP status:** `422`. May also be reported as a field-level finding in `error.details[]`. One or more phone\_number\_ids are unknown, belong to another account, or belong to the other test/live mode. Nothing was created or changed. ## Troubleshooting - Choose ids returned by GET /v1/phone\_numbers using the same credential and mode. ## Related - [Creating a webhook endpoint](/channel/whatsapp/api/resources/webhook_endpoints/methods/create/index.md) - [Webhooks guide](/channel/whatsapp/guides/webhooks/index.md) --- # 2001: Chat not found. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/2xxx/2001/ **HTTP status:** `404`. No chat with this id exists for this account and mode; a chat belonging to another account, or in the other livemode, answers identically. Nothing was read, sent or accepted. ## Troubleshooting - Verify the chat id came from GET /v1/chats or a message this account sent or received, in the same livemode. ## Related - [Retrieving a chat](/channel/whatsapp/api/resources/chats/methods/retrieve/index.md) - [Listing chats](/channel/whatsapp/api/resources/chats/methods/list/index.md) --- # 2002: Credential not permitted. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/2xxx/2002/ **HTTP status:** `403`. The credential is real but belongs to another surface (a control key). The partner API only serves partner keys. ## Troubleshooting - Use a partner API key for this call; rotating the key you sent will not help. ## Related - [Authentication](/channel/whatsapp/getting-started/authentication/index.md) --- # 2003: Attachment not found. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/2xxx/2003/ **HTTP status:** `404`. No attachment with this id is available to this account; one belonging to another account answers identically, and one already pruned no longer resolves. ## Troubleshooting - Take attachment ids from the message or event that delivered them, in the same livemode. - Download promptly: retained bytes are pruned on the documented retention schedule. ## Related - [Downloading an attachment](/channel/whatsapp/api/resources/attachments/methods/download/index.md) --- # 2004: Credential invalid. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/2xxx/2004/ **HTTP status:** `401`. The Authorization header is missing, malformed, duplicated, or names a key or delegated capability credential that is unknown, expired or revoked. Nothing was read or changed. ## Troubleshooting - Send exactly one Authorization: Bearer header with a current partner API key or capability credential. ## Related - [Authentication](/channel/whatsapp/getting-started/authentication/index.md) --- # 2005: Not permitted. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/2xxx/2005/ **HTTP status:** `403`. The key is valid but is not permitted to perform this operation or act on this resource (for example a sandbox key on a live resource). ## Troubleshooting - Confirm the key’s livemode matches the resource and that it belongs to the account that owns the resource. ## Related - [Authentication](/channel/whatsapp/getting-started/authentication/index.md) --- # 2007: Attachment not ready. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/2xxx/2007/ **HTTP status:** `409`. The attachment exists but its capture from the channel has not completed, so there are no bytes to serve yet. The response carries a one-second Retry-After. ## Troubleshooting - Wait error.retry\_after seconds and retry the same GET /v1/attachments/{attachment}/content. ## Related - [Downloading an attachment](/channel/whatsapp/api/resources/attachments/methods/download/index.md) --- # 2009: Idempotency conflict. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/2xxx/2009/ **HTTP status:** `409`. The key is bound to an earlier request whose body differs from this one, so the reuse is refused rather than replayed. Nothing new was recorded. ## Troubleshooting - Use a fresh Idempotency-Key for a new operation. - Replay the same Idempotency-Key with an identical body to read the original outcome instead of guessing. ## Related - [Sending a message](/channel/whatsapp/api/resources/chats/subresources/messages/methods/send/index.md) --- # 2010: Webhook endpoint not found. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/2xxx/2010/ **HTTP status:** `404`. The endpoint id does not resolve for this account and mode. ## Troubleshooting - List endpoints with GET /v1/webhook\_endpoints and use an id from that account. ## Related - [Webhook endpoints](/channel/whatsapp/api/resources/webhook_endpoints/index.md) --- # 2011: Not found. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/2xxx/2011/ **HTTP status:** `404`. The addressed resource (other than a chat, which answers chat\_not\_found) does not exist for this account and mode; a resource belonging to another account answers identically. ## Troubleshooting - Verify the id came from this account’s own reads or events, in the same livemode. ## Related - [API reference](/channel/whatsapp/api/index.md) --- # 2012: Operation forbidden. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/2xxx/2012/ **HTTP status:** `403`. The delegated capability credential is valid but its operation class does not cover this method and route. ## Troubleshooting - Mint a capability credential whose operation class covers this operation, or use the account’s partner API key. ## Related - [Authentication](/channel/whatsapp/getting-started/authentication/index.md) --- # 2013: Part type not found. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/2xxx/2013/ **HTTP status:** `404`. GET /v1/parts/{type} was asked for a type outside the published union. ## Troubleshooting - GET /v1/openapi.yaml lists every part type. ## Related - [Part schemas](/channel/whatsapp/api/resources/contract/methods/part_schema/index.md) --- # 2014: Reply target not found. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/2xxx/2014/ **HTTP status:** `422`. reply\_to\_message\_id names no message available to this account in the addressed chat. Nothing was sent. ## Troubleshooting - Use a message id from this chat’s transcript (GET /v1/chats/{chat}/events). ## Related - [Sending a message](/channel/whatsapp/api/resources/chats/subresources/messages/methods/send/index.md) --- # 2015: Route not found. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/2xxx/2015/ **HTTP status:** `404`. The path is not one this API serves. ## Troubleshooting - GET /v1/openapi.yaml is the API’s own map of what exists. ## Related - [API reference](/channel/whatsapp/api/index.md) --- # 2029: Webhook replay not found. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/2xxx/2029/ **HTTP status:** `404`. The replay id does not resolve for this endpoint and account, or the endpoint itself does not. ## Troubleshooting - Use the replay id returned by POST /v1/webhook\_endpoints/{endpoint}/replays and the endpoint it was created on. ## Related - [Retrieving a replay](/channel/whatsapp/api/resources/webhook_endpoints/subresources/replays/methods/retrieve/index.md) --- # 2030: Replay in progress. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/2xxx/2030/ **HTTP status:** `409`. Only one replay may run per endpoint at a time. ## Troubleshooting - Poll GET /v1/webhook\_endpoints/{endpoint}/replays/{replay} until the running replay completes, then request the next one. ## Related - [Replaying deliveries](/channel/whatsapp/api/resources/webhook_endpoints/subresources/replays/methods/create/index.md) --- # 2031: Capability outcome indeterminate. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/2xxx/2031/ **HTTP status:** `409`. The request ran under a delegated capability credential and the outcome record could not be finished. The operation may or may not have taken effect. ## Troubleshooting - Do not retry blindly; read the affected resource (the chat, template or endpoint) to learn its current state first. - If it persists, contact support and quote the request\_id. --- # 2032: Cursor expired. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/2xxx/2032/ **HTTP status:** `410`. The cursor points before the retained beginning of the event log or stream, so a gapless resume from it is impossible. Reconnect without a cursor to continue from the current position. ## Troubleshooting - Use the chat and transcript reads (GET /v1/chats/{chat}/events) to backfill anything you missed before resuming. ## Related - [Event log](/channel/whatsapp/api/resources/event_log/methods/list/index.md) - [Event stream](/channel/whatsapp/api/resources/streams/methods/events/index.md) --- # 2033: Last active secret. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/2xxx/2033/ **HTTP status:** `409`. An endpoint must keep at least one active secret while it is enabled, so retiring this one is refused. ## Troubleshooting - Add a new secret with POST /v1/webhook\_endpoints/{endpoint}/secrets first, then retire the old one. ## Related - [Endpoint secrets](/channel/whatsapp/api/resources/webhook_endpoints/subresources/secrets/index.md) --- # 2034: No channel account. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/2xxx/2034/ **HTTP status:** `503`. No connected channel account backs this partner account, so sends and template operations cannot proceed. This is onboarding state, not a fault in your request. ## Troubleshooting - Complete channel onboarding for the account, then retry. - Contact support if onboarding has completed and this persists. ## Related - [Connect WhatsApp](/channel/whatsapp/getting-started/connect-whatsapp/index.md) - [Phone numbers guide](/channel/whatsapp/guides/phone-numbers/index.md) --- # 2035: Nothing unread. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/2xxx/2035/ **HTTP status:** `409`. A mark-as-read command was refused because no unread inbound message exists on this chat. No read command was accepted. ## Troubleshooting - Read the chat’s transcript (GET /v1/chats/{chat}/events) to confirm its state before sending another read command. ## Related - [Mark as read](/channel/whatsapp/api/resources/chats/methods/mark_read/index.md) --- # 2036: Outside customer window. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/2xxx/2036/ **HTTP status:** `422`. May also be reported as a field-level finding in `error.details[]`. Only an approved template part may be sent when the customer’s 24-hour window has lapsed or never opened. Nothing was sent. ## Troubleshooting - Read error.context.expires\_at: a timestamp means the window lapsed, null means the customer has never messaged this number. - Send a template part, or wait for the customer to reply, which reopens the window. ## Related - [Sending messages guide](/channel/whatsapp/guides/messaging/sending-messages/index.md) - [Templates guide](/channel/whatsapp/guides/templates/index.md) --- # 2037: Reply target not ready. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/2xxx/2037/ **HTTP status:** `422`. reply\_to\_message\_id names a message with no channel identity to quote. It failed, its outcome could not be established, or the channel has not acknowledged it and this send cannot wait for that. A message you just sent is normally accepted and goes out after it. Nothing was sent. ## Troubleshooting - Read the target message’s status. If it reads failed or unknown, do not wait, because it may never reach sent. Send without reply\_to\_message\_id or quote a message that was sent. A send naming a target that reads unknown may be accepted and fail later with target\_message\_failed, or may be refused as not ready. - Otherwise resend the reply once the target reads sent. This refusal can still happen for a target that has only just reached sent, and it is safe to retry. ## Related - [Sending a message](/channel/whatsapp/api/resources/chats/subresources/messages/methods/send/index.md) --- # 2038: Template exists. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/2xxx/2038/ **HTTP status:** `409`. The account already holds a template registered under this name and language. Nothing was submitted. ## Troubleshooting - List templates with GET /v1/templates and reuse the existing one, or submit under a new name. ## Related - [Creating a template](/channel/whatsapp/api/resources/templates/methods/create/index.md) --- # 2039: Template outcome indeterminate. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/2xxx/2039/ **HTTP status:** `409`. The create call may have reached the channel but its answer is unknown, so the local record cannot say whether the template exists there. This state is permanent for this name until reconciled. ## Troubleshooting - Do not resubmit under the same name; read GET /v1/templates after registry reconciliation, or contact support with the request\_id. ## Related - [Creating a template](/channel/whatsapp/api/resources/templates/methods/create/index.md) --- # 2040: Too many active secrets. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/2xxx/2040/ **HTTP status:** `409`. An endpoint may hold up to five active signing secrets at once and this one is full. Nothing was added. ## Troubleshooting - Retire a secret with the retire operation, then add the new one; a rotation needs two active secrets at most. ## Related - [Endpoint secrets](/channel/whatsapp/api/resources/webhook_endpoints/subresources/secrets/index.md) --- # 2041: Webhook endpoint exists. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/2xxx/2041/ **HTTP status:** `409`. May also be reported as a field-level finding in `error.details[]`. The account already registers an endpoint at this URL. Nothing was created. ## Troubleshooting - List endpoints with GET /v1/webhook\_endpoints and update the existing one instead of creating a duplicate. ## Related - [Creating a webhook endpoint](/channel/whatsapp/api/resources/webhook_endpoints/methods/create/index.md) --- # 2042: Webhook endpoint limit. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/2xxx/2042/ **HTTP status:** `422`. No further endpoints can be registered until one is removed. ## Troubleshooting - Remove an unused endpoint with DELETE /v1/webhook\_endpoints/{endpoint}, then retry. ## Related - [Creating a webhook endpoint](/channel/whatsapp/api/resources/webhook_endpoints/methods/create/index.md) --- # 2043: Attachment unavailable. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/2xxx/2043/ **HTTP status:** `410`. The attachment’s bytes have passed their retention and were removed; the id will not resolve again. ## Troubleshooting - Download attachments promptly after the event that delivers them; retention is documented on the attachment operation. ## Related - [Downloading an attachment](/channel/whatsapp/api/resources/attachments/methods/download/index.md) --- # 2047: No sending number. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/2xxx/2047/ **HTTP status:** `503`. No sending number is provisioned to this account, so nothing can be sent. This is onboarding state, not a fault in your request. ## Troubleshooting - Complete number provisioning, then retry; contact support if a number should already be attached. ## Related - [Phone numbers guide](/channel/whatsapp/guides/phone-numbers/index.md) - [Phone numbers](/channel/whatsapp/api/resources/phone_numbers/methods/list/index.md) --- # 2049: Reaction target not found. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/2xxx/2049/ **HTTP status:** `422`. The reaction part’s message\_id names no message available to this account in the addressed chat. Nothing was sent. ## Troubleshooting - Use a message id from this chat’s transcript (GET /v1/chats/{chat}/events). --- # 2050: Reaction target not ready. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/2xxx/2050/ **HTTP status:** `422`. The reaction part’s message\_id names a message with no channel identity to address. It failed, its outcome could not be established, or the channel has not acknowledged it and this send cannot wait for that. A message you just sent is normally accepted and the reaction goes out after it. Nothing was sent. ## Troubleshooting - Read the target message’s status. If it reads failed or unknown, do not wait, because it may never reach sent. React to a message that was sent. A send naming a target that reads unknown may be accepted and fail later with target\_message\_failed, or may be refused as not ready. - Otherwise resend the reaction once the target reads sent. This refusal can still happen for a target that has only just reached sent, and it is safe to retry. --- # 2051: Webhook delivery in progress. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/2xxx/2051/ **HTTP status:** `409`. The delivery is being attempted at this moment, so there is no timer to pull forward; the attempt’s result decides when the next one is due. Nothing was changed. ## Troubleshooting - Read the delivery with GET /v1/webhook\_deliveries?delivery\_id=… and retry once its state is pending again. --- # 2052: Webhook delivery terminal. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/2xxx/2052/ **HTTP status:** `409`. The delivery is delivered, permanently refused or has exhausted its attempts; the message names which. A finished delivery has no next attempt to pull forward. Nothing was changed. ## Troubleshooting - For a retry\_exhausted or permanent\_refusal delivery, replay its event with POST /v1/webhook\_endpoints/{endpoint}/replays. - A delivered delivery needs nothing further. --- # 2053: Webhook delivery not found. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/2xxx/2053/ **HTTP status:** `404`. The delivery id does not resolve for this account and mode. A delivery belonging to another account answers identically. ## Troubleshooting - Use a delivery id from GET /v1/webhook\_deliveries under the same key and mode. --- # 2054: Environment has no sending line. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/2xxx/2054/ **HTTP status:** `422`. This key was issued into an environment, and a key only ever sends from numbers currently in its own environment. None of the account’s registered sending numbers is in this one, so nothing was sent and nothing was stored. Unlike no\_sending\_number, this is yours to act on. ## Troubleshooting - Move a number into this environment where the account’s numbers are managed, then send again. - Or send with a key that acts in an environment holding a sending number; GET /v1/phone\_numbers under each key lists what that key can send from. --- # 2055: Environment stream unavailable. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/2xxx/2055/ **HTTP status:** `403`. This key was issued into an environment. GET /v1/streams/events and GET /v1/event\_log are served only to keys that act in no environment, and they carry only the events of numbers in none; an environment’s events reach you through the webhook endpoints registered under its key. Nothing was read and nothing changed. ## Troubleshooting - Register a webhook endpoint with POST /v1/webhook\_endpoints under this key; it receives exactly this environment’s events. - To read the stream or the event log, use a key that acts in no environment; it carries the events of numbers in none. --- # 2056: Nothing readable. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/2xxx/2056/ **HTTP status:** `409`. A mark-as-read command was refused because every unread inbound message on this chat is of a type that cannot be marked read, such as a message type this API does not support. No read command was accepted. A chat with no unread inbound message at all answers nothing\_unread instead. ## Troubleshooting - Nothing is owed on these messages; send a read command again after the customer’s next supported message, which it will target. - Read the chat’s transcript (GET /v1/chats/{chat}/events) to see which unread messages are unsupported. --- # 2057: Webhook account not connected. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/2xxx/2057/ **HTTP status:** `409`. A live webhook endpoint delivers events for the account’s connected messaging account, and this account has none yet, either because connecting it has not finished or because it was disconnected. Registering an endpoint, or any update that would leave a live endpoint enabled (including enabling a disabled one), is refused until one is connected. Nothing was created or changed, and no endpoint or signing secret was registered. ## Troubleshooting - Finish connecting the account’s messaging account, then repeat the request. - If the account’s messaging account is connected and this persists, contact support with the request\_id. --- # 3001: Attachment read unavailable. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/3xxx/3001/ **HTTP status:** `503`. The stored bytes exist but could not be read on this attempt. The response carries a one-second Retry-After. ## Troubleshooting - Wait error.retry\_after seconds and retry the same download. - If it persists, contact support and quote the request\_id. ## Related - [Downloading an attachment](/channel/whatsapp/api/resources/attachments/methods/download/index.md) --- # 3002: Authentication unavailable. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/3xxx/3002/ **HTTP status:** `503`. The capability credential could not be checked because its backing store did not answer. Nothing was read or changed. ## Troubleshooting - Retry the same request with bounded backoff; nothing was recorded. - If it persists, contact support and quote the request\_id. ## Related - [Authentication](/channel/whatsapp/getting-started/authentication/index.md) --- # 3003: Capability audit unavailable. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/3xxx/3003/ **HTTP status:** `503`. The audit record every delegated-capability request requires could not be opened, so the operation was not attempted. ## Troubleshooting - Retry the same request with bounded backoff; nothing was recorded. - If it persists, contact support and quote the request\_id. --- # 3004: Entitlement unavailable. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/3xxx/3004/ **HTTP status:** `503`. The rate catalog, cap or counter that admits a send did not answer. Nothing was sent or journaled. ## Troubleshooting - Retry the same request with bounded backoff; nothing was recorded. - If it persists, contact support and quote the request\_id. --- # 3006: Internal error. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/3xxx/3006/ **HTTP status:** `500`. An unexpected failure stopped the request. Nothing was recorded unless the response says otherwise. ## Troubleshooting - Retry with bounded backoff. - If it persists, contact support and quote the request\_id and, when present, the trace\_id. --- # 3008: Response failed. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/3xxx/3008/ **HTTP status:** `500`. The operation ran but its response failed to encode. The operation may have taken effect. ## Troubleshooting - Read the affected resource before retrying a mutation. - If it persists, contact support and quote the request\_id. --- # 3009: Sending guard unavailable. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/3xxx/3009/ **HTTP status:** `503`. The operational stop state every send is checked against did not answer, so the send was refused rather than assumed allowed. Nothing was journaled. ## Troubleshooting - Retry the same request with bounded backoff; nothing was recorded. - If it persists, contact support and quote the request\_id. --- # 3010: Stream unavailable. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/3xxx/3010/ **HTTP status:** `503`. GET /v1/streams/events has no backing store here. ## Troubleshooting - Use GET /v1/event\_log if it is available, or contact support. ## Related - [Event stream](/channel/whatsapp/api/resources/streams/methods/events/index.md) - [Events guide](/channel/whatsapp/guides/events/index.md) --- # 3011: Template asset unavailable. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/3xxx/3011/ **HTTP status:** `503`. Preparation of the template’s media asset was exhausted or its dependency did not answer. Nothing was submitted. ## Troubleshooting - Retry the unchanged submission later; if it persists, upload the asset again and contact support with the request\_id. ## Related - [Templates](/channel/whatsapp/api/resources/templates/index.md) --- # 3012: Template channel unavailable. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/3xxx/3012/ **HTTP status:** `503`. The template could not be submitted or read because the channel did not respond. Nothing was submitted. ## Troubleshooting - Retry the same request with bounded backoff; nothing was recorded. - If it persists, contact support and quote the request\_id. ## Related - [Templates](/channel/whatsapp/api/resources/templates/index.md) --- # 3013: Webhook registration unavailable. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/3xxx/3013/ **HTTP status:** `503`. The secret vault every endpoint needs is not available here, so registering an endpoint that could never sign a delivery is refused. ## Troubleshooting - Retry later; if it persists, contact support. ## Related - [Webhook endpoints](/channel/whatsapp/api/resources/webhook_endpoints/index.md) --- # 3014: Webhook replay unavailable. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/3xxx/3014/ **HTTP status:** `503`. The replay surface has no backing store here. ## Troubleshooting - Contact support if you need a replay. ## Related - [Replaying deliveries](/channel/whatsapp/api/resources/webhook_endpoints/subresources/replays/methods/create/index.md) --- # 3015: Event log unavailable. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/3xxx/3015/ **HTTP status:** `503`. GET /v1/event\_log has no backing store here. ## Troubleshooting - Use GET /v1/streams/events if it is available, or contact support. ## Related - [Event log](/channel/whatsapp/api/resources/event_log/methods/list/index.md) --- # 3016: Event payload invalid. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/3xxx/3016/ **HTTP status:** `500`. A stored partner event failed to render, so the page was withheld rather than served incomplete. ## Troubleshooting - Retry the same read; if it persists, contact support and quote the request\_id. ## Related - [Event log](/channel/whatsapp/api/resources/event_log/methods/list/index.md) --- # 3017: Webhook replay failed. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/3xxx/3017/ **HTTP status:** `500`. The replay could not be recorded. Nothing was scheduled. ## Troubleshooting - Retry with the same Idempotency-Key. - If it persists, contact support and quote the request\_id. ## Related - [Retrieving a replay](/channel/whatsapp/api/resources/webhook_endpoints/subresources/replays/methods/retrieve/index.md) --- # 3019: Not implemented. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/3xxx/3019/ **HTTP status:** `501`. The API is in beta and this route is declared ahead of its arrival. Retrying will not succeed until the operation lands. ## Troubleshooting - Check the operation’s first description line in GET /v1/openapi.yaml; it says Not yet available until the operation is live. ## Related - [API reference](/channel/whatsapp/api/index.md) --- # 3020: Rate not configured. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/3xxx/3020/ **HTTP status:** `503`. The rate catalog has no rate that applies to this account and send, so the service fails closed rather than sending unpriced traffic. Only operator action can clear it. ## Troubleshooting - Contact support rather than retrying; retries return the same answer until a rate is assigned. --- # 3021: Template submission in progress. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/3xxx/3021/ **HTTP status:** `503`. The same submission is actively preparing its media header; the request is bounded and resumable. Retry the unchanged body. ## Troubleshooting - Resend the identical request after a short wait; a changed body starts a new submission instead. ## Related - [Creating a template](/channel/whatsapp/api/resources/templates/methods/create/index.md) --- # 3022: Unavailable. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/3xxx/3022/ **HTTP status:** `503`. The request could not be authenticated, the stream could not be opened, or the event log could not be read because this service’s own store did not respond. Nothing was read or changed. ## Troubleshooting - Retry the same request with bounded backoff; nothing was recorded. - If it persists, contact support and quote the request\_id. --- # 4001: Exclude leaves no sender. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/4xxx/4001/ **HTTP status:** `422`. After excluding the numbers you named, no eligible sending number remains for this destination. Nothing was sent. ## Troubleshooting - Read error.context.pinned\_from when present: your exclude named the number this conversation already uses. - Shorten exclude or set from explicitly. ## Related - [Phone numbers guide](/channel/whatsapp/guides/phone-numbers/index.md) - [Sending a message](/channel/whatsapp/api/resources/chats/subresources/messages/methods/send/index.md) --- # 4003: From not sendable. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/4xxx/4003/ **HTTP status:** `422`. The number named in from is registered to this account but is no longer able to send (deregistered or released). Nothing was sent. ## Troubleshooting - Call GET /v1/phone\_numbers and choose a number whose status admits sending. ## Related - [Phone numbers guide](/channel/whatsapp/guides/phone-numbers/index.md) - [Sending a message](/channel/whatsapp/api/resources/chats/subresources/messages/methods/send/index.md) --- # 4004: Pinned line unsendable. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/4xxx/4004/ **HTTP status:** `422`. The number this conversation already uses is no longer a registered sending number of yours. Nothing was sent, no chat was forked and the pin was not moved. ## Troubleshooting - Read error.context.pinned\_from (the current number, absent when it is no longer yours) and error.context.available\_from (a number that could serve instead). - Open a new conversation by sending an approved template with from set to available\_from. ## Related - [Phone numbers guide](/channel/whatsapp/guides/phone-numbers/index.md) - [Sending a message](/channel/whatsapp/api/resources/chats/subresources/messages/methods/send/index.md) --- # 4005: Sending paused. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/4xxx/4005/ **HTTP status:** `503`. An operator or automatic safety stop currently prohibits this send. Nothing was journaled, and there is no honest retry instant to quote because lifting the stop is an operator action. ## Troubleshooting - Retry later with bounded backoff. - Contact support if the pause is unexpected. ## Related - [Sending a message](/channel/whatsapp/api/resources/chats/subresources/messages/methods/send/index.md) --- # 4006: Spend limit exceeded. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/4xxx/4006/ **HTTP status:** `422` or `429`, depending on the request. The projected charge would cross the account’s or number’s spend ceiling. With a known reset instant the response is 429 with Retry-After and error.retry\_after naming the exact reset; without one it is 422 with neither. Nothing was journaled. ## Troubleshooting - When error.retry\_after is present, wait that many seconds; the reset is the UTC day or month boundary. - A daily cap refuses any message carrying a template part; a message without one, such as a reply inside an open customer window, is still accepted past a daily cap and its charge still counts. The monthly cap refuses every send. ## Related - [Limits](/channel/whatsapp/guides/platform/limits/index.md) --- # 4007: Template not sendable. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/4xxx/4007/ **HTTP status:** `422`. The named template is not approved, was approved moments ago and is not yet ready to send, its parameters do not match its published schema, or a parameter cannot be addressed by name. Nothing was sent. ## Troubleshooting - Read the template with GET /v1/templates to confirm its status and send\_schema; details\[].param names the discriminating field. - An approved template whose send\_schema is still null becomes sendable within about fifteen minutes of approval; retry the same request then. ## Related - [Templates guide](/channel/whatsapp/guides/templates/index.md) - [Sending a message](/channel/whatsapp/api/resources/chats/subresources/messages/methods/send/index.md) --- # 4008: Tier quota exceeded. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/4xxx/4008/ **HTTP status:** `422` or `429`, depending on the request. The channel limits how many distinct customers a new conversation may be started with in a moving 24-hour period, and this template send would exceed it. With a known retry instant the response is 429 with Retry-After and error.retry\_after (a minimum wait); without one it is 422. Nothing was journaled. ## Troubleshooting - Wait at least error.retry\_after seconds when present; replies inside an open customer window are not counted. ## Related - [Limits](/channel/whatsapp/guides/platform/limits/index.md) - [Phone numbers](/channel/whatsapp/api/resources/phone_numbers/methods/list/index.md) --- # 4009: Replay capacity reached. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/4xxx/4009/ **HTTP status:** `429`. No further webhook replays can be scheduled for this account right now. The response carries a 60-second Retry-After mirrored in error.retry\_after. ## Troubleshooting - Wait error.retry\_after seconds and request the replay again. ## Related - [Replaying deliveries](/channel/whatsapp/api/resources/webhook_endpoints/subresources/replays/methods/create/index.md) - [Limits](/channel/whatsapp/guides/platform/limits/index.md) --- # 4010: Pinned line outside environment. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/4xxx/4010/ **HTTP status:** `422`. The number this conversation already uses is one of yours, but it is not in the environment this key acts in, and a key only ever sends from numbers in its own environment. Nothing was sent, no chat was forked and the pin was not moved. A conversation never moves to another number. The refusal names that number even though this key cannot otherwise list it, because it is your own number in another of your environments. ## Troubleshooting - Read error.context.pinned\_from (the conversation’s current number) and error.context.available\_from (a number in this environment that could serve, when one exists). - Send with a key that acts in the number’s environment to continue the same conversation, or open a separate conversation from this environment by sending an approved template with from set to available\_from. --- # 4011: Recipient phone number required. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/4xxx/4011/ **HTTP status:** `422`. May also be reported as a field-level finding in `error.details[]`. The customer is known to this account only by a username identifier, not a phone number, and the named template carries a one-time-code button (copy code, one-tap or zero-tap autofill), which can be delivered only to a phone number. Nothing was sent and nothing was journaled; sending the same template to the same customer is refused again. ## Troubleshooting - Deliver the one-time code another way; every other message type, including templates without a one-time-code button, can still be sent to this customer. - details\[].param points at the template part. ## Related - [Customers who use a username](/channel/whatsapp/guides/messaging/sending-messages/#customers-who-use-a-username/index.md) - [Templates guide](/channel/whatsapp/guides/templates/index.md) --- # 4012: Request rate exceeded. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/4xxx/4012/ **HTTP status:** `429`. Each API key may make a burst of requests and then a steady number per second. The limit is a safeguard set far above what an ordinary integration needs, and it stops runaway loops before they slow the service for everyone. Nothing was done for this request. The response carries Retry-After, mirrored in error.retry\_after, with the whole seconds to wait before a request from this key is accepted again. ## Troubleshooting - Wait error.retry\_after seconds, then retry; back off further if the refusal repeats. - Look for a loop that retries without waiting, or that polls a read in a tight cycle; use the event stream or webhooks instead of polling. ## Related - [Request rate](/channel/whatsapp/guides/platform/limits/#request-rate/index.md) - [Events guide](/channel/whatsapp/guides/events/index.md) --- # 4013: Event stream limit reached. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/4xxx/4013/ **HTTP status:** `429`. Each API key may hold a limited number of event streams open at once, and this request would open one more. No stream was opened. A slot frees when one of the key’s open streams closes; a stream whose client went away without closing it is released within about one heartbeat. The response carries Retry-After, mirrored in error.retry\_after, as a reconnect pace rather than a promise that a slot will be free. ## Troubleshooting - Reuse one stream per consumer rather than opening a new stream per task, and close streams you no longer read. - Make sure reconnect logic closes the old connection before opening a new one. ## Related - [Request rate](/channel/whatsapp/guides/platform/limits/#request-rate/index.md) - [Event stream](/channel/whatsapp/api/resources/streams/methods/events/index.md) --- # 5001: Download capacity exhausted. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/5xxx/5001/ **HTTP status:** `503`. The shared budget for attachment downloads is fully in use. The response carries a one-second Retry-After mirrored in error.retry\_after. ## Troubleshooting - Wait error.retry\_after seconds and retry the same download; nothing about the attachment changed. ## Related - [Downloading an attachment](/channel/whatsapp/api/resources/attachments/methods/download/index.md) --- # 5002: Media id inbound only. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/5xxx/5002/ **HTTP status:** `422`. media\_id identifies bytes that arrived from a customer and is never accepted as a send input. Nothing was sent. ## Troubleshooting - Upload outbound bytes with POST /v1/media and reference the returned upload\_ref in the part. ## Related - [Uploading media](/channel/whatsapp/api/resources/media/methods/upload/index.md) - [Sending messages guide](/channel/whatsapp/guides/messaging/sending-messages/index.md) --- # 5003: Media invalid. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/5xxx/5003/ **HTTP status:** `422`. May also be reported as a field-level finding in `error.details[]`. The upload’s kind, Content-Type, Content-Encoding, size or body does not satisfy the media rules; details\[].param names which. Nothing was stored. ## Troubleshooting - Read details\[] for the exact param (a JSON Pointer into your request) and each field’s own fault code. - Send the raw bytes with an exact Content-Type and a kind the upload operation documents. ## Related - [Uploading media](/channel/whatsapp/api/resources/media/methods/upload/index.md) --- # 5004: Upload capacity exhausted. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/5xxx/5004/ **HTTP status:** `503`. The shared budget for media uploads is fully in use. The response carries a one-second Retry-After mirrored in error.retry\_after. ## Troubleshooting - Wait error.retry\_after seconds and retry the same upload. ## Related - [Uploading media](/channel/whatsapp/api/resources/media/methods/upload/index.md) --- # 5005: Upload ref invalid. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/5xxx/5005/ **HTTP status:** `422`. The upload\_ref at param is not in the form POST /v1/media returns. Nothing was sent. ## Troubleshooting - Use the upload\_ref exactly as returned by POST /v1/media, in the same livemode. ## Related - [Uploading media](/channel/whatsapp/api/resources/media/methods/upload/index.md) - [Sending a message](/channel/whatsapp/api/resources/chats/subresources/messages/methods/send/index.md) --- # 5006: Upload ref not found. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/5xxx/5006/ **HTTP status:** `422`. The reference is well-formed but no ready upload by that reference exists for this account, or it has expired. Nothing was sent. ## Troubleshooting - Upload the bytes again with POST /v1/media and send promptly with the new upload\_ref. ## Related - [Uploading media](/channel/whatsapp/api/resources/media/methods/upload/index.md) - [Sending a message](/channel/whatsapp/api/resources/chats/subresources/messages/methods/send/index.md) --- # 5007: Media source invalid. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/5xxx/5007/ **HTTP status:** `422`. The address at param was refused by the fetch policy before any bytes were read. It must be an absolute https URL on the default port, carry no credentials or fragment, and resolve to a public address on every redirect hop, with at most three redirects. Nothing was sent. ## Troubleshooting - Serve the file from a public https host on port 443 and supply that address without credentials. - Check that neither the address nor any redirect it answers with points at a private, loopback, link-local or otherwise non-public destination. - If the file cannot be served that way, upload the bytes with POST /v1/media and send the returned upload\_ref instead. --- # 5008: Media source unavailable. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/5xxx/5008/ **HTTP status:** `422`. The address at param could not be reached, did not answer within the fetch deadline, answered with a status other than 200, or delivered fewer bytes than it promised. The fetch keeps only a complete body. Nothing was sent. ## Troubleshooting - Confirm the address serves the file directly with a 200 answer, without authentication or a redirect to a page. - Serve the file quickly enough to complete within the fetch deadline, then retry the send. - For large or slow-to-serve files, upload the bytes with POST /v1/media and send the returned upload\_ref. --- # 5009: Media source unsupported. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/5xxx/5009/ **HTTP status:** `422`. The address at param answered with a media type the part’s kind does not accept, a body over the kind’s size ceiling, a sticker without a readable WebP container, or a body with no usable Content-Type or with a Content-Encoding. The bytes are held to exactly the rules POST /v1/media applies to the same kind and are never converted, truncated or decoded. Nothing was sent. ## Troubleshooting - Set kind to match the file the address serves, and serve it under a media type the upload operation documents for that kind. - Serve the exact file bytes with their Content-Type and no Content-Encoding. - Keep the file within the kind’s byte ceiling; the ceilings are those of POST /v1/media. --- # 5010: Media source capacity exhausted. URL: https://docs.linqapp.com/channel/whatsapp/error/codes/5xxx/5010/ **HTTP status:** `503`. The service’s shared capacity for fetching and holding partner-hosted media is fully in use. The send was not accepted and nothing was fetched. No Retry-After is quoted; capacity frees within seconds as other fetches complete. ## Troubleshooting - Retry the same request shortly. - Upload the bytes with POST /v1/media and send the returned upload\_ref, which does not use fetch capacity. --- # API Reference URL: https://docs.linqapp.com/channel/whatsapp/api/ ## [Attachments](/channel/whatsapp/api/resources/attachments/index.md) - [Download](/channel/whatsapp/api/resources/attachments/methods/download/index.md) ## [Chats](/channel/whatsapp/api/resources/chats/index.md) - [List](/channel/whatsapp/api/resources/chats/methods/list/index.md) - [Mark Read](/channel/whatsapp/api/resources/chats/methods/mark_read/index.md) - [Retrieve](/channel/whatsapp/api/resources/chats/methods/retrieve/index.md) - [Events](/channel/whatsapp/api/resources/chats/subresources/events/index.md) - [List](/channel/whatsapp/api/resources/chats/subresources/events/methods/list/index.md) - [Messages](/channel/whatsapp/api/resources/chats/subresources/messages/index.md) - [Send](/channel/whatsapp/api/resources/chats/subresources/messages/methods/send/index.md) ## [Contract](/channel/whatsapp/api/resources/contract/index.md) - [OpenAPI](/channel/whatsapp/api/resources/contract/methods/openapi/index.md) - [Part Schema](/channel/whatsapp/api/resources/contract/methods/part_schema/index.md) ## [Destination Messages](/channel/whatsapp/api/resources/destination_messages/index.md) - [Send](/channel/whatsapp/api/resources/destination_messages/methods/send/index.md) ## [Event Log](/channel/whatsapp/api/resources/event_log/index.md) - [List](/channel/whatsapp/api/resources/event_log/methods/list/index.md) ## [Media](/channel/whatsapp/api/resources/media/index.md) - [Upload](/channel/whatsapp/api/resources/media/methods/upload/index.md) ## [Phone Numbers](/channel/whatsapp/api/resources/phone_numbers/index.md) - [List](/channel/whatsapp/api/resources/phone_numbers/methods/list/index.md) ## [Streams](/channel/whatsapp/api/resources/streams/index.md) - [Events](/channel/whatsapp/api/resources/streams/methods/events/index.md) ## [Templates](/channel/whatsapp/api/resources/templates/index.md) - [Create](/channel/whatsapp/api/resources/templates/methods/create/index.md) - [List](/channel/whatsapp/api/resources/templates/methods/list/index.md) ## [Webhook Deliveries](/channel/whatsapp/api/resources/webhook_deliveries/index.md) - [List](/channel/whatsapp/api/resources/webhook_deliveries/methods/list/index.md) - [Retry](/channel/whatsapp/api/resources/webhook_deliveries/methods/retry/index.md) ## [Webhook Endpoints](/channel/whatsapp/api/resources/webhook_endpoints/index.md) - [Create](/channel/whatsapp/api/resources/webhook_endpoints/methods/create/index.md) - [Delete](/channel/whatsapp/api/resources/webhook_endpoints/methods/delete/index.md) - [List](/channel/whatsapp/api/resources/webhook_endpoints/methods/list/index.md) - [Retrieve](/channel/whatsapp/api/resources/webhook_endpoints/methods/retrieve/index.md) - [Update](/channel/whatsapp/api/resources/webhook_endpoints/methods/update/index.md) - [Replays](/channel/whatsapp/api/resources/webhook_endpoints/subresources/replays/index.md) - [Create](/channel/whatsapp/api/resources/webhook_endpoints/subresources/replays/methods/create/index.md) - [Retrieve](/channel/whatsapp/api/resources/webhook_endpoints/subresources/replays/methods/retrieve/index.md) - [Secrets](/channel/whatsapp/api/resources/webhook_endpoints/subresources/secrets/index.md) - [Create](/channel/whatsapp/api/resources/webhook_endpoints/subresources/secrets/methods/create/index.md) - [Delete](/channel/whatsapp/api/resources/webhook_endpoints/subresources/secrets/methods/delete/index.md) - [List](/channel/whatsapp/api/resources/webhook_endpoints/subresources/secrets/methods/list/index.md) --- # Attachments URL: https://docs.linqapp.com/channel/whatsapp/api/resources/attachments/ ## Download an attachment **get** `/v1/attachments/{attachment}/content` Downloads exact retained inbound bytes using this account's Bearer key. URLs are stable and require Authorization on every request. Pending capture returns 409 attachment_not_ready with Retry-After; a message.received event is recorded once its attachments are captured or have failed, or ten minutes after the message arrived, whichever comes first. An attachment the event marks available downloads at once; one marked unavailable with reason timed_out may still answer 409 and later become downloadable; a part with no availability is from a historical event and may still be capturing, so retry its 409 as Retry-After directs; failed or expired retained assets return 410 attachment_unavailable; missing, pruned, outbound or foreign assets return 404 attachment_not_found. Retention is 30 days from server receipt and downloads do not extend it. GET admitted before expiry may finish from acquired bytes. Range is ignored (full 200 response); HEAD is refused. ### Path Parameters - `attachment: string` ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/attachments/$ATTACHMENT/content \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` --- # Download an attachment URL: https://docs.linqapp.com/channel/whatsapp/api/resources/attachments/methods/download/ **get** `/v1/attachments/{attachment}/content` Downloads exact retained inbound bytes using this account's Bearer key. URLs are stable and require Authorization on every request. Pending capture returns 409 attachment_not_ready with Retry-After; a message.received event is recorded once its attachments are captured or have failed, or ten minutes after the message arrived, whichever comes first. An attachment the event marks available downloads at once; one marked unavailable with reason timed_out may still answer 409 and later become downloadable; a part with no availability is from a historical event and may still be capturing, so retry its 409 as Retry-After directs; failed or expired retained assets return 410 attachment_unavailable; missing, pruned, outbound or foreign assets return 404 attachment_not_found. Retention is 30 days from server receipt and downloads do not extend it. GET admitted before expiry may finish from acquired bytes. Range is ignored (full 200 response); HEAD is refused. ### Path Parameters - `attachment: string` ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/attachments/$ATTACHMENT/content \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` --- # Chats URL: https://docs.linqapp.com/channel/whatsapp/api/resources/chats/ ## List chats **get** `/v1/chats` Lists the brand's chats, most recently active first. A chat moves to the front when its latest event is applied. The page is a keyset, not an offset: pass the previous page's `next_cursor` back verbatim. A cursor this API did not issue — including an empty one — is refused rather than treated as the beginning, so a paging loop cannot silently restart. **A walk of this list is not a snapshot, and the gap is one-directional.** The order is activity and activity only ever moves a chat toward the front, so a chat that receives a message while you are paging jumps ABOVE your cursor and is not returned again: on a busy account, a full walk silently omits the conversations that were active during it. It never returns one twice. That is a property of ordering by activity, so plan around it rather than against it: the chats you missed are exactly the chats that just had traffic, which `GET /v1/streams/events` announces as it happens and `GET /v1/chats/{chat}/events` reads back in full. Reconcile with those two, not by walking the list again. Within one chat the transcript's order is the journal's own immutable sequence and never moves; when ephemeral messages are enabled, expired messages and their related events are omitted and their `seq` positions remain as visible gaps. ### Query Parameters - `cursor: optional string` Cursor from a previous page's `next_cursor`. - `limit: optional number` Page size. The bounds are in this parameter's schema, not only in this sentence — a value outside them is refused, never clamped. ### Returns - `ChatPage object { data, has_more, next_cursor }` A page of chats. - `data: array of Chat` - `id: string` The chat's id. - `created_at: string` - `customer: string` Customer address as an opaque identifier. - `customer_window: object { expires_at, state, source }` The customer service window — first-class state on every chat read. Only `template` parts are sendable while it is closed. - `expires_at: string` When the open window expires. `null` when no window has ever opened. - `state: string` `open` or `closed`. - `source: optional string` What opened the current window: `customer_message`, or `free_entry_point` for ad-sourced windows. Absent when no window has ever opened. - `phone_number_id: string` The id of the sending number this chat is pinned to. - `updated_at: string` When the chat last changed — a new event moves it. - `customer_kind: optional string` The form of `customer`: `phone_number` or `username_identifier`. Branch on this rather than on the value's shape. Values may grow, so treat anything else as an address you can reply to but cannot read as a number. Absent for an address of neither form. - `from: optional string` The number this conversation sends from, in E.164 (leading `+`). This is the value to pass back as a send's `from` to address this exact conversation. Absent only if the number is no longer one of yours. - `has_more: boolean` True when another page exists — pass `next_cursor` to fetch it. - `next_cursor: optional string` Opaque cursor for the next page; present when `has_more` is true. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/chats \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` #### Response ```json { "data": [ { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "customer": "customer", "customer_window": { "expires_at": "2019-12-27T18:11:19.117Z", "state": "state", "source": "source" }, "phone_number_id": "phone_number_id", "updated_at": "2019-12-27T18:11:19.117Z", "customer_kind": "customer_kind", "from": "from" } ], "has_more": true, "next_cursor": "next_cursor" } ``` ## Mark a chat read **post** `/v1/chats/{chat}/read` Marks one unread inbound message as read, optionally showing the typing indicator. That message is the latest unread inbound one that can be marked read. An unread message of a type this API does not support (its only part is `unsupported`) cannot be marked read and is never the target; it is skipped in favour of a supported unread message, and the `chat.read` event names the message actually targeted. The upstream command targets that one message; this API does not promise that the channel also marks earlier inbound messages, and an unsupported one is known not to be marked. Omit the body, or send `{}`, for read-only; the two forms are identical. `typing: false` is identical too. If the chat is not available to this account, the request is refused with `404 chat_not_found`. If it has no unread inbound message, it is refused with `409 nothing_unread`; if it has unread inbound messages but every one is unsupported, it is refused with `409 nothing_readable`. This route does not act as a standalone typing refresh. `202` means the command and its `chat.read` journal event are durable; the upstream action is asynchronous. Read receipts and typing are outbound-only: this API never reports customer typing. Within one chat, order follows acceptance, and acceptance is this API's `202`: calls made concurrently can be accepted in either order, so wait for a send's `202` before calling this route if the read should follow it. This command is handed to the channel after the sends accepted before it. The wait ends when no earlier send is still on its way to the channel or awaiting an outcome, and lasts about 5 seconds from this command's acceptance: past that, for example behind a send whose outcome is still unknown, the command goes anyway. A send paused by a safety stop does not hold it beyond that wait. If the order cannot be checked, the command goes without waiting. This command does not wait for sends accepted after it, and one of those can reach the channel first. The read still goes; the typing indicator is omitted when a later send exists at hand-over, when the order could not be checked, or when the command is 25 seconds old or older. This is the order of handing to the channel, not a promise of the order the customer's device shows. ### Path Parameters - `chat: string` ### Body Parameters - `typing: optional boolean` Also show the customer the typing indicator, which auto-dismisses after a short time or when your next message arrives. Read receipts and typing are outbound-only: the API never reports customer typing. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/chats/$CHAT/read \ -X POST \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` ## Get a chat **get** `/v1/chats/{chat}` Reads one chat, including its live customer-window state. A chat id that is not this key's answers `404` — the same answer an id that does not exist gets, because a response must never confirm one across accounts. ### Path Parameters - `chat: string` ### Returns - `Chat object { id, created_at, customer, 5 more }` One customer conversation. - `id: string` The chat's id. - `created_at: string` - `customer: string` Customer address as an opaque identifier. - `customer_window: object { expires_at, state, source }` The customer service window — first-class state on every chat read. Only `template` parts are sendable while it is closed. - `expires_at: string` When the open window expires. `null` when no window has ever opened. - `state: string` `open` or `closed`. - `source: optional string` What opened the current window: `customer_message`, or `free_entry_point` for ad-sourced windows. Absent when no window has ever opened. - `phone_number_id: string` The id of the sending number this chat is pinned to. - `updated_at: string` When the chat last changed — a new event moves it. - `customer_kind: optional string` The form of `customer`: `phone_number` or `username_identifier`. Branch on this rather than on the value's shape. Values may grow, so treat anything else as an address you can reply to but cannot read as a number. Absent for an address of neither form. - `from: optional string` The number this conversation sends from, in E.164 (leading `+`). This is the value to pass back as a send's `from` to address this exact conversation. Absent only if the number is no longer one of yours. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/chats/$CHAT \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` #### Response ```json { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "customer": "customer", "customer_window": { "expires_at": "2019-12-27T18:11:19.117Z", "state": "state", "source": "source" }, "phone_number_id": "phone_number_id", "updated_at": "2019-12-27T18:11:19.117Z", "customer_kind": "customer_kind", "from": "from" } ``` ## Domain Types ### Chat - `Chat object { id, created_at, customer, 5 more }` One customer conversation. - `id: string` The chat's id. - `created_at: string` - `customer: string` Customer address as an opaque identifier. - `customer_window: object { expires_at, state, source }` The customer service window — first-class state on every chat read. Only `template` parts are sendable while it is closed. - `expires_at: string` When the open window expires. `null` when no window has ever opened. - `state: string` `open` or `closed`. - `source: optional string` What opened the current window: `customer_message`, or `free_entry_point` for ad-sourced windows. Absent when no window has ever opened. - `phone_number_id: string` The id of the sending number this chat is pinned to. - `updated_at: string` When the chat last changed — a new event moves it. - `customer_kind: optional string` The form of `customer`: `phone_number` or `username_identifier`. Branch on this rather than on the value's shape. Values may grow, so treat anything else as an address you can reply to but cannot read as a number. Absent for an address of neither form. - `from: optional string` The number this conversation sends from, in E.164 (leading `+`). This is the value to pass back as a send's `from` to address this exact conversation. Absent only if the number is no longer one of yours. ### Chat Event - `ChatEvent object { occurred_at, seq, type, message }` One visible entry in a chat's stored event sequence. - `occurred_at: string` - `seq: number` The event's position in this chat's stored sequence. Positions are assigned contiguously from 1 and never renumbered. When ephemeral messages are enabled, reads omit an expired message and its related events, so the `seq` values returned to that account have gaps where those events were. Use this as the chat's events-read cursor. It is scoped to one chat, so it is NOT the `/v1/streams/events` stream cursor: that stream spans every chat and carries its own cursor in each frame's `id`. - `type: string` The event's kind, e.g. `message.received`, `message.sent`. Kinds grow additively — skip what you do not handle. `chat.event.unknown` is the one kind that never carries meaning: it marks a journal entry whose partner-visible kind is not published yet. It preserves that stored position instead of hiding an unpublished kind. Expired ephemeral messages are different: retention omits their related events from reads, leaving visible gaps in `seq`. Skip this kind. - `message: optional Message` The message this event is about, on message-kind events. - `id: string` This API's message id. Put this value in an outbound reaction's `message_id`; an inbound reaction to this message carries the same value in its `message_id`, so this is the one identifier you need to keep. Mark-as-read targets the latest unread inbound message in a chat, so it takes the chat id. - `chat_id: string` The chat this message belongs to. - `created_at: string` - `direction: "inbound" or "outbound"` `inbound` (from the customer) or `outbound` (sent by you). - `"inbound"` - `"outbound"` - `parts: array of object { body, type, preview_url } or object { kind, type, availability, 10 more } or object { language, name, type, 4 more } or 17 more` The message content — sendable parts, plus the inbound-only types on inbound messages. Empty only when `zero_retention` is true, or when an idempotent retry returns an ephemeral message whose content retention cleanup has removed. - `Text object { body, type, preview_url }` A plain text message. - `body: string` The message text. URLs render as tappable links. - `type: "text"` - `"text"` - `preview_url: optional boolean` Render a preview card for the first URL in body. Defaults to false. - `Media object { kind, type, availability, 10 more }` A media message — image, video, audio, document, or sticker. The two identifiers are distinct namespaces: inbound media carries the channel's transient media_id; outbound media carries our durable upload_ref from POST /v1/media. - `kind: "image" or "video" or "audio" or 2 more` Which kind of media this is. Captions apply to image, video and document only; filename applies to document only. - `"image"` - `"video"` - `"audio"` - `"document"` - `"sticker"` - `type: "media"` - `"media"` - `availability: optional "available" or "unavailable" or "pending"` Response only, inbound parts only: whether the download answers the bytes. available: the file was captured and is retained. unavailable: it is not downloadable now, and unavailable_reason says why; with timed_out the download answers 409 while capture continues and can later answer 200, otherwise it answers 410, or 404 once the file is no longer known. It describes the file, not the exact HTTP answer of a later download, which can also refuse for capacity or authorization. pending: capture has not finished yet; only reads of the conversation return pending, and a message event never does. A message.received event is recorded once every attachment has been captured or has failed, or ten minutes after the message arrived, whichever comes first; an event part without availability is from a historical event and may still be capturing, so retry its download as the 409 Retry-After directs. A message event keeps the value it was recorded with; reads return the current one. Historical messages received before it was recorded omit it. Never accepted on sends. - `"available"` - `"unavailable"` - `"pending"` - `byte_size: optional number` Response only, inbound parts only: the exact size in bytes of the retained attachment, equal to the download's Content-Length. Present only while the bytes are captured and retained — the same lifetime as a working url, ending 30 days after server receipt — so it can be absent from a message event while capture has not completed, and its absence is not final; once present it never changes. Absent rather than zero. Never accepted on sends. - `caption: optional string` Caption rendered with the media. Image, video and document only — a caption on an audio or sticker part is rejected, never dropped. - `filename: optional string` Display filename. Documents only — a filename on any other kind is rejected, never dropped. - `media_id: optional string` Inbound only: the channel's transient media identifier. It expires after seven days and is never an outbound address; an outbound value is rejected with a pointer to media_id and upload_ref as the remedy. - `mime_type: optional string` Response only, inbound parts only: the media type the channel declared when the message arrived, verbatim. It may carry parameters (for example audio/ogg; codecs=opus) and may differ from the Content-Type the download answers with, which describes the retained bytes. Present on the webhook body and on every later read with the same value. Historical messages received before it was recorded omit this field. Never accepted on sends. - `source_url: optional string` Outbound only: a public https URL of the bytes to send, as an alternative to upload_ref. Supply exactly one of upload_ref or source_url. The address is fetched once, before the send is accepted, and its exact bytes are stored as an ordinary upload in this account and key partition; the accepted message and every later read carry that upload's upload_ref, never the address, and no retry fetches it again. The URL must be absolute https on the default port with no credentials and no fragment, must resolve to a public address (every redirect hop included, at most three), and must answer with the complete bytes and their exact media type within the fetch deadline. The bytes are then held to the same media type and size rules as POST /v1/media for the part's kind; a mismatch is refused, never converted. - `unavailable_reason: optional string` Response only, present only when availability is unavailable. An open string: the values today are timed_out, capture_failed and expired, and new values may be added. timed_out: the file was still being retrieved ten minutes after the message arrived, so its message event was recorded without it; retrieval continues and the file may become downloadable later, which reads of the conversation report. capture_failed: the file could not be retrieved. expired: the file was retrieved and is no longer retained, or is no longer known (the download then answers 410 or 404). Treat an unknown value as capture_failed. Never accepted on sends. - `upload_ref: optional string` Outbound only: our durable handle returned by POST /v1/media. Handles visibly begin upload. and are reusable within the account and key partition that created them. - `url: optional string` Response only: stable attachment download URL requiring the account Bearer key on every request. Pending capture returns 409 with Retry-After; retained bytes expire 30 days after server receipt. Historical unbound messages omit this field. Never accepted on sends. - `voice: optional boolean` Audio only. On a send it is optional: true sends the audio as a voice note; false, or leaving it out, sends it as an ordinary audio file. A voice note needs an upload stored as audio/ogg that holds mono Opus audio, sent by upload_ref or source_url within the existing audio size limit. The bytes are sent as supplied: they are never converted or inspected, so encode them as mono Opus before uploading. The recipient sees a play button only when the voice file is 512 KB or smaller; a larger voice note is still delivered but must be downloaded before it plays. On incoming audio parts it is response-only: whether the channel reported the audio as a voice note, verbatim. true means it was recorded with the messaging client's voice-recording feature; false means it was sent as an audio file. Present on the webhook body and on every later read with the same value. Absent on an incoming part means the channel did not say, never that the audio is not a voice note. Other kinds never carry it, and historical messages received before it was recorded omit it. - `Template object { language, name, type, 4 more }` An approved message template — the one part type sendable outside an open customer service window. name and language identify the approved template; parameters fills its named placeholders. Authentication templates use this same generic part: their published parameter schema names exactly one parameter, `code` — the one-time code you generate, 1–15 characters — and the message shows it in its body and behind its code button. Every sendable template is registered and approved ahead of the send and publishes its own parameter schema — a send referencing an unknown template, a missing or unknown parameter, or a value that breaks the template's rules is rejected with a 422 naming the exact field. - `language: string` The template's language-and-locale code, e.g. en_US. - `name: string` The approved template's name. Lowercase letters, digits and underscores only. - `type: "template"` - `"template"` - `buttons: optional array of object { index, payload, type }` Send-time values for this approved template's own dynamic buttons, in ascending index order: a url button whose destination ends in {{1}} takes the value appended there and is REQUIRED; a quick_reply button takes the payload returned to you when it is tapped and is OPTIONAL — omit it and the button returns its label. Fixed buttons have no slot. The approved template's send_schema lists the (index, type) slots and an x-rule stating which are required; omit buttons entirely for a template with no url slot when the labels are what you want back. - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `cards: optional array of object { card_index, kind, upload_ref, 2 more }` Per-card values for an approved media-card carousel. The approved template's send_schema provides structural bounds and an x-rule listing the exact card order, media kind, named body values, and dynamic button slots enforced by runtime L2 validation. Omit for non-carousel templates. - `card_index: number` - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: string` A durable handle returned by POST /v1/media. It is resolved within this key's account and partition, then consumed into a transient channel media identifier only at delivery. - `buttons: optional array of object { index, payload, type }` - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `parameters: optional unknown` Named values for this card's body placeholders. - `header: optional object { kind, upload_ref }` The uploaded media used for this approved template's media header. Omit unless this template's send_schema requires it. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `parameters: optional unknown` Named values for the template's placeholders. The shape is per-template: each registered template publishes its own parameter schema — hand THAT schema to your model when composing a specific template. Omit for templates with no placeholders. - `InteractiveList object { body, button, sections, 3 more }` An interactive list message: body text plus a button that opens a sectioned list of selectable rows. The customer's selection arrives as an inbound interactive_reply part with kind list_reply, carrying the chosen row's id. - `body: string` The message body. - `button: string` Label of the button that opens the list. - `sections: array of object { rows, title }` The list's sections, each holding selectable rows. At most 10 rows in total across ALL sections combined — not 10 per section. - `rows: array of object { id, title, description }` This section's rows. The 10-row limit is on the TOTAL across all sections, so a second section reduces what this one may hold. - `id: string` Your identifier for the row — echoed back as the interactive_reply's id. - `title: string` The row's visible title. - `description: optional string` Secondary text under the title. - `title: optional string` Section title. Required when the list has more than one section. - `type: "interactive_list"` - `"interactive_list"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `InteractiveButtons object { body, buttons, type, 3 more }` An interactive reply-buttons message: body text plus up to three tappable buttons. The customer's tap arrives as an inbound interactive_reply part with kind button_reply, carrying the tapped button's id. - `body: string` The message body. - `buttons: array of object { id, title }` The tappable buttons — at most three. - `id: string` Your identifier for the button — echoed back as the interactive_reply's id. - `title: string` The button's visible label. - `type: "interactive_buttons"` - `"interactive_buttons"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `InteractiveCtaURL object { body, display_text, type, 4 more }` An interactive call-to-action message: body text plus one button that opens a URL. - `body: string` The message body. - `display_text: string` The button's visible label. - `type: "interactive_cta_url"` - `"interactive_cta_url"` - `url: string` The URL the button opens. Must be absolute, with an http or https scheme. - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref, filename }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `filename: optional string` The file name the customer sees on a document header. Documents only. - `InteractiveCarousel object { body, cards, type }` An interactive carousel: one message whose body sits above 2 to 10 horizontally scrolling cards. Each card shows an uploaded image, or a video from a public link, and either one button that opens a URL or reply buttons. A tap on a card's reply button arrives as an inbound template_reply part whose payload is that button's id; nothing else in the reply identifies the card, so the id you choose is the card's identity. - `body: string` The message text shown above the cards. - `cards: array of object { card_index, header, body, 2 more }` The cards, left to right. - `card_index: number` This card's zero-based position: the first card is 0, the next 1, and so on, in array order. - `header: object { kind, upload_ref, url }` The card's media: an image named by upload_ref, or a video named by the public https url it plays from. Every card carries the same kind. - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: optional string` A durable handle returned by POST /v1/media for an image upload. Image cards only. - `url: optional string` The public https address the card's video plays from. Video cards only. It is sent exactly as written and never fetched by this API, so it must be publicly reachable and serve a playable video; a link that does not play is accepted and then reported as a failed delivery (message.failed with channel_refused). - `body: optional string` Optional text below the card's image or video, with at most two line breaks. - `reply_buttons: optional array of object { id, title }` Buttons the customer taps to reply. Use either url_button or reply_buttons on every card. - `id: string` Your identifier for the button, echoed back as the template_reply's payload. Unique across the whole carousel. - `title: string` The button's visible label. - `url_button: optional object { display_text, url }` One button that opens a URL. Use either url_button or reply_buttons on every card. - `display_text: string` The button's visible label. - `url: string` The absolute https URL the button opens. - `type: "interactive_carousel"` - `"interactive_carousel"` - `LocationRequest object { body, type }` Asks the customer to share a location. The response arrives as a location part. - `body: string` Prompt shown above the send-location button. - `type: "location_request"` - `"location_request"` - `ContactRequest object { body, type }` Asks the customer to share their own contact card with one tap. Useful when you know the customer only by a username identifier and need a phone number. The answer arrives as an ordinary contacts part whose card carries origin contact_request; a card the customer shares by hand carries origin other instead. The answer is not linked to your request as a reply: its message carries no reply_to_message_id, so match it by origin and timing. Sendable inside the customer window. - `body: string` Prompt shown above the share-contact button. - `type: "contact_request"` - `"contact_request"` - `AddressRequest object { body, country, type }` Reserved for asking an eligible customer in India to submit a structured address. Sending this part is not available until business and customer eligibility can be verified at acceptance. Address responses already arrive as address_reply parts. - `body: string` Prompt shown above the address form. - `country: "IN"` ISO country code. Structured address requests are currently available only in India. - `"IN"` - `type: "address_request"` - `"address_request"` - `Contacts object { contacts, type }` One or more contact cards. - `contacts: array of object { name, addresses, birthday, 5 more }` The contact cards to send. The channel permits far more; this API caps a message at five, because a message carrying hundreds of cards is a mistake rather than a use case. - `name: object { formatted_name, first_name, last_name, 3 more }` - `formatted_name: string` The contact's full display name. - `first_name: optional string` - `last_name: optional string` - `middle_name: optional string` - `prefix: optional string` - `suffix: optional string` - `addresses: optional array of object { city, country, country_code, 4 more }` - `city: optional string` - `country: optional string` - `country_code: optional string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `state: optional string` - `street: optional string` - `zip: optional string` - `birthday: optional string` The contact's birthday as YYYY-MM-DD. - `emails: optional array of object { email, kind }` - `email: string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `org: optional object { company, department, title }` - `company: optional string` - `department: optional string` - `title: optional string` - `origin: optional string` Response-only: how the customer came to share this card, as the channel reported it, verbatim. contact_request means they tapped the share button on a contact_request you sent; other means they shared a card themselves. New values may appear, so treat any other value as unrecognised rather than as either of these. Absent when the channel did not say, and on cards received before it was recorded. A send carrying it is rejected with a pointer at the member. - `phones: optional array of object { phone, kind, messaging_id }` - `phone: string` The phone number, ideally in +E.164 form. - `kind: optional string` A label for the number, e.g. CELL, MAIN, WORK, HOME. - `messaging_id: optional string` The contact's messaging-account identifier on this channel, when known — makes the card openable in the messaging app. - `urls: optional array of object { url, kind }` - `url: string` - `kind: optional string` A label for the URL, e.g. WORK, HOME. - `type: "contacts"` - `"contacts"` - `Location object { latitude, longitude, type, 2 more }` A location pin. - `latitude: number` Latitude in decimal degrees. - `longitude: number` Longitude in decimal degrees. - `type: "location"` - `"location"` - `address: optional string` The place's address, shown under the name. - `name: optional string` The place's name, shown on the pin. - `Reaction object { emoji, type, channel_message_id, message_id }` An emoji reaction to an earlier message in the chat. message_id is this API's Message.id for the target in both directions: it is what you send, and it is appended to an inbound reaction whenever the target is a message of the same chat. channel_message_id is the channel's opaque identifier and appears on inbound reactions only. - `emoji: string` A single emoji. Send an empty string to remove a previous reaction to the same message. - `type: "reaction"` - `"reaction"` - `channel_message_id: optional string` Inbound only: the channel's opaque identifier for the message being reacted to. Always present on an inbound reaction, beside message_id whenever the target resolved. Match it literally to Message.channel_message_id in the chat transcript; never parse it or compare it with Message.id. - `message_id: optional string` This API's Message.id for the message being reacted to. Outbound: required, and the API resolves it into the channel namespace before sending, so the message must be one this account can see in the chat the send addresses. Inbound: present whenever the target is a message of the same chat, so you can keep only this identifier; absent when the chat does not hold the target. - `InteractiveReply object { id, kind, title, 2 more }` Inbound only — never sendable. The customer's selection from an interactive_list (kind list_reply) or interactive_buttons (kind button_reply) message, carrying the id you assigned to the chosen row or button. - `id: string` The id you assigned to the chosen row or button, exactly as you sent it. - `kind: "list_reply" or "button_reply"` Which interactive message kind was answered. - `"list_reply"` - `"button_reply"` - `title: string` The chosen row's or button's visible title. - `type: "interactive_reply"` - `"interactive_reply"` - `description: optional string` The chosen list row's secondary text, when it had one. - `TemplateReply object { payload, text, type }` Inbound only — never sendable. The customer tapped a quick-reply button on an approved template you sent, or a reply button on a card of an interactive_carousel you sent. payload is the value you set on that button: the template's quick_reply slot payload (or the button's label when you left the slot out), or the carousel card button's id. text is the label the customer saw. A carousel tap carries nothing else that identifies the card, so the id you chose is the card's only identity. For a template tap, the message's reply_to_message_id names the template message that carried the button. Distinct from interactive_reply, which answers an interactive_buttons or interactive_list message. - `payload: string` The quick_reply slot's payload from your send, or the button label when the slot was omitted; for a carousel card, the tapped reply button's id. - `text: string` The tapped button's label, as the customer saw it. - `type: "template_reply"` - `"template_reply"` - `AddressReply object { type, values, saved_address_id }` Inbound only: the structured values submitted in response to an address request. - `type: "address_reply"` - `"address_reply"` - `values: object { address, building_name, city, 8 more }` - `address: optional string` - `building_name: optional string` - `city: optional string` - `floor_number: optional string` - `house_number: optional string` - `landmark_area: optional string` - `name: optional string` - `phone_number: optional string` - `pin_code: optional string` - `state: optional string` - `tower_number: optional string` - `saved_address_id: optional string` Identifier of the selected saved address, when one was selected. - `Order object { catalog_id, items, type, text }` Inbound only — never sendable. An order the customer placed from a product catalog. - `catalog_id: string` The catalog the ordered items belong to. - `items: array of object { currency, price, product_retailer_id, quantity }` The ordered items. - `currency: string` ISO 4217 currency code for price. - `price: number` The per-item price at order time. - `product_retailer_id: string` Your identifier for the product, as registered in the catalog. - `quantity: number` - `type: "order"` - `"order"` - `text: optional string` Free text the customer attached to the order, when any. - `Referral object { type, body, click_id, 7 more }` Inbound only — never sendable. The ad or post context a customer's first message arrived from (for example an ad whose call to action opens a chat). A referral also opens a free-entry-point customer window — see the chat's customer_window. - `type: "referral"` - `"referral"` - `body: optional string` The ad's body text at click time. - `click_id: optional string` The click identifier assigned by the ad platform, for attribution. - `headline: optional string` The ad's headline at click time. - `image_url: optional string` URL of the ad's image creative, when media_kind is image. - `media_kind: optional string` The ad creative's media kind, e.g. image or video. - `source_id: optional string` The ad or post id. - `source_kind: optional string` What the source was, e.g. ad or post. - `source_url: optional string` The URL of the ad or post the customer came from. - `video_url: optional string` URL of the ad's video creative, when media_kind is video. - `System object { body, type, event }` Inbound only — never sendable. A system event in the chat, such as the customer changing their number. New event kinds appear over time; body is always present and human-readable. - `body: string` Human-readable description of the system event. - `type: "system"` - `"system"` - `event: optional string` The system event's kind, when the channel identifies one. New kinds appear over time — treat unknown values as informational. - `Unsupported object { raw, type, kind }` Inbound only — never sendable. A message kind this API does not yet type natively, carried as a typed passthrough: raw holds the channel payload, so a new message kind is never a black box or a silent drop. Native part types for popular kinds are added over time; this part is the compatibility guarantee in the meantime. - `raw: unknown` The channel payload — any JSON value: object, array, string, number, boolean, or null. Deliberately unconstrained, because the whole point of this part is to carry a shape this API does not yet know. For rows written by API version 1.3.0 or later, object member order, number formatting and duplicated members survive storage and read-back. The canonical encoder may compact insignificant whitespace before storage. Rows written before API version 1.3.0 retain normalized JSON only: member order and number formatting may differ, and only the last duplicated member survives. - `type: "unsupported"` - `"unsupported"` - `kind: optional string` The channel's name for the message kind, when it declares one. - `status: string` The message's delivery state as last reported. Inbound messages read `received`: they arrived, and no delivery of ours ran. A message you sent starts `accepted` and moves through `sent`, `delivered` and `read` as the channel reports them, with `failed` as the definitive negative outcome. `unknown` means exactly that: the send is INDETERMINATE and we decline to guess. It is NOT terminal — an indeterminate send is never re-sent, and it resolves to `sent`, `delivered`, `read` or `failed` when the channel's own report arrives — so keep observing rather than treating it as an outcome. States are reported asynchronously on the chat's event sequence, and the set grows additively: treat a value you do not recognise as "no information" rather than failing on it. Retention of this published status follows the chat transcript policy: there is no scheduled pruning, but no fixed minimum availability period is published yet. The present absence of a scheduled age-based sweep is not a promise of indefinite availability. `delivered` is reported by the channel after it accepted the message and can lag by hours, never arrive at all, or be followed by a failure, so do not build timeouts around it arriving promptly. - `channel_message_id: optional string` The channel's opaque identifier for this message, when the channel has assigned one. An inbound reaction's `channel_message_id` matches this field literally; never parse it or compare it with `id`. It is absent while an accepted outbound message has not yet received a channel identifier, and until it is present an inbound reaction to this message carries only `channel_message_id`. - `failure: optional object { code, message }` Why a failed message failed, when we have a reason worth publishing. Present only on `status` `failed`, and not on every one of those: a message can fail for a reason outside the published vocabulary and carry no `failure` at all. Its absence means "no published reason", never "no reason". Most messages the channel refused do carry one: a specific code where one is published, and `channel_refused` for most of the rest; a few kinds of refusal still carry none. `status` stays the thing to branch on. This is additive detail beside it, so an integration written before this field existed still sees a terminal `failed` and behaves exactly as it did. - `code: string` The specific reason. `sender_deregistered` — the number this message was going out from is no longer a registered sending number, and the message never left. This is terminal: it is not a pause and it does not clear, so retrying the same message cannot succeed and that conversation is over. Reach this customer by starting a new one on another of your numbers with a template, exactly as you would any customer whose 24-hour window has closed; `GET /v1/chats` shows which number each conversation uses. You are not billed for a message that failed this way. `quality_hold_expired` — this marketing message remained held by an automatic safety control on its sending line for ten minutes and was not sent. This is terminal: retrying the same message cannot succeed on that conversation. Send marketing from another of your numbers with a template, or contact support about the sending line. You are not billed for a message that failed this way. `target_message_failed` — the message this one quotes or reacts to failed, or its outcome could not be established, before this message went out. This message was therefore never sent, because a quote is never sent without its context. A `message.failed` event reports it. This is terminal: send it again as a new message, without that target or naming one that was sent. You are not billed a channel charge for it, though it still counts toward your platform subscription's message volume. `recipient_country_restricted` — the business behind the sending number is not currently permitted to message customers in this recipient's country, so the message was not delivered. The restriction blocks every message type, including replies inside the customer's 24-hour window. This is terminal for the message: sending it again cannot succeed while the restriction stands. Most countries unlock only when the business has completed business verification and has held an assigned messaging tier of 2,000 or higher for 30 consecutive days. The assigned tier is what counts, not how many messages you send. Brazil and Indonesia also require the business's primary business location to be in that country, at any tier: a business located elsewhere cannot message customers there. Until the business qualifies, sends to that country will keep failing. The channel publishes no list of restricted country pairs and offers no API signal before a send. If the business meets these conditions and the restriction stands, review the messaging policy for the business's category. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `payment_method_required` — the business behind the sending number has no working payment method on its messaging account, so this message was not sent. This is terminal for the message: retrying it cannot succeed until a payment method is added. Add or update the payment method in the messaging account's billing settings, then send again as a new message. Replies inside an open 24-hour customer window are charged too once the sending number's monthly free allowance of them is used up, so they also need a working payment method and can fail this way. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `recipient_phone_number_required` — this customer is known only by a username identifier, not a phone number, and this message can be delivered only to a phone number, so it was not sent. This is terminal for the message: sending it again to this customer cannot succeed. One-time-code templates (copy code, one-tap or zero-tap autofill) are the usual cause; deliver the code another way. Other messages, including templates without a one-time-code button, can still be sent to this customer. When the template is known in advance to carry a one-time-code button, the send is refused at once with the error `recipient_phone_number_required` instead and nothing is accepted. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `business_restricted` — this message was refused because the business behind the sending number is most likely restricted on its messaging account, so it was not sent. This is terminal for the message: sending it again will not succeed while the restriction stands. Review the status of the business's messaging account, and if the business believes it complies with the messaging policies, request a review of the restriction. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `channel_refused` — this message was refused upstream and was not sent, for a reason that has no more specific code here, and it will not be retried automatically. Contact support with this message's `id` to learn the reason and whether sending it again can succeed. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. A more specific code may be published for some of these refusals in a later release; treat a code you do not recognise exactly as you treat this one. - `message: string` Human-readable, written for a person reading it. Do not branch on it. - `from: optional string` The number this message left by, or arrived on, in E.164 (leading `+`). Every message in one conversation carries the same value — a conversation never moves to another number. Absent only if the number is no longer one of yours. - `reply_to_message_id: optional string` This API's `id` of the earlier message in this chat that this message replies to. On an inbound message it is the message the customer quoted; on an outbound message it is the `reply_to_message_id` you sent. Look the value up in this chat's transcript to show what was answered; it is the same namespace as `id`, never a channel identifier. Absent when there is no reply context this API can resolve — a message that quotes nothing, or one that quotes a message this API never recorded in this chat. Treat absence as "no reply context available", not as proof the message was not a reply. - `zero_retention: optional true` True when the message is under zero-day retention: its content is not kept, so later reads and idempotent retries return empty `parts`. The original send response still carries the content. Retention applies only within Linq's systems. The WhatsApp channel operator's own processing and retention of message content are governed by its terms and are not affected by this setting. - `true` ### Chat Event Page - `ChatEventPage object { data, has_more, next_cursor }` A page of one chat's events, in the `seq` order the read asked for — ascending by default, descending under `order=desc`. - `data: array of ChatEvent` - `occurred_at: string` - `seq: number` The event's position in this chat's stored sequence. Positions are assigned contiguously from 1 and never renumbered. When ephemeral messages are enabled, reads omit an expired message and its related events, so the `seq` values returned to that account have gaps where those events were. Use this as the chat's events-read cursor. It is scoped to one chat, so it is NOT the `/v1/streams/events` stream cursor: that stream spans every chat and carries its own cursor in each frame's `id`. - `type: string` The event's kind, e.g. `message.received`, `message.sent`. Kinds grow additively — skip what you do not handle. `chat.event.unknown` is the one kind that never carries meaning: it marks a journal entry whose partner-visible kind is not published yet. It preserves that stored position instead of hiding an unpublished kind. Expired ephemeral messages are different: retention omits their related events from reads, leaving visible gaps in `seq`. Skip this kind. - `message: optional Message` The message this event is about, on message-kind events. - `id: string` This API's message id. Put this value in an outbound reaction's `message_id`; an inbound reaction to this message carries the same value in its `message_id`, so this is the one identifier you need to keep. Mark-as-read targets the latest unread inbound message in a chat, so it takes the chat id. - `chat_id: string` The chat this message belongs to. - `created_at: string` - `direction: "inbound" or "outbound"` `inbound` (from the customer) or `outbound` (sent by you). - `"inbound"` - `"outbound"` - `parts: array of object { body, type, preview_url } or object { kind, type, availability, 10 more } or object { language, name, type, 4 more } or 17 more` The message content — sendable parts, plus the inbound-only types on inbound messages. Empty only when `zero_retention` is true, or when an idempotent retry returns an ephemeral message whose content retention cleanup has removed. - `Text object { body, type, preview_url }` A plain text message. - `body: string` The message text. URLs render as tappable links. - `type: "text"` - `"text"` - `preview_url: optional boolean` Render a preview card for the first URL in body. Defaults to false. - `Media object { kind, type, availability, 10 more }` A media message — image, video, audio, document, or sticker. The two identifiers are distinct namespaces: inbound media carries the channel's transient media_id; outbound media carries our durable upload_ref from POST /v1/media. - `kind: "image" or "video" or "audio" or 2 more` Which kind of media this is. Captions apply to image, video and document only; filename applies to document only. - `"image"` - `"video"` - `"audio"` - `"document"` - `"sticker"` - `type: "media"` - `"media"` - `availability: optional "available" or "unavailable" or "pending"` Response only, inbound parts only: whether the download answers the bytes. available: the file was captured and is retained. unavailable: it is not downloadable now, and unavailable_reason says why; with timed_out the download answers 409 while capture continues and can later answer 200, otherwise it answers 410, or 404 once the file is no longer known. It describes the file, not the exact HTTP answer of a later download, which can also refuse for capacity or authorization. pending: capture has not finished yet; only reads of the conversation return pending, and a message event never does. A message.received event is recorded once every attachment has been captured or has failed, or ten minutes after the message arrived, whichever comes first; an event part without availability is from a historical event and may still be capturing, so retry its download as the 409 Retry-After directs. A message event keeps the value it was recorded with; reads return the current one. Historical messages received before it was recorded omit it. Never accepted on sends. - `"available"` - `"unavailable"` - `"pending"` - `byte_size: optional number` Response only, inbound parts only: the exact size in bytes of the retained attachment, equal to the download's Content-Length. Present only while the bytes are captured and retained — the same lifetime as a working url, ending 30 days after server receipt — so it can be absent from a message event while capture has not completed, and its absence is not final; once present it never changes. Absent rather than zero. Never accepted on sends. - `caption: optional string` Caption rendered with the media. Image, video and document only — a caption on an audio or sticker part is rejected, never dropped. - `filename: optional string` Display filename. Documents only — a filename on any other kind is rejected, never dropped. - `media_id: optional string` Inbound only: the channel's transient media identifier. It expires after seven days and is never an outbound address; an outbound value is rejected with a pointer to media_id and upload_ref as the remedy. - `mime_type: optional string` Response only, inbound parts only: the media type the channel declared when the message arrived, verbatim. It may carry parameters (for example audio/ogg; codecs=opus) and may differ from the Content-Type the download answers with, which describes the retained bytes. Present on the webhook body and on every later read with the same value. Historical messages received before it was recorded omit this field. Never accepted on sends. - `source_url: optional string` Outbound only: a public https URL of the bytes to send, as an alternative to upload_ref. Supply exactly one of upload_ref or source_url. The address is fetched once, before the send is accepted, and its exact bytes are stored as an ordinary upload in this account and key partition; the accepted message and every later read carry that upload's upload_ref, never the address, and no retry fetches it again. The URL must be absolute https on the default port with no credentials and no fragment, must resolve to a public address (every redirect hop included, at most three), and must answer with the complete bytes and their exact media type within the fetch deadline. The bytes are then held to the same media type and size rules as POST /v1/media for the part's kind; a mismatch is refused, never converted. - `unavailable_reason: optional string` Response only, present only when availability is unavailable. An open string: the values today are timed_out, capture_failed and expired, and new values may be added. timed_out: the file was still being retrieved ten minutes after the message arrived, so its message event was recorded without it; retrieval continues and the file may become downloadable later, which reads of the conversation report. capture_failed: the file could not be retrieved. expired: the file was retrieved and is no longer retained, or is no longer known (the download then answers 410 or 404). Treat an unknown value as capture_failed. Never accepted on sends. - `upload_ref: optional string` Outbound only: our durable handle returned by POST /v1/media. Handles visibly begin upload. and are reusable within the account and key partition that created them. - `url: optional string` Response only: stable attachment download URL requiring the account Bearer key on every request. Pending capture returns 409 with Retry-After; retained bytes expire 30 days after server receipt. Historical unbound messages omit this field. Never accepted on sends. - `voice: optional boolean` Audio only. On a send it is optional: true sends the audio as a voice note; false, or leaving it out, sends it as an ordinary audio file. A voice note needs an upload stored as audio/ogg that holds mono Opus audio, sent by upload_ref or source_url within the existing audio size limit. The bytes are sent as supplied: they are never converted or inspected, so encode them as mono Opus before uploading. The recipient sees a play button only when the voice file is 512 KB or smaller; a larger voice note is still delivered but must be downloaded before it plays. On incoming audio parts it is response-only: whether the channel reported the audio as a voice note, verbatim. true means it was recorded with the messaging client's voice-recording feature; false means it was sent as an audio file. Present on the webhook body and on every later read with the same value. Absent on an incoming part means the channel did not say, never that the audio is not a voice note. Other kinds never carry it, and historical messages received before it was recorded omit it. - `Template object { language, name, type, 4 more }` An approved message template — the one part type sendable outside an open customer service window. name and language identify the approved template; parameters fills its named placeholders. Authentication templates use this same generic part: their published parameter schema names exactly one parameter, `code` — the one-time code you generate, 1–15 characters — and the message shows it in its body and behind its code button. Every sendable template is registered and approved ahead of the send and publishes its own parameter schema — a send referencing an unknown template, a missing or unknown parameter, or a value that breaks the template's rules is rejected with a 422 naming the exact field. - `language: string` The template's language-and-locale code, e.g. en_US. - `name: string` The approved template's name. Lowercase letters, digits and underscores only. - `type: "template"` - `"template"` - `buttons: optional array of object { index, payload, type }` Send-time values for this approved template's own dynamic buttons, in ascending index order: a url button whose destination ends in {{1}} takes the value appended there and is REQUIRED; a quick_reply button takes the payload returned to you when it is tapped and is OPTIONAL — omit it and the button returns its label. Fixed buttons have no slot. The approved template's send_schema lists the (index, type) slots and an x-rule stating which are required; omit buttons entirely for a template with no url slot when the labels are what you want back. - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `cards: optional array of object { card_index, kind, upload_ref, 2 more }` Per-card values for an approved media-card carousel. The approved template's send_schema provides structural bounds and an x-rule listing the exact card order, media kind, named body values, and dynamic button slots enforced by runtime L2 validation. Omit for non-carousel templates. - `card_index: number` - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: string` A durable handle returned by POST /v1/media. It is resolved within this key's account and partition, then consumed into a transient channel media identifier only at delivery. - `buttons: optional array of object { index, payload, type }` - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `parameters: optional unknown` Named values for this card's body placeholders. - `header: optional object { kind, upload_ref }` The uploaded media used for this approved template's media header. Omit unless this template's send_schema requires it. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `parameters: optional unknown` Named values for the template's placeholders. The shape is per-template: each registered template publishes its own parameter schema — hand THAT schema to your model when composing a specific template. Omit for templates with no placeholders. - `InteractiveList object { body, button, sections, 3 more }` An interactive list message: body text plus a button that opens a sectioned list of selectable rows. The customer's selection arrives as an inbound interactive_reply part with kind list_reply, carrying the chosen row's id. - `body: string` The message body. - `button: string` Label of the button that opens the list. - `sections: array of object { rows, title }` The list's sections, each holding selectable rows. At most 10 rows in total across ALL sections combined — not 10 per section. - `rows: array of object { id, title, description }` This section's rows. The 10-row limit is on the TOTAL across all sections, so a second section reduces what this one may hold. - `id: string` Your identifier for the row — echoed back as the interactive_reply's id. - `title: string` The row's visible title. - `description: optional string` Secondary text under the title. - `title: optional string` Section title. Required when the list has more than one section. - `type: "interactive_list"` - `"interactive_list"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `InteractiveButtons object { body, buttons, type, 3 more }` An interactive reply-buttons message: body text plus up to three tappable buttons. The customer's tap arrives as an inbound interactive_reply part with kind button_reply, carrying the tapped button's id. - `body: string` The message body. - `buttons: array of object { id, title }` The tappable buttons — at most three. - `id: string` Your identifier for the button — echoed back as the interactive_reply's id. - `title: string` The button's visible label. - `type: "interactive_buttons"` - `"interactive_buttons"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `InteractiveCtaURL object { body, display_text, type, 4 more }` An interactive call-to-action message: body text plus one button that opens a URL. - `body: string` The message body. - `display_text: string` The button's visible label. - `type: "interactive_cta_url"` - `"interactive_cta_url"` - `url: string` The URL the button opens. Must be absolute, with an http or https scheme. - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref, filename }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `filename: optional string` The file name the customer sees on a document header. Documents only. - `InteractiveCarousel object { body, cards, type }` An interactive carousel: one message whose body sits above 2 to 10 horizontally scrolling cards. Each card shows an uploaded image, or a video from a public link, and either one button that opens a URL or reply buttons. A tap on a card's reply button arrives as an inbound template_reply part whose payload is that button's id; nothing else in the reply identifies the card, so the id you choose is the card's identity. - `body: string` The message text shown above the cards. - `cards: array of object { card_index, header, body, 2 more }` The cards, left to right. - `card_index: number` This card's zero-based position: the first card is 0, the next 1, and so on, in array order. - `header: object { kind, upload_ref, url }` The card's media: an image named by upload_ref, or a video named by the public https url it plays from. Every card carries the same kind. - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: optional string` A durable handle returned by POST /v1/media for an image upload. Image cards only. - `url: optional string` The public https address the card's video plays from. Video cards only. It is sent exactly as written and never fetched by this API, so it must be publicly reachable and serve a playable video; a link that does not play is accepted and then reported as a failed delivery (message.failed with channel_refused). - `body: optional string` Optional text below the card's image or video, with at most two line breaks. - `reply_buttons: optional array of object { id, title }` Buttons the customer taps to reply. Use either url_button or reply_buttons on every card. - `id: string` Your identifier for the button, echoed back as the template_reply's payload. Unique across the whole carousel. - `title: string` The button's visible label. - `url_button: optional object { display_text, url }` One button that opens a URL. Use either url_button or reply_buttons on every card. - `display_text: string` The button's visible label. - `url: string` The absolute https URL the button opens. - `type: "interactive_carousel"` - `"interactive_carousel"` - `LocationRequest object { body, type }` Asks the customer to share a location. The response arrives as a location part. - `body: string` Prompt shown above the send-location button. - `type: "location_request"` - `"location_request"` - `ContactRequest object { body, type }` Asks the customer to share their own contact card with one tap. Useful when you know the customer only by a username identifier and need a phone number. The answer arrives as an ordinary contacts part whose card carries origin contact_request; a card the customer shares by hand carries origin other instead. The answer is not linked to your request as a reply: its message carries no reply_to_message_id, so match it by origin and timing. Sendable inside the customer window. - `body: string` Prompt shown above the share-contact button. - `type: "contact_request"` - `"contact_request"` - `AddressRequest object { body, country, type }` Reserved for asking an eligible customer in India to submit a structured address. Sending this part is not available until business and customer eligibility can be verified at acceptance. Address responses already arrive as address_reply parts. - `body: string` Prompt shown above the address form. - `country: "IN"` ISO country code. Structured address requests are currently available only in India. - `"IN"` - `type: "address_request"` - `"address_request"` - `Contacts object { contacts, type }` One or more contact cards. - `contacts: array of object { name, addresses, birthday, 5 more }` The contact cards to send. The channel permits far more; this API caps a message at five, because a message carrying hundreds of cards is a mistake rather than a use case. - `name: object { formatted_name, first_name, last_name, 3 more }` - `formatted_name: string` The contact's full display name. - `first_name: optional string` - `last_name: optional string` - `middle_name: optional string` - `prefix: optional string` - `suffix: optional string` - `addresses: optional array of object { city, country, country_code, 4 more }` - `city: optional string` - `country: optional string` - `country_code: optional string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `state: optional string` - `street: optional string` - `zip: optional string` - `birthday: optional string` The contact's birthday as YYYY-MM-DD. - `emails: optional array of object { email, kind }` - `email: string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `org: optional object { company, department, title }` - `company: optional string` - `department: optional string` - `title: optional string` - `origin: optional string` Response-only: how the customer came to share this card, as the channel reported it, verbatim. contact_request means they tapped the share button on a contact_request you sent; other means they shared a card themselves. New values may appear, so treat any other value as unrecognised rather than as either of these. Absent when the channel did not say, and on cards received before it was recorded. A send carrying it is rejected with a pointer at the member. - `phones: optional array of object { phone, kind, messaging_id }` - `phone: string` The phone number, ideally in +E.164 form. - `kind: optional string` A label for the number, e.g. CELL, MAIN, WORK, HOME. - `messaging_id: optional string` The contact's messaging-account identifier on this channel, when known — makes the card openable in the messaging app. - `urls: optional array of object { url, kind }` - `url: string` - `kind: optional string` A label for the URL, e.g. WORK, HOME. - `type: "contacts"` - `"contacts"` - `Location object { latitude, longitude, type, 2 more }` A location pin. - `latitude: number` Latitude in decimal degrees. - `longitude: number` Longitude in decimal degrees. - `type: "location"` - `"location"` - `address: optional string` The place's address, shown under the name. - `name: optional string` The place's name, shown on the pin. - `Reaction object { emoji, type, channel_message_id, message_id }` An emoji reaction to an earlier message in the chat. message_id is this API's Message.id for the target in both directions: it is what you send, and it is appended to an inbound reaction whenever the target is a message of the same chat. channel_message_id is the channel's opaque identifier and appears on inbound reactions only. - `emoji: string` A single emoji. Send an empty string to remove a previous reaction to the same message. - `type: "reaction"` - `"reaction"` - `channel_message_id: optional string` Inbound only: the channel's opaque identifier for the message being reacted to. Always present on an inbound reaction, beside message_id whenever the target resolved. Match it literally to Message.channel_message_id in the chat transcript; never parse it or compare it with Message.id. - `message_id: optional string` This API's Message.id for the message being reacted to. Outbound: required, and the API resolves it into the channel namespace before sending, so the message must be one this account can see in the chat the send addresses. Inbound: present whenever the target is a message of the same chat, so you can keep only this identifier; absent when the chat does not hold the target. - `InteractiveReply object { id, kind, title, 2 more }` Inbound only — never sendable. The customer's selection from an interactive_list (kind list_reply) or interactive_buttons (kind button_reply) message, carrying the id you assigned to the chosen row or button. - `id: string` The id you assigned to the chosen row or button, exactly as you sent it. - `kind: "list_reply" or "button_reply"` Which interactive message kind was answered. - `"list_reply"` - `"button_reply"` - `title: string` The chosen row's or button's visible title. - `type: "interactive_reply"` - `"interactive_reply"` - `description: optional string` The chosen list row's secondary text, when it had one. - `TemplateReply object { payload, text, type }` Inbound only — never sendable. The customer tapped a quick-reply button on an approved template you sent, or a reply button on a card of an interactive_carousel you sent. payload is the value you set on that button: the template's quick_reply slot payload (or the button's label when you left the slot out), or the carousel card button's id. text is the label the customer saw. A carousel tap carries nothing else that identifies the card, so the id you chose is the card's only identity. For a template tap, the message's reply_to_message_id names the template message that carried the button. Distinct from interactive_reply, which answers an interactive_buttons or interactive_list message. - `payload: string` The quick_reply slot's payload from your send, or the button label when the slot was omitted; for a carousel card, the tapped reply button's id. - `text: string` The tapped button's label, as the customer saw it. - `type: "template_reply"` - `"template_reply"` - `AddressReply object { type, values, saved_address_id }` Inbound only: the structured values submitted in response to an address request. - `type: "address_reply"` - `"address_reply"` - `values: object { address, building_name, city, 8 more }` - `address: optional string` - `building_name: optional string` - `city: optional string` - `floor_number: optional string` - `house_number: optional string` - `landmark_area: optional string` - `name: optional string` - `phone_number: optional string` - `pin_code: optional string` - `state: optional string` - `tower_number: optional string` - `saved_address_id: optional string` Identifier of the selected saved address, when one was selected. - `Order object { catalog_id, items, type, text }` Inbound only — never sendable. An order the customer placed from a product catalog. - `catalog_id: string` The catalog the ordered items belong to. - `items: array of object { currency, price, product_retailer_id, quantity }` The ordered items. - `currency: string` ISO 4217 currency code for price. - `price: number` The per-item price at order time. - `product_retailer_id: string` Your identifier for the product, as registered in the catalog. - `quantity: number` - `type: "order"` - `"order"` - `text: optional string` Free text the customer attached to the order, when any. - `Referral object { type, body, click_id, 7 more }` Inbound only — never sendable. The ad or post context a customer's first message arrived from (for example an ad whose call to action opens a chat). A referral also opens a free-entry-point customer window — see the chat's customer_window. - `type: "referral"` - `"referral"` - `body: optional string` The ad's body text at click time. - `click_id: optional string` The click identifier assigned by the ad platform, for attribution. - `headline: optional string` The ad's headline at click time. - `image_url: optional string` URL of the ad's image creative, when media_kind is image. - `media_kind: optional string` The ad creative's media kind, e.g. image or video. - `source_id: optional string` The ad or post id. - `source_kind: optional string` What the source was, e.g. ad or post. - `source_url: optional string` The URL of the ad or post the customer came from. - `video_url: optional string` URL of the ad's video creative, when media_kind is video. - `System object { body, type, event }` Inbound only — never sendable. A system event in the chat, such as the customer changing their number. New event kinds appear over time; body is always present and human-readable. - `body: string` Human-readable description of the system event. - `type: "system"` - `"system"` - `event: optional string` The system event's kind, when the channel identifies one. New kinds appear over time — treat unknown values as informational. - `Unsupported object { raw, type, kind }` Inbound only — never sendable. A message kind this API does not yet type natively, carried as a typed passthrough: raw holds the channel payload, so a new message kind is never a black box or a silent drop. Native part types for popular kinds are added over time; this part is the compatibility guarantee in the meantime. - `raw: unknown` The channel payload — any JSON value: object, array, string, number, boolean, or null. Deliberately unconstrained, because the whole point of this part is to carry a shape this API does not yet know. For rows written by API version 1.3.0 or later, object member order, number formatting and duplicated members survive storage and read-back. The canonical encoder may compact insignificant whitespace before storage. Rows written before API version 1.3.0 retain normalized JSON only: member order and number formatting may differ, and only the last duplicated member survives. - `type: "unsupported"` - `"unsupported"` - `kind: optional string` The channel's name for the message kind, when it declares one. - `status: string` The message's delivery state as last reported. Inbound messages read `received`: they arrived, and no delivery of ours ran. A message you sent starts `accepted` and moves through `sent`, `delivered` and `read` as the channel reports them, with `failed` as the definitive negative outcome. `unknown` means exactly that: the send is INDETERMINATE and we decline to guess. It is NOT terminal — an indeterminate send is never re-sent, and it resolves to `sent`, `delivered`, `read` or `failed` when the channel's own report arrives — so keep observing rather than treating it as an outcome. States are reported asynchronously on the chat's event sequence, and the set grows additively: treat a value you do not recognise as "no information" rather than failing on it. Retention of this published status follows the chat transcript policy: there is no scheduled pruning, but no fixed minimum availability period is published yet. The present absence of a scheduled age-based sweep is not a promise of indefinite availability. `delivered` is reported by the channel after it accepted the message and can lag by hours, never arrive at all, or be followed by a failure, so do not build timeouts around it arriving promptly. - `channel_message_id: optional string` The channel's opaque identifier for this message, when the channel has assigned one. An inbound reaction's `channel_message_id` matches this field literally; never parse it or compare it with `id`. It is absent while an accepted outbound message has not yet received a channel identifier, and until it is present an inbound reaction to this message carries only `channel_message_id`. - `failure: optional object { code, message }` Why a failed message failed, when we have a reason worth publishing. Present only on `status` `failed`, and not on every one of those: a message can fail for a reason outside the published vocabulary and carry no `failure` at all. Its absence means "no published reason", never "no reason". Most messages the channel refused do carry one: a specific code where one is published, and `channel_refused` for most of the rest; a few kinds of refusal still carry none. `status` stays the thing to branch on. This is additive detail beside it, so an integration written before this field existed still sees a terminal `failed` and behaves exactly as it did. - `code: string` The specific reason. `sender_deregistered` — the number this message was going out from is no longer a registered sending number, and the message never left. This is terminal: it is not a pause and it does not clear, so retrying the same message cannot succeed and that conversation is over. Reach this customer by starting a new one on another of your numbers with a template, exactly as you would any customer whose 24-hour window has closed; `GET /v1/chats` shows which number each conversation uses. You are not billed for a message that failed this way. `quality_hold_expired` — this marketing message remained held by an automatic safety control on its sending line for ten minutes and was not sent. This is terminal: retrying the same message cannot succeed on that conversation. Send marketing from another of your numbers with a template, or contact support about the sending line. You are not billed for a message that failed this way. `target_message_failed` — the message this one quotes or reacts to failed, or its outcome could not be established, before this message went out. This message was therefore never sent, because a quote is never sent without its context. A `message.failed` event reports it. This is terminal: send it again as a new message, without that target or naming one that was sent. You are not billed a channel charge for it, though it still counts toward your platform subscription's message volume. `recipient_country_restricted` — the business behind the sending number is not currently permitted to message customers in this recipient's country, so the message was not delivered. The restriction blocks every message type, including replies inside the customer's 24-hour window. This is terminal for the message: sending it again cannot succeed while the restriction stands. Most countries unlock only when the business has completed business verification and has held an assigned messaging tier of 2,000 or higher for 30 consecutive days. The assigned tier is what counts, not how many messages you send. Brazil and Indonesia also require the business's primary business location to be in that country, at any tier: a business located elsewhere cannot message customers there. Until the business qualifies, sends to that country will keep failing. The channel publishes no list of restricted country pairs and offers no API signal before a send. If the business meets these conditions and the restriction stands, review the messaging policy for the business's category. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `payment_method_required` — the business behind the sending number has no working payment method on its messaging account, so this message was not sent. This is terminal for the message: retrying it cannot succeed until a payment method is added. Add or update the payment method in the messaging account's billing settings, then send again as a new message. Replies inside an open 24-hour customer window are charged too once the sending number's monthly free allowance of them is used up, so they also need a working payment method and can fail this way. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `recipient_phone_number_required` — this customer is known only by a username identifier, not a phone number, and this message can be delivered only to a phone number, so it was not sent. This is terminal for the message: sending it again to this customer cannot succeed. One-time-code templates (copy code, one-tap or zero-tap autofill) are the usual cause; deliver the code another way. Other messages, including templates without a one-time-code button, can still be sent to this customer. When the template is known in advance to carry a one-time-code button, the send is refused at once with the error `recipient_phone_number_required` instead and nothing is accepted. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `business_restricted` — this message was refused because the business behind the sending number is most likely restricted on its messaging account, so it was not sent. This is terminal for the message: sending it again will not succeed while the restriction stands. Review the status of the business's messaging account, and if the business believes it complies with the messaging policies, request a review of the restriction. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `channel_refused` — this message was refused upstream and was not sent, for a reason that has no more specific code here, and it will not be retried automatically. Contact support with this message's `id` to learn the reason and whether sending it again can succeed. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. A more specific code may be published for some of these refusals in a later release; treat a code you do not recognise exactly as you treat this one. - `message: string` Human-readable, written for a person reading it. Do not branch on it. - `from: optional string` The number this message left by, or arrived on, in E.164 (leading `+`). Every message in one conversation carries the same value — a conversation never moves to another number. Absent only if the number is no longer one of yours. - `reply_to_message_id: optional string` This API's `id` of the earlier message in this chat that this message replies to. On an inbound message it is the message the customer quoted; on an outbound message it is the `reply_to_message_id` you sent. Look the value up in this chat's transcript to show what was answered; it is the same namespace as `id`, never a channel identifier. Absent when there is no reply context this API can resolve — a message that quotes nothing, or one that quotes a message this API never recorded in this chat. Treat absence as "no reply context available", not as proof the message was not a reply. - `zero_retention: optional true` True when the message is under zero-day retention: its content is not kept, so later reads and idempotent retries return empty `parts`. The original send response still carries the content. Retention applies only within Linq's systems. The WhatsApp channel operator's own processing and retention of message content are governed by its terms and are not affected by this setting. - `true` - `has_more: boolean` True when another page exists in the direction you are paging — pass `next_cursor` to fetch it. - `next_cursor: optional string` Cursor for the next page in the same direction; present when `has_more` is true. It can advance past expired ephemeral events intentionally omitted from the read. Send it back with the same `order`. ### Chat Page - `ChatPage object { data, has_more, next_cursor }` A page of chats. - `data: array of Chat` - `id: string` The chat's id. - `created_at: string` - `customer: string` Customer address as an opaque identifier. - `customer_window: object { expires_at, state, source }` The customer service window — first-class state on every chat read. Only `template` parts are sendable while it is closed. - `expires_at: string` When the open window expires. `null` when no window has ever opened. - `state: string` `open` or `closed`. - `source: optional string` What opened the current window: `customer_message`, or `free_entry_point` for ad-sourced windows. Absent when no window has ever opened. - `phone_number_id: string` The id of the sending number this chat is pinned to. - `updated_at: string` When the chat last changed — a new event moves it. - `customer_kind: optional string` The form of `customer`: `phone_number` or `username_identifier`. Branch on this rather than on the value's shape. Values may grow, so treat anything else as an address you can reply to but cannot read as a number. Absent for an address of neither form. - `from: optional string` The number this conversation sends from, in E.164 (leading `+`). This is the value to pass back as a send's `from` to address this exact conversation. Absent only if the number is no longer one of yours. - `has_more: boolean` True when another page exists — pass `next_cursor` to fetch it. - `next_cursor: optional string` Opaque cursor for the next page; present when `has_more` is true. # Events ## List a chat's events **get** `/v1/chats/{chat}/events` Reads a chat's event sequence in order — the transcript API. Stored positions are assigned contiguously from `seq` 1 and never renumbered. When ephemeral messages are enabled, an expired message and its related events are omitted from this read, so returned `seq` values have gaps where those events were. **`order` chooses which end a bare request starts from.** It defaults to `asc`, which starts at the OLDEST event and pages forward — identical to every release before this one, so a request that does not send `order` is unchanged. `order=desc` starts at the NEWEST event and pages backward, newest entry first, which is what an inbox wants: the latest activity is the first page rather than the last. This is the BACKFILL for `GET /v1/streams/events`, which is a live stream and replays nothing: an event that passed while you were not connected is re-read here, addressed by the `chat_id` and `seq` range every stream frame carries. **The cursor is the `seq` of the last entry you processed**, in either direction, and it is exclusive — pass `next_cursor` back verbatim, or the `seq` you stopped at, and the next page continues from there. Under `asc` that means the entries ABOVE it and `next_cursor` is the page's highest `seq`; under `desc` it means the entries BELOW it and `next_cursor` is the page's lowest. The direction is not carried in the cursor, so send `order` on every request of a walk: the same cursor with the other `order` reads the other way rather than being refused. Paging never skips a visible event: the next page resumes after the last returned position and any expired ephemeral positions intentionally read past. A visible lookahead row withheld by the page limit remains for the next page. An event journaled between two requests is returned rather than stepped over. A backward walk is not disturbed by events journaled while it runs — they take positions above where it started, so they are neither repeated nor mistaken for a retention gap. **Being caught up and being lost are different answers.** A cursor at the end you are paging TOWARD returns an empty page — the chat's newest `seq` under `asc`, `seq` `1` under `desc` — and that is the ordinary polling result. A cursor BEYOND that end is refused with `422` (`invalid_paging`), because no such position has ever existed in this chat and answering it with silence would be indistinguishable from having caught up. Each direction has its own beyond-the-end: a cursor above the chat's newest `seq` is refused whichever `order` you asked for, and `0` — the position below the first, which is `1` — is refused under `desc`, where nothing lies below it. Either refusal names where the sequence actually ends, so a client that has drifted can resume. An empty cursor is refused the same way in both directions: omit the parameter to start at whichever end `order` selects. **Retention.** This journal has no scheduled pruning, so ordinary operation does not remove an old prefix or renumber its immutable sequence. That is not a permanent-retention promise or a fixed minimum availability period: authenticated account deletion, offboarding, or a lawful deletion requirement may remove the account-scoped transcript. This operation therefore has no `expires_at`, retained-floor field, or scheduled `cursor_expired` response. If prefix pruning is introduced later, its additive retained floor and typed expiry behavior will be published before any history is removed. ### Path Parameters - `chat: string` ### Query Parameters - `cursor: optional string` Cursor from a previous page's `next_cursor`, read in the direction `order` selects. Exclusive: the page starts after it under `asc`, before it under `desc`. - `limit: optional number` Page size. The bounds are in this parameter's schema, not only in this sentence — a value outside them is refused, never clamped. - `order: optional "asc" or "desc"` Which end a request with no cursor starts from, and which way a cursor is read: `asc` from the oldest event forward, `desc` from the newest event backward. Any other value is refused, never coerced. - `"asc"` - `"desc"` ### Returns - `ChatEventPage object { data, has_more, next_cursor }` A page of one chat's events, in the `seq` order the read asked for — ascending by default, descending under `order=desc`. - `data: array of ChatEvent` - `occurred_at: string` - `seq: number` The event's position in this chat's stored sequence. Positions are assigned contiguously from 1 and never renumbered. When ephemeral messages are enabled, reads omit an expired message and its related events, so the `seq` values returned to that account have gaps where those events were. Use this as the chat's events-read cursor. It is scoped to one chat, so it is NOT the `/v1/streams/events` stream cursor: that stream spans every chat and carries its own cursor in each frame's `id`. - `type: string` The event's kind, e.g. `message.received`, `message.sent`. Kinds grow additively — skip what you do not handle. `chat.event.unknown` is the one kind that never carries meaning: it marks a journal entry whose partner-visible kind is not published yet. It preserves that stored position instead of hiding an unpublished kind. Expired ephemeral messages are different: retention omits their related events from reads, leaving visible gaps in `seq`. Skip this kind. - `message: optional Message` The message this event is about, on message-kind events. - `id: string` This API's message id. Put this value in an outbound reaction's `message_id`; an inbound reaction to this message carries the same value in its `message_id`, so this is the one identifier you need to keep. Mark-as-read targets the latest unread inbound message in a chat, so it takes the chat id. - `chat_id: string` The chat this message belongs to. - `created_at: string` - `direction: "inbound" or "outbound"` `inbound` (from the customer) or `outbound` (sent by you). - `"inbound"` - `"outbound"` - `parts: array of object { body, type, preview_url } or object { kind, type, availability, 10 more } or object { language, name, type, 4 more } or 17 more` The message content — sendable parts, plus the inbound-only types on inbound messages. Empty only when `zero_retention` is true, or when an idempotent retry returns an ephemeral message whose content retention cleanup has removed. - `Text object { body, type, preview_url }` A plain text message. - `body: string` The message text. URLs render as tappable links. - `type: "text"` - `"text"` - `preview_url: optional boolean` Render a preview card for the first URL in body. Defaults to false. - `Media object { kind, type, availability, 10 more }` A media message — image, video, audio, document, or sticker. The two identifiers are distinct namespaces: inbound media carries the channel's transient media_id; outbound media carries our durable upload_ref from POST /v1/media. - `kind: "image" or "video" or "audio" or 2 more` Which kind of media this is. Captions apply to image, video and document only; filename applies to document only. - `"image"` - `"video"` - `"audio"` - `"document"` - `"sticker"` - `type: "media"` - `"media"` - `availability: optional "available" or "unavailable" or "pending"` Response only, inbound parts only: whether the download answers the bytes. available: the file was captured and is retained. unavailable: it is not downloadable now, and unavailable_reason says why; with timed_out the download answers 409 while capture continues and can later answer 200, otherwise it answers 410, or 404 once the file is no longer known. It describes the file, not the exact HTTP answer of a later download, which can also refuse for capacity or authorization. pending: capture has not finished yet; only reads of the conversation return pending, and a message event never does. A message.received event is recorded once every attachment has been captured or has failed, or ten minutes after the message arrived, whichever comes first; an event part without availability is from a historical event and may still be capturing, so retry its download as the 409 Retry-After directs. A message event keeps the value it was recorded with; reads return the current one. Historical messages received before it was recorded omit it. Never accepted on sends. - `"available"` - `"unavailable"` - `"pending"` - `byte_size: optional number` Response only, inbound parts only: the exact size in bytes of the retained attachment, equal to the download's Content-Length. Present only while the bytes are captured and retained — the same lifetime as a working url, ending 30 days after server receipt — so it can be absent from a message event while capture has not completed, and its absence is not final; once present it never changes. Absent rather than zero. Never accepted on sends. - `caption: optional string` Caption rendered with the media. Image, video and document only — a caption on an audio or sticker part is rejected, never dropped. - `filename: optional string` Display filename. Documents only — a filename on any other kind is rejected, never dropped. - `media_id: optional string` Inbound only: the channel's transient media identifier. It expires after seven days and is never an outbound address; an outbound value is rejected with a pointer to media_id and upload_ref as the remedy. - `mime_type: optional string` Response only, inbound parts only: the media type the channel declared when the message arrived, verbatim. It may carry parameters (for example audio/ogg; codecs=opus) and may differ from the Content-Type the download answers with, which describes the retained bytes. Present on the webhook body and on every later read with the same value. Historical messages received before it was recorded omit this field. Never accepted on sends. - `source_url: optional string` Outbound only: a public https URL of the bytes to send, as an alternative to upload_ref. Supply exactly one of upload_ref or source_url. The address is fetched once, before the send is accepted, and its exact bytes are stored as an ordinary upload in this account and key partition; the accepted message and every later read carry that upload's upload_ref, never the address, and no retry fetches it again. The URL must be absolute https on the default port with no credentials and no fragment, must resolve to a public address (every redirect hop included, at most three), and must answer with the complete bytes and their exact media type within the fetch deadline. The bytes are then held to the same media type and size rules as POST /v1/media for the part's kind; a mismatch is refused, never converted. - `unavailable_reason: optional string` Response only, present only when availability is unavailable. An open string: the values today are timed_out, capture_failed and expired, and new values may be added. timed_out: the file was still being retrieved ten minutes after the message arrived, so its message event was recorded without it; retrieval continues and the file may become downloadable later, which reads of the conversation report. capture_failed: the file could not be retrieved. expired: the file was retrieved and is no longer retained, or is no longer known (the download then answers 410 or 404). Treat an unknown value as capture_failed. Never accepted on sends. - `upload_ref: optional string` Outbound only: our durable handle returned by POST /v1/media. Handles visibly begin upload. and are reusable within the account and key partition that created them. - `url: optional string` Response only: stable attachment download URL requiring the account Bearer key on every request. Pending capture returns 409 with Retry-After; retained bytes expire 30 days after server receipt. Historical unbound messages omit this field. Never accepted on sends. - `voice: optional boolean` Audio only. On a send it is optional: true sends the audio as a voice note; false, or leaving it out, sends it as an ordinary audio file. A voice note needs an upload stored as audio/ogg that holds mono Opus audio, sent by upload_ref or source_url within the existing audio size limit. The bytes are sent as supplied: they are never converted or inspected, so encode them as mono Opus before uploading. The recipient sees a play button only when the voice file is 512 KB or smaller; a larger voice note is still delivered but must be downloaded before it plays. On incoming audio parts it is response-only: whether the channel reported the audio as a voice note, verbatim. true means it was recorded with the messaging client's voice-recording feature; false means it was sent as an audio file. Present on the webhook body and on every later read with the same value. Absent on an incoming part means the channel did not say, never that the audio is not a voice note. Other kinds never carry it, and historical messages received before it was recorded omit it. - `Template object { language, name, type, 4 more }` An approved message template — the one part type sendable outside an open customer service window. name and language identify the approved template; parameters fills its named placeholders. Authentication templates use this same generic part: their published parameter schema names exactly one parameter, `code` — the one-time code you generate, 1–15 characters — and the message shows it in its body and behind its code button. Every sendable template is registered and approved ahead of the send and publishes its own parameter schema — a send referencing an unknown template, a missing or unknown parameter, or a value that breaks the template's rules is rejected with a 422 naming the exact field. - `language: string` The template's language-and-locale code, e.g. en_US. - `name: string` The approved template's name. Lowercase letters, digits and underscores only. - `type: "template"` - `"template"` - `buttons: optional array of object { index, payload, type }` Send-time values for this approved template's own dynamic buttons, in ascending index order: a url button whose destination ends in {{1}} takes the value appended there and is REQUIRED; a quick_reply button takes the payload returned to you when it is tapped and is OPTIONAL — omit it and the button returns its label. Fixed buttons have no slot. The approved template's send_schema lists the (index, type) slots and an x-rule stating which are required; omit buttons entirely for a template with no url slot when the labels are what you want back. - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `cards: optional array of object { card_index, kind, upload_ref, 2 more }` Per-card values for an approved media-card carousel. The approved template's send_schema provides structural bounds and an x-rule listing the exact card order, media kind, named body values, and dynamic button slots enforced by runtime L2 validation. Omit for non-carousel templates. - `card_index: number` - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: string` A durable handle returned by POST /v1/media. It is resolved within this key's account and partition, then consumed into a transient channel media identifier only at delivery. - `buttons: optional array of object { index, payload, type }` - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `parameters: optional unknown` Named values for this card's body placeholders. - `header: optional object { kind, upload_ref }` The uploaded media used for this approved template's media header. Omit unless this template's send_schema requires it. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `parameters: optional unknown` Named values for the template's placeholders. The shape is per-template: each registered template publishes its own parameter schema — hand THAT schema to your model when composing a specific template. Omit for templates with no placeholders. - `InteractiveList object { body, button, sections, 3 more }` An interactive list message: body text plus a button that opens a sectioned list of selectable rows. The customer's selection arrives as an inbound interactive_reply part with kind list_reply, carrying the chosen row's id. - `body: string` The message body. - `button: string` Label of the button that opens the list. - `sections: array of object { rows, title }` The list's sections, each holding selectable rows. At most 10 rows in total across ALL sections combined — not 10 per section. - `rows: array of object { id, title, description }` This section's rows. The 10-row limit is on the TOTAL across all sections, so a second section reduces what this one may hold. - `id: string` Your identifier for the row — echoed back as the interactive_reply's id. - `title: string` The row's visible title. - `description: optional string` Secondary text under the title. - `title: optional string` Section title. Required when the list has more than one section. - `type: "interactive_list"` - `"interactive_list"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `InteractiveButtons object { body, buttons, type, 3 more }` An interactive reply-buttons message: body text plus up to three tappable buttons. The customer's tap arrives as an inbound interactive_reply part with kind button_reply, carrying the tapped button's id. - `body: string` The message body. - `buttons: array of object { id, title }` The tappable buttons — at most three. - `id: string` Your identifier for the button — echoed back as the interactive_reply's id. - `title: string` The button's visible label. - `type: "interactive_buttons"` - `"interactive_buttons"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `InteractiveCtaURL object { body, display_text, type, 4 more }` An interactive call-to-action message: body text plus one button that opens a URL. - `body: string` The message body. - `display_text: string` The button's visible label. - `type: "interactive_cta_url"` - `"interactive_cta_url"` - `url: string` The URL the button opens. Must be absolute, with an http or https scheme. - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref, filename }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `filename: optional string` The file name the customer sees on a document header. Documents only. - `InteractiveCarousel object { body, cards, type }` An interactive carousel: one message whose body sits above 2 to 10 horizontally scrolling cards. Each card shows an uploaded image, or a video from a public link, and either one button that opens a URL or reply buttons. A tap on a card's reply button arrives as an inbound template_reply part whose payload is that button's id; nothing else in the reply identifies the card, so the id you choose is the card's identity. - `body: string` The message text shown above the cards. - `cards: array of object { card_index, header, body, 2 more }` The cards, left to right. - `card_index: number` This card's zero-based position: the first card is 0, the next 1, and so on, in array order. - `header: object { kind, upload_ref, url }` The card's media: an image named by upload_ref, or a video named by the public https url it plays from. Every card carries the same kind. - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: optional string` A durable handle returned by POST /v1/media for an image upload. Image cards only. - `url: optional string` The public https address the card's video plays from. Video cards only. It is sent exactly as written and never fetched by this API, so it must be publicly reachable and serve a playable video; a link that does not play is accepted and then reported as a failed delivery (message.failed with channel_refused). - `body: optional string` Optional text below the card's image or video, with at most two line breaks. - `reply_buttons: optional array of object { id, title }` Buttons the customer taps to reply. Use either url_button or reply_buttons on every card. - `id: string` Your identifier for the button, echoed back as the template_reply's payload. Unique across the whole carousel. - `title: string` The button's visible label. - `url_button: optional object { display_text, url }` One button that opens a URL. Use either url_button or reply_buttons on every card. - `display_text: string` The button's visible label. - `url: string` The absolute https URL the button opens. - `type: "interactive_carousel"` - `"interactive_carousel"` - `LocationRequest object { body, type }` Asks the customer to share a location. The response arrives as a location part. - `body: string` Prompt shown above the send-location button. - `type: "location_request"` - `"location_request"` - `ContactRequest object { body, type }` Asks the customer to share their own contact card with one tap. Useful when you know the customer only by a username identifier and need a phone number. The answer arrives as an ordinary contacts part whose card carries origin contact_request; a card the customer shares by hand carries origin other instead. The answer is not linked to your request as a reply: its message carries no reply_to_message_id, so match it by origin and timing. Sendable inside the customer window. - `body: string` Prompt shown above the share-contact button. - `type: "contact_request"` - `"contact_request"` - `AddressRequest object { body, country, type }` Reserved for asking an eligible customer in India to submit a structured address. Sending this part is not available until business and customer eligibility can be verified at acceptance. Address responses already arrive as address_reply parts. - `body: string` Prompt shown above the address form. - `country: "IN"` ISO country code. Structured address requests are currently available only in India. - `"IN"` - `type: "address_request"` - `"address_request"` - `Contacts object { contacts, type }` One or more contact cards. - `contacts: array of object { name, addresses, birthday, 5 more }` The contact cards to send. The channel permits far more; this API caps a message at five, because a message carrying hundreds of cards is a mistake rather than a use case. - `name: object { formatted_name, first_name, last_name, 3 more }` - `formatted_name: string` The contact's full display name. - `first_name: optional string` - `last_name: optional string` - `middle_name: optional string` - `prefix: optional string` - `suffix: optional string` - `addresses: optional array of object { city, country, country_code, 4 more }` - `city: optional string` - `country: optional string` - `country_code: optional string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `state: optional string` - `street: optional string` - `zip: optional string` - `birthday: optional string` The contact's birthday as YYYY-MM-DD. - `emails: optional array of object { email, kind }` - `email: string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `org: optional object { company, department, title }` - `company: optional string` - `department: optional string` - `title: optional string` - `origin: optional string` Response-only: how the customer came to share this card, as the channel reported it, verbatim. contact_request means they tapped the share button on a contact_request you sent; other means they shared a card themselves. New values may appear, so treat any other value as unrecognised rather than as either of these. Absent when the channel did not say, and on cards received before it was recorded. A send carrying it is rejected with a pointer at the member. - `phones: optional array of object { phone, kind, messaging_id }` - `phone: string` The phone number, ideally in +E.164 form. - `kind: optional string` A label for the number, e.g. CELL, MAIN, WORK, HOME. - `messaging_id: optional string` The contact's messaging-account identifier on this channel, when known — makes the card openable in the messaging app. - `urls: optional array of object { url, kind }` - `url: string` - `kind: optional string` A label for the URL, e.g. WORK, HOME. - `type: "contacts"` - `"contacts"` - `Location object { latitude, longitude, type, 2 more }` A location pin. - `latitude: number` Latitude in decimal degrees. - `longitude: number` Longitude in decimal degrees. - `type: "location"` - `"location"` - `address: optional string` The place's address, shown under the name. - `name: optional string` The place's name, shown on the pin. - `Reaction object { emoji, type, channel_message_id, message_id }` An emoji reaction to an earlier message in the chat. message_id is this API's Message.id for the target in both directions: it is what you send, and it is appended to an inbound reaction whenever the target is a message of the same chat. channel_message_id is the channel's opaque identifier and appears on inbound reactions only. - `emoji: string` A single emoji. Send an empty string to remove a previous reaction to the same message. - `type: "reaction"` - `"reaction"` - `channel_message_id: optional string` Inbound only: the channel's opaque identifier for the message being reacted to. Always present on an inbound reaction, beside message_id whenever the target resolved. Match it literally to Message.channel_message_id in the chat transcript; never parse it or compare it with Message.id. - `message_id: optional string` This API's Message.id for the message being reacted to. Outbound: required, and the API resolves it into the channel namespace before sending, so the message must be one this account can see in the chat the send addresses. Inbound: present whenever the target is a message of the same chat, so you can keep only this identifier; absent when the chat does not hold the target. - `InteractiveReply object { id, kind, title, 2 more }` Inbound only — never sendable. The customer's selection from an interactive_list (kind list_reply) or interactive_buttons (kind button_reply) message, carrying the id you assigned to the chosen row or button. - `id: string` The id you assigned to the chosen row or button, exactly as you sent it. - `kind: "list_reply" or "button_reply"` Which interactive message kind was answered. - `"list_reply"` - `"button_reply"` - `title: string` The chosen row's or button's visible title. - `type: "interactive_reply"` - `"interactive_reply"` - `description: optional string` The chosen list row's secondary text, when it had one. - `TemplateReply object { payload, text, type }` Inbound only — never sendable. The customer tapped a quick-reply button on an approved template you sent, or a reply button on a card of an interactive_carousel you sent. payload is the value you set on that button: the template's quick_reply slot payload (or the button's label when you left the slot out), or the carousel card button's id. text is the label the customer saw. A carousel tap carries nothing else that identifies the card, so the id you chose is the card's only identity. For a template tap, the message's reply_to_message_id names the template message that carried the button. Distinct from interactive_reply, which answers an interactive_buttons or interactive_list message. - `payload: string` The quick_reply slot's payload from your send, or the button label when the slot was omitted; for a carousel card, the tapped reply button's id. - `text: string` The tapped button's label, as the customer saw it. - `type: "template_reply"` - `"template_reply"` - `AddressReply object { type, values, saved_address_id }` Inbound only: the structured values submitted in response to an address request. - `type: "address_reply"` - `"address_reply"` - `values: object { address, building_name, city, 8 more }` - `address: optional string` - `building_name: optional string` - `city: optional string` - `floor_number: optional string` - `house_number: optional string` - `landmark_area: optional string` - `name: optional string` - `phone_number: optional string` - `pin_code: optional string` - `state: optional string` - `tower_number: optional string` - `saved_address_id: optional string` Identifier of the selected saved address, when one was selected. - `Order object { catalog_id, items, type, text }` Inbound only — never sendable. An order the customer placed from a product catalog. - `catalog_id: string` The catalog the ordered items belong to. - `items: array of object { currency, price, product_retailer_id, quantity }` The ordered items. - `currency: string` ISO 4217 currency code for price. - `price: number` The per-item price at order time. - `product_retailer_id: string` Your identifier for the product, as registered in the catalog. - `quantity: number` - `type: "order"` - `"order"` - `text: optional string` Free text the customer attached to the order, when any. - `Referral object { type, body, click_id, 7 more }` Inbound only — never sendable. The ad or post context a customer's first message arrived from (for example an ad whose call to action opens a chat). A referral also opens a free-entry-point customer window — see the chat's customer_window. - `type: "referral"` - `"referral"` - `body: optional string` The ad's body text at click time. - `click_id: optional string` The click identifier assigned by the ad platform, for attribution. - `headline: optional string` The ad's headline at click time. - `image_url: optional string` URL of the ad's image creative, when media_kind is image. - `media_kind: optional string` The ad creative's media kind, e.g. image or video. - `source_id: optional string` The ad or post id. - `source_kind: optional string` What the source was, e.g. ad or post. - `source_url: optional string` The URL of the ad or post the customer came from. - `video_url: optional string` URL of the ad's video creative, when media_kind is video. - `System object { body, type, event }` Inbound only — never sendable. A system event in the chat, such as the customer changing their number. New event kinds appear over time; body is always present and human-readable. - `body: string` Human-readable description of the system event. - `type: "system"` - `"system"` - `event: optional string` The system event's kind, when the channel identifies one. New kinds appear over time — treat unknown values as informational. - `Unsupported object { raw, type, kind }` Inbound only — never sendable. A message kind this API does not yet type natively, carried as a typed passthrough: raw holds the channel payload, so a new message kind is never a black box or a silent drop. Native part types for popular kinds are added over time; this part is the compatibility guarantee in the meantime. - `raw: unknown` The channel payload — any JSON value: object, array, string, number, boolean, or null. Deliberately unconstrained, because the whole point of this part is to carry a shape this API does not yet know. For rows written by API version 1.3.0 or later, object member order, number formatting and duplicated members survive storage and read-back. The canonical encoder may compact insignificant whitespace before storage. Rows written before API version 1.3.0 retain normalized JSON only: member order and number formatting may differ, and only the last duplicated member survives. - `type: "unsupported"` - `"unsupported"` - `kind: optional string` The channel's name for the message kind, when it declares one. - `status: string` The message's delivery state as last reported. Inbound messages read `received`: they arrived, and no delivery of ours ran. A message you sent starts `accepted` and moves through `sent`, `delivered` and `read` as the channel reports them, with `failed` as the definitive negative outcome. `unknown` means exactly that: the send is INDETERMINATE and we decline to guess. It is NOT terminal — an indeterminate send is never re-sent, and it resolves to `sent`, `delivered`, `read` or `failed` when the channel's own report arrives — so keep observing rather than treating it as an outcome. States are reported asynchronously on the chat's event sequence, and the set grows additively: treat a value you do not recognise as "no information" rather than failing on it. Retention of this published status follows the chat transcript policy: there is no scheduled pruning, but no fixed minimum availability period is published yet. The present absence of a scheduled age-based sweep is not a promise of indefinite availability. `delivered` is reported by the channel after it accepted the message and can lag by hours, never arrive at all, or be followed by a failure, so do not build timeouts around it arriving promptly. - `channel_message_id: optional string` The channel's opaque identifier for this message, when the channel has assigned one. An inbound reaction's `channel_message_id` matches this field literally; never parse it or compare it with `id`. It is absent while an accepted outbound message has not yet received a channel identifier, and until it is present an inbound reaction to this message carries only `channel_message_id`. - `failure: optional object { code, message }` Why a failed message failed, when we have a reason worth publishing. Present only on `status` `failed`, and not on every one of those: a message can fail for a reason outside the published vocabulary and carry no `failure` at all. Its absence means "no published reason", never "no reason". Most messages the channel refused do carry one: a specific code where one is published, and `channel_refused` for most of the rest; a few kinds of refusal still carry none. `status` stays the thing to branch on. This is additive detail beside it, so an integration written before this field existed still sees a terminal `failed` and behaves exactly as it did. - `code: string` The specific reason. `sender_deregistered` — the number this message was going out from is no longer a registered sending number, and the message never left. This is terminal: it is not a pause and it does not clear, so retrying the same message cannot succeed and that conversation is over. Reach this customer by starting a new one on another of your numbers with a template, exactly as you would any customer whose 24-hour window has closed; `GET /v1/chats` shows which number each conversation uses. You are not billed for a message that failed this way. `quality_hold_expired` — this marketing message remained held by an automatic safety control on its sending line for ten minutes and was not sent. This is terminal: retrying the same message cannot succeed on that conversation. Send marketing from another of your numbers with a template, or contact support about the sending line. You are not billed for a message that failed this way. `target_message_failed` — the message this one quotes or reacts to failed, or its outcome could not be established, before this message went out. This message was therefore never sent, because a quote is never sent without its context. A `message.failed` event reports it. This is terminal: send it again as a new message, without that target or naming one that was sent. You are not billed a channel charge for it, though it still counts toward your platform subscription's message volume. `recipient_country_restricted` — the business behind the sending number is not currently permitted to message customers in this recipient's country, so the message was not delivered. The restriction blocks every message type, including replies inside the customer's 24-hour window. This is terminal for the message: sending it again cannot succeed while the restriction stands. Most countries unlock only when the business has completed business verification and has held an assigned messaging tier of 2,000 or higher for 30 consecutive days. The assigned tier is what counts, not how many messages you send. Brazil and Indonesia also require the business's primary business location to be in that country, at any tier: a business located elsewhere cannot message customers there. Until the business qualifies, sends to that country will keep failing. The channel publishes no list of restricted country pairs and offers no API signal before a send. If the business meets these conditions and the restriction stands, review the messaging policy for the business's category. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `payment_method_required` — the business behind the sending number has no working payment method on its messaging account, so this message was not sent. This is terminal for the message: retrying it cannot succeed until a payment method is added. Add or update the payment method in the messaging account's billing settings, then send again as a new message. Replies inside an open 24-hour customer window are charged too once the sending number's monthly free allowance of them is used up, so they also need a working payment method and can fail this way. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `recipient_phone_number_required` — this customer is known only by a username identifier, not a phone number, and this message can be delivered only to a phone number, so it was not sent. This is terminal for the message: sending it again to this customer cannot succeed. One-time-code templates (copy code, one-tap or zero-tap autofill) are the usual cause; deliver the code another way. Other messages, including templates without a one-time-code button, can still be sent to this customer. When the template is known in advance to carry a one-time-code button, the send is refused at once with the error `recipient_phone_number_required` instead and nothing is accepted. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `business_restricted` — this message was refused because the business behind the sending number is most likely restricted on its messaging account, so it was not sent. This is terminal for the message: sending it again will not succeed while the restriction stands. Review the status of the business's messaging account, and if the business believes it complies with the messaging policies, request a review of the restriction. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `channel_refused` — this message was refused upstream and was not sent, for a reason that has no more specific code here, and it will not be retried automatically. Contact support with this message's `id` to learn the reason and whether sending it again can succeed. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. A more specific code may be published for some of these refusals in a later release; treat a code you do not recognise exactly as you treat this one. - `message: string` Human-readable, written for a person reading it. Do not branch on it. - `from: optional string` The number this message left by, or arrived on, in E.164 (leading `+`). Every message in one conversation carries the same value — a conversation never moves to another number. Absent only if the number is no longer one of yours. - `reply_to_message_id: optional string` This API's `id` of the earlier message in this chat that this message replies to. On an inbound message it is the message the customer quoted; on an outbound message it is the `reply_to_message_id` you sent. Look the value up in this chat's transcript to show what was answered; it is the same namespace as `id`, never a channel identifier. Absent when there is no reply context this API can resolve — a message that quotes nothing, or one that quotes a message this API never recorded in this chat. Treat absence as "no reply context available", not as proof the message was not a reply. - `zero_retention: optional true` True when the message is under zero-day retention: its content is not kept, so later reads and idempotent retries return empty `parts`. The original send response still carries the content. Retention applies only within Linq's systems. The WhatsApp channel operator's own processing and retention of message content are governed by its terms and are not affected by this setting. - `true` - `has_more: boolean` True when another page exists in the direction you are paging — pass `next_cursor` to fetch it. - `next_cursor: optional string` Cursor for the next page in the same direction; present when `has_more` is true. It can advance past expired ephemeral events intentionally omitted from the read. Send it back with the same `order`. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/chats/$CHAT/events \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` #### Response ```json { "data": [ { "occurred_at": "2019-12-27T18:11:19.117Z", "seq": 0, "type": "type", "message": { "id": "id", "chat_id": "chat_id", "created_at": "2019-12-27T18:11:19.117Z", "direction": "inbound", "parts": [ { "body": "body", "type": "text", "preview_url": true } ], "status": "status", "channel_message_id": "channel_message_id", "failure": { "code": "code", "message": "message" }, "from": "from", "reply_to_message_id": "reply_to_message_id", "zero_retention": true } } ], "has_more": true, "next_cursor": "next_cursor" } ``` # Messages ## Send a message in a chat **post** `/v1/chats/{chat}/messages` Sends a reply on an existing chat's unchanged sending number. The chat supplies the customer and sender; this operation never creates, moves, repins or fails over a conversation. Acceptance and refusal semantics are otherwise identical to `POST /v1/messages`. ### Path Parameters - `chat: string` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `parts: array of object { body, type, preview_url } or object { kind, type, availability, 10 more } or object { language, name, type, 4 more } or 10 more` The message content — sendable parts only, at least one. **One outbound part per request.** Each request has its own acceptance result and optional idempotency key. Each accepted request maps to one native channel message with its own identifier, delivery outcome and charge evidence. A request carrying more than one part is refused with HTTP 422 (`multiple_parts_not_available`, a 1xxx `error.code`, 1019); the API neither fans it out nor offers an atomic batch. Separate requests are independent, and no cross-request delivery or receipt order is promised. A customer known only by a username identifier can receive every message type except a one-time-code template (a copy-code, one-tap or zero-tap autofill button), which can be delivered only to a phone number. When the template is known to carry such a button, the send is refused with HTTP 422 `recipient_phone_number_required` (a 4xxx `error.code`, 4011), pointered at the part, and nothing is accepted; deliver the code another way. - `Text object { body, type, preview_url }` A plain text message. - `body: string` The message text. URLs render as tappable links. - `type: "text"` - `"text"` - `preview_url: optional boolean` Render a preview card for the first URL in body. Defaults to false. - `Media object { kind, type, availability, 10 more }` A media message — image, video, audio, document, or sticker. The two identifiers are distinct namespaces: inbound media carries the channel's transient media_id; outbound media carries our durable upload_ref from POST /v1/media. - `kind: "image" or "video" or "audio" or 2 more` Which kind of media this is. Captions apply to image, video and document only; filename applies to document only. - `"image"` - `"video"` - `"audio"` - `"document"` - `"sticker"` - `type: "media"` - `"media"` - `availability: optional "available" or "unavailable" or "pending"` Response only, inbound parts only: whether the download answers the bytes. available: the file was captured and is retained. unavailable: it is not downloadable now, and unavailable_reason says why; with timed_out the download answers 409 while capture continues and can later answer 200, otherwise it answers 410, or 404 once the file is no longer known. It describes the file, not the exact HTTP answer of a later download, which can also refuse for capacity or authorization. pending: capture has not finished yet; only reads of the conversation return pending, and a message event never does. A message.received event is recorded once every attachment has been captured or has failed, or ten minutes after the message arrived, whichever comes first; an event part without availability is from a historical event and may still be capturing, so retry its download as the 409 Retry-After directs. A message event keeps the value it was recorded with; reads return the current one. Historical messages received before it was recorded omit it. Never accepted on sends. - `"available"` - `"unavailable"` - `"pending"` - `byte_size: optional number` Response only, inbound parts only: the exact size in bytes of the retained attachment, equal to the download's Content-Length. Present only while the bytes are captured and retained — the same lifetime as a working url, ending 30 days after server receipt — so it can be absent from a message event while capture has not completed, and its absence is not final; once present it never changes. Absent rather than zero. Never accepted on sends. - `caption: optional string` Caption rendered with the media. Image, video and document only — a caption on an audio or sticker part is rejected, never dropped. - `filename: optional string` Display filename. Documents only — a filename on any other kind is rejected, never dropped. - `media_id: optional string` Inbound only: the channel's transient media identifier. It expires after seven days and is never an outbound address; an outbound value is rejected with a pointer to media_id and upload_ref as the remedy. - `mime_type: optional string` Response only, inbound parts only: the media type the channel declared when the message arrived, verbatim. It may carry parameters (for example audio/ogg; codecs=opus) and may differ from the Content-Type the download answers with, which describes the retained bytes. Present on the webhook body and on every later read with the same value. Historical messages received before it was recorded omit this field. Never accepted on sends. - `source_url: optional string` Outbound only: a public https URL of the bytes to send, as an alternative to upload_ref. Supply exactly one of upload_ref or source_url. The address is fetched once, before the send is accepted, and its exact bytes are stored as an ordinary upload in this account and key partition; the accepted message and every later read carry that upload's upload_ref, never the address, and no retry fetches it again. The URL must be absolute https on the default port with no credentials and no fragment, must resolve to a public address (every redirect hop included, at most three), and must answer with the complete bytes and their exact media type within the fetch deadline. The bytes are then held to the same media type and size rules as POST /v1/media for the part's kind; a mismatch is refused, never converted. - `unavailable_reason: optional string` Response only, present only when availability is unavailable. An open string: the values today are timed_out, capture_failed and expired, and new values may be added. timed_out: the file was still being retrieved ten minutes after the message arrived, so its message event was recorded without it; retrieval continues and the file may become downloadable later, which reads of the conversation report. capture_failed: the file could not be retrieved. expired: the file was retrieved and is no longer retained, or is no longer known (the download then answers 410 or 404). Treat an unknown value as capture_failed. Never accepted on sends. - `upload_ref: optional string` Outbound only: our durable handle returned by POST /v1/media. Handles visibly begin upload. and are reusable within the account and key partition that created them. - `url: optional string` Response only: stable attachment download URL requiring the account Bearer key on every request. Pending capture returns 409 with Retry-After; retained bytes expire 30 days after server receipt. Historical unbound messages omit this field. Never accepted on sends. - `voice: optional boolean` Audio only. On a send it is optional: true sends the audio as a voice note; false, or leaving it out, sends it as an ordinary audio file. A voice note needs an upload stored as audio/ogg that holds mono Opus audio, sent by upload_ref or source_url within the existing audio size limit. The bytes are sent as supplied: they are never converted or inspected, so encode them as mono Opus before uploading. The recipient sees a play button only when the voice file is 512 KB or smaller; a larger voice note is still delivered but must be downloaded before it plays. On incoming audio parts it is response-only: whether the channel reported the audio as a voice note, verbatim. true means it was recorded with the messaging client's voice-recording feature; false means it was sent as an audio file. Present on the webhook body and on every later read with the same value. Absent on an incoming part means the channel did not say, never that the audio is not a voice note. Other kinds never carry it, and historical messages received before it was recorded omit it. - `Template object { language, name, type, 4 more }` An approved message template — the one part type sendable outside an open customer service window. name and language identify the approved template; parameters fills its named placeholders. Authentication templates use this same generic part: their published parameter schema names exactly one parameter, `code` — the one-time code you generate, 1–15 characters — and the message shows it in its body and behind its code button. Every sendable template is registered and approved ahead of the send and publishes its own parameter schema — a send referencing an unknown template, a missing or unknown parameter, or a value that breaks the template's rules is rejected with a 422 naming the exact field. - `language: string` The template's language-and-locale code, e.g. en_US. - `name: string` The approved template's name. Lowercase letters, digits and underscores only. - `type: "template"` - `"template"` - `buttons: optional array of object { index, payload, type }` Send-time values for this approved template's own dynamic buttons, in ascending index order: a url button whose destination ends in {{1}} takes the value appended there and is REQUIRED; a quick_reply button takes the payload returned to you when it is tapped and is OPTIONAL — omit it and the button returns its label. Fixed buttons have no slot. The approved template's send_schema lists the (index, type) slots and an x-rule stating which are required; omit buttons entirely for a template with no url slot when the labels are what you want back. - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `cards: optional array of object { card_index, kind, upload_ref, 2 more }` Per-card values for an approved media-card carousel. The approved template's send_schema provides structural bounds and an x-rule listing the exact card order, media kind, named body values, and dynamic button slots enforced by runtime L2 validation. Omit for non-carousel templates. - `card_index: number` - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: string` A durable handle returned by POST /v1/media. It is resolved within this key's account and partition, then consumed into a transient channel media identifier only at delivery. - `buttons: optional array of object { index, payload, type }` - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `parameters: optional unknown` Named values for this card's body placeholders. - `header: optional object { kind, upload_ref }` The uploaded media used for this approved template's media header. Omit unless this template's send_schema requires it. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `parameters: optional unknown` Named values for the template's placeholders. The shape is per-template: each registered template publishes its own parameter schema — hand THAT schema to your model when composing a specific template. Omit for templates with no placeholders. - `InteractiveList object { body, button, sections, 3 more }` An interactive list message: body text plus a button that opens a sectioned list of selectable rows. The customer's selection arrives as an inbound interactive_reply part with kind list_reply, carrying the chosen row's id. - `body: string` The message body. - `button: string` Label of the button that opens the list. - `sections: array of object { rows, title }` The list's sections, each holding selectable rows. At most 10 rows in total across ALL sections combined — not 10 per section. - `rows: array of object { id, title, description }` This section's rows. The 10-row limit is on the TOTAL across all sections, so a second section reduces what this one may hold. - `id: string` Your identifier for the row — echoed back as the interactive_reply's id. - `title: string` The row's visible title. - `description: optional string` Secondary text under the title. - `title: optional string` Section title. Required when the list has more than one section. - `type: "interactive_list"` - `"interactive_list"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `InteractiveButtons object { body, buttons, type, 3 more }` An interactive reply-buttons message: body text plus up to three tappable buttons. The customer's tap arrives as an inbound interactive_reply part with kind button_reply, carrying the tapped button's id. - `body: string` The message body. - `buttons: array of object { id, title }` The tappable buttons — at most three. - `id: string` Your identifier for the button — echoed back as the interactive_reply's id. - `title: string` The button's visible label. - `type: "interactive_buttons"` - `"interactive_buttons"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `InteractiveCtaURL object { body, display_text, type, 4 more }` An interactive call-to-action message: body text plus one button that opens a URL. - `body: string` The message body. - `display_text: string` The button's visible label. - `type: "interactive_cta_url"` - `"interactive_cta_url"` - `url: string` The URL the button opens. Must be absolute, with an http or https scheme. - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref, filename }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `filename: optional string` The file name the customer sees on a document header. Documents only. - `InteractiveCarousel object { body, cards, type }` An interactive carousel: one message whose body sits above 2 to 10 horizontally scrolling cards. Each card shows an uploaded image, or a video from a public link, and either one button that opens a URL or reply buttons. A tap on a card's reply button arrives as an inbound template_reply part whose payload is that button's id; nothing else in the reply identifies the card, so the id you choose is the card's identity. - `body: string` The message text shown above the cards. - `cards: array of object { card_index, header, body, 2 more }` The cards, left to right. - `card_index: number` This card's zero-based position: the first card is 0, the next 1, and so on, in array order. - `header: object { kind, upload_ref, url }` The card's media: an image named by upload_ref, or a video named by the public https url it plays from. Every card carries the same kind. - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: optional string` A durable handle returned by POST /v1/media for an image upload. Image cards only. - `url: optional string` The public https address the card's video plays from. Video cards only. It is sent exactly as written and never fetched by this API, so it must be publicly reachable and serve a playable video; a link that does not play is accepted and then reported as a failed delivery (message.failed with channel_refused). - `body: optional string` Optional text below the card's image or video, with at most two line breaks. - `reply_buttons: optional array of object { id, title }` Buttons the customer taps to reply. Use either url_button or reply_buttons on every card. - `id: string` Your identifier for the button, echoed back as the template_reply's payload. Unique across the whole carousel. - `title: string` The button's visible label. - `url_button: optional object { display_text, url }` One button that opens a URL. Use either url_button or reply_buttons on every card. - `display_text: string` The button's visible label. - `url: string` The absolute https URL the button opens. - `type: "interactive_carousel"` - `"interactive_carousel"` - `LocationRequest object { body, type }` Asks the customer to share a location. The response arrives as a location part. - `body: string` Prompt shown above the send-location button. - `type: "location_request"` - `"location_request"` - `ContactRequest object { body, type }` Asks the customer to share their own contact card with one tap. Useful when you know the customer only by a username identifier and need a phone number. The answer arrives as an ordinary contacts part whose card carries origin contact_request; a card the customer shares by hand carries origin other instead. The answer is not linked to your request as a reply: its message carries no reply_to_message_id, so match it by origin and timing. Sendable inside the customer window. - `body: string` Prompt shown above the share-contact button. - `type: "contact_request"` - `"contact_request"` - `AddressRequest object { body, country, type }` Reserved for asking an eligible customer in India to submit a structured address. Sending this part is not available until business and customer eligibility can be verified at acceptance. Address responses already arrive as address_reply parts. - `body: string` Prompt shown above the address form. - `country: "IN"` ISO country code. Structured address requests are currently available only in India. - `"IN"` - `type: "address_request"` - `"address_request"` - `Contacts object { contacts, type }` One or more contact cards. - `contacts: array of object { name, addresses, birthday, 5 more }` The contact cards to send. The channel permits far more; this API caps a message at five, because a message carrying hundreds of cards is a mistake rather than a use case. - `name: object { formatted_name, first_name, last_name, 3 more }` - `formatted_name: string` The contact's full display name. - `first_name: optional string` - `last_name: optional string` - `middle_name: optional string` - `prefix: optional string` - `suffix: optional string` - `addresses: optional array of object { city, country, country_code, 4 more }` - `city: optional string` - `country: optional string` - `country_code: optional string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `state: optional string` - `street: optional string` - `zip: optional string` - `birthday: optional string` The contact's birthday as YYYY-MM-DD. - `emails: optional array of object { email, kind }` - `email: string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `org: optional object { company, department, title }` - `company: optional string` - `department: optional string` - `title: optional string` - `origin: optional string` Response-only: how the customer came to share this card, as the channel reported it, verbatim. contact_request means they tapped the share button on a contact_request you sent; other means they shared a card themselves. New values may appear, so treat any other value as unrecognised rather than as either of these. Absent when the channel did not say, and on cards received before it was recorded. A send carrying it is rejected with a pointer at the member. - `phones: optional array of object { phone, kind, messaging_id }` - `phone: string` The phone number, ideally in +E.164 form. - `kind: optional string` A label for the number, e.g. CELL, MAIN, WORK, HOME. - `messaging_id: optional string` The contact's messaging-account identifier on this channel, when known — makes the card openable in the messaging app. - `urls: optional array of object { url, kind }` - `url: string` - `kind: optional string` A label for the URL, e.g. WORK, HOME. - `type: "contacts"` - `"contacts"` - `Location object { latitude, longitude, type, 2 more }` A location pin. - `latitude: number` Latitude in decimal degrees. - `longitude: number` Longitude in decimal degrees. - `type: "location"` - `"location"` - `address: optional string` The place's address, shown under the name. - `name: optional string` The place's name, shown on the pin. - `Reaction object { emoji, type, channel_message_id, message_id }` An emoji reaction to an earlier message in the chat. message_id is this API's Message.id for the target in both directions: it is what you send, and it is appended to an inbound reaction whenever the target is a message of the same chat. channel_message_id is the channel's opaque identifier and appears on inbound reactions only. - `emoji: string` A single emoji. Send an empty string to remove a previous reaction to the same message. - `type: "reaction"` - `"reaction"` - `channel_message_id: optional string` Inbound only: the channel's opaque identifier for the message being reacted to. Always present on an inbound reaction, beside message_id whenever the target resolved. Match it literally to Message.channel_message_id in the chat transcript; never parse it or compare it with Message.id. - `message_id: optional string` This API's Message.id for the message being reacted to. Outbound: required, and the API resolves it into the channel namespace before sending, so the message must be one this account can see in the chat the send addresses. Inbound: present whenever the target is a message of the same chat, so you can keep only this identifier; absent when the chat does not hold the target. - `reply_to_message_id: optional string` Our opaque `Message.id` for an earlier message in this same chat. The accepted message reads back with the same `reply_to_message_id`, and an inbound message that quotes one of yours carries the quoted message's `id` in the same field. - `send_at: optional string` RESERVED — scheduled sends are not yet available. Any value is refused. ### Returns - `AcceptedMessage object { id, chat_id, created_at, 9 more }` An accepted send: the message, plus how its sending number was chosen. - `id: string` This API's message id. Put this value in an outbound reaction's `message_id`; an inbound reaction to this message carries the same value in its `message_id`, so this is the one identifier you need to keep. Mark-as-read targets the latest unread inbound message in a chat, so it takes the chat id. - `chat_id: string` The chat this message belongs to. - `created_at: string` - `direction: "inbound" or "outbound"` `inbound` (from the customer) or `outbound` (sent by you). - `"inbound"` - `"outbound"` - `parts: array of object { body, type, preview_url } or object { kind, type, availability, 10 more } or object { language, name, type, 4 more } or 17 more` The message content — sendable parts, plus the inbound-only types on inbound messages. Empty only when `zero_retention` is true, or when an idempotent retry returns an ephemeral message whose content retention cleanup has removed. - `Text object { body, type, preview_url }` A plain text message. - `body: string` The message text. URLs render as tappable links. - `type: "text"` - `"text"` - `preview_url: optional boolean` Render a preview card for the first URL in body. Defaults to false. - `Media object { kind, type, availability, 10 more }` A media message — image, video, audio, document, or sticker. The two identifiers are distinct namespaces: inbound media carries the channel's transient media_id; outbound media carries our durable upload_ref from POST /v1/media. - `kind: "image" or "video" or "audio" or 2 more` Which kind of media this is. Captions apply to image, video and document only; filename applies to document only. - `"image"` - `"video"` - `"audio"` - `"document"` - `"sticker"` - `type: "media"` - `"media"` - `availability: optional "available" or "unavailable" or "pending"` Response only, inbound parts only: whether the download answers the bytes. available: the file was captured and is retained. unavailable: it is not downloadable now, and unavailable_reason says why; with timed_out the download answers 409 while capture continues and can later answer 200, otherwise it answers 410, or 404 once the file is no longer known. It describes the file, not the exact HTTP answer of a later download, which can also refuse for capacity or authorization. pending: capture has not finished yet; only reads of the conversation return pending, and a message event never does. A message.received event is recorded once every attachment has been captured or has failed, or ten minutes after the message arrived, whichever comes first; an event part without availability is from a historical event and may still be capturing, so retry its download as the 409 Retry-After directs. A message event keeps the value it was recorded with; reads return the current one. Historical messages received before it was recorded omit it. Never accepted on sends. - `"available"` - `"unavailable"` - `"pending"` - `byte_size: optional number` Response only, inbound parts only: the exact size in bytes of the retained attachment, equal to the download's Content-Length. Present only while the bytes are captured and retained — the same lifetime as a working url, ending 30 days after server receipt — so it can be absent from a message event while capture has not completed, and its absence is not final; once present it never changes. Absent rather than zero. Never accepted on sends. - `caption: optional string` Caption rendered with the media. Image, video and document only — a caption on an audio or sticker part is rejected, never dropped. - `filename: optional string` Display filename. Documents only — a filename on any other kind is rejected, never dropped. - `media_id: optional string` Inbound only: the channel's transient media identifier. It expires after seven days and is never an outbound address; an outbound value is rejected with a pointer to media_id and upload_ref as the remedy. - `mime_type: optional string` Response only, inbound parts only: the media type the channel declared when the message arrived, verbatim. It may carry parameters (for example audio/ogg; codecs=opus) and may differ from the Content-Type the download answers with, which describes the retained bytes. Present on the webhook body and on every later read with the same value. Historical messages received before it was recorded omit this field. Never accepted on sends. - `source_url: optional string` Outbound only: a public https URL of the bytes to send, as an alternative to upload_ref. Supply exactly one of upload_ref or source_url. The address is fetched once, before the send is accepted, and its exact bytes are stored as an ordinary upload in this account and key partition; the accepted message and every later read carry that upload's upload_ref, never the address, and no retry fetches it again. The URL must be absolute https on the default port with no credentials and no fragment, must resolve to a public address (every redirect hop included, at most three), and must answer with the complete bytes and their exact media type within the fetch deadline. The bytes are then held to the same media type and size rules as POST /v1/media for the part's kind; a mismatch is refused, never converted. - `unavailable_reason: optional string` Response only, present only when availability is unavailable. An open string: the values today are timed_out, capture_failed and expired, and new values may be added. timed_out: the file was still being retrieved ten minutes after the message arrived, so its message event was recorded without it; retrieval continues and the file may become downloadable later, which reads of the conversation report. capture_failed: the file could not be retrieved. expired: the file was retrieved and is no longer retained, or is no longer known (the download then answers 410 or 404). Treat an unknown value as capture_failed. Never accepted on sends. - `upload_ref: optional string` Outbound only: our durable handle returned by POST /v1/media. Handles visibly begin upload. and are reusable within the account and key partition that created them. - `url: optional string` Response only: stable attachment download URL requiring the account Bearer key on every request. Pending capture returns 409 with Retry-After; retained bytes expire 30 days after server receipt. Historical unbound messages omit this field. Never accepted on sends. - `voice: optional boolean` Audio only. On a send it is optional: true sends the audio as a voice note; false, or leaving it out, sends it as an ordinary audio file. A voice note needs an upload stored as audio/ogg that holds mono Opus audio, sent by upload_ref or source_url within the existing audio size limit. The bytes are sent as supplied: they are never converted or inspected, so encode them as mono Opus before uploading. The recipient sees a play button only when the voice file is 512 KB or smaller; a larger voice note is still delivered but must be downloaded before it plays. On incoming audio parts it is response-only: whether the channel reported the audio as a voice note, verbatim. true means it was recorded with the messaging client's voice-recording feature; false means it was sent as an audio file. Present on the webhook body and on every later read with the same value. Absent on an incoming part means the channel did not say, never that the audio is not a voice note. Other kinds never carry it, and historical messages received before it was recorded omit it. - `Template object { language, name, type, 4 more }` An approved message template — the one part type sendable outside an open customer service window. name and language identify the approved template; parameters fills its named placeholders. Authentication templates use this same generic part: their published parameter schema names exactly one parameter, `code` — the one-time code you generate, 1–15 characters — and the message shows it in its body and behind its code button. Every sendable template is registered and approved ahead of the send and publishes its own parameter schema — a send referencing an unknown template, a missing or unknown parameter, or a value that breaks the template's rules is rejected with a 422 naming the exact field. - `language: string` The template's language-and-locale code, e.g. en_US. - `name: string` The approved template's name. Lowercase letters, digits and underscores only. - `type: "template"` - `"template"` - `buttons: optional array of object { index, payload, type }` Send-time values for this approved template's own dynamic buttons, in ascending index order: a url button whose destination ends in {{1}} takes the value appended there and is REQUIRED; a quick_reply button takes the payload returned to you when it is tapped and is OPTIONAL — omit it and the button returns its label. Fixed buttons have no slot. The approved template's send_schema lists the (index, type) slots and an x-rule stating which are required; omit buttons entirely for a template with no url slot when the labels are what you want back. - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `cards: optional array of object { card_index, kind, upload_ref, 2 more }` Per-card values for an approved media-card carousel. The approved template's send_schema provides structural bounds and an x-rule listing the exact card order, media kind, named body values, and dynamic button slots enforced by runtime L2 validation. Omit for non-carousel templates. - `card_index: number` - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: string` A durable handle returned by POST /v1/media. It is resolved within this key's account and partition, then consumed into a transient channel media identifier only at delivery. - `buttons: optional array of object { index, payload, type }` - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `parameters: optional unknown` Named values for this card's body placeholders. - `header: optional object { kind, upload_ref }` The uploaded media used for this approved template's media header. Omit unless this template's send_schema requires it. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `parameters: optional unknown` Named values for the template's placeholders. The shape is per-template: each registered template publishes its own parameter schema — hand THAT schema to your model when composing a specific template. Omit for templates with no placeholders. - `InteractiveList object { body, button, sections, 3 more }` An interactive list message: body text plus a button that opens a sectioned list of selectable rows. The customer's selection arrives as an inbound interactive_reply part with kind list_reply, carrying the chosen row's id. - `body: string` The message body. - `button: string` Label of the button that opens the list. - `sections: array of object { rows, title }` The list's sections, each holding selectable rows. At most 10 rows in total across ALL sections combined — not 10 per section. - `rows: array of object { id, title, description }` This section's rows. The 10-row limit is on the TOTAL across all sections, so a second section reduces what this one may hold. - `id: string` Your identifier for the row — echoed back as the interactive_reply's id. - `title: string` The row's visible title. - `description: optional string` Secondary text under the title. - `title: optional string` Section title. Required when the list has more than one section. - `type: "interactive_list"` - `"interactive_list"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `InteractiveButtons object { body, buttons, type, 3 more }` An interactive reply-buttons message: body text plus up to three tappable buttons. The customer's tap arrives as an inbound interactive_reply part with kind button_reply, carrying the tapped button's id. - `body: string` The message body. - `buttons: array of object { id, title }` The tappable buttons — at most three. - `id: string` Your identifier for the button — echoed back as the interactive_reply's id. - `title: string` The button's visible label. - `type: "interactive_buttons"` - `"interactive_buttons"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `InteractiveCtaURL object { body, display_text, type, 4 more }` An interactive call-to-action message: body text plus one button that opens a URL. - `body: string` The message body. - `display_text: string` The button's visible label. - `type: "interactive_cta_url"` - `"interactive_cta_url"` - `url: string` The URL the button opens. Must be absolute, with an http or https scheme. - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref, filename }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `filename: optional string` The file name the customer sees on a document header. Documents only. - `InteractiveCarousel object { body, cards, type }` An interactive carousel: one message whose body sits above 2 to 10 horizontally scrolling cards. Each card shows an uploaded image, or a video from a public link, and either one button that opens a URL or reply buttons. A tap on a card's reply button arrives as an inbound template_reply part whose payload is that button's id; nothing else in the reply identifies the card, so the id you choose is the card's identity. - `body: string` The message text shown above the cards. - `cards: array of object { card_index, header, body, 2 more }` The cards, left to right. - `card_index: number` This card's zero-based position: the first card is 0, the next 1, and so on, in array order. - `header: object { kind, upload_ref, url }` The card's media: an image named by upload_ref, or a video named by the public https url it plays from. Every card carries the same kind. - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: optional string` A durable handle returned by POST /v1/media for an image upload. Image cards only. - `url: optional string` The public https address the card's video plays from. Video cards only. It is sent exactly as written and never fetched by this API, so it must be publicly reachable and serve a playable video; a link that does not play is accepted and then reported as a failed delivery (message.failed with channel_refused). - `body: optional string` Optional text below the card's image or video, with at most two line breaks. - `reply_buttons: optional array of object { id, title }` Buttons the customer taps to reply. Use either url_button or reply_buttons on every card. - `id: string` Your identifier for the button, echoed back as the template_reply's payload. Unique across the whole carousel. - `title: string` The button's visible label. - `url_button: optional object { display_text, url }` One button that opens a URL. Use either url_button or reply_buttons on every card. - `display_text: string` The button's visible label. - `url: string` The absolute https URL the button opens. - `type: "interactive_carousel"` - `"interactive_carousel"` - `LocationRequest object { body, type }` Asks the customer to share a location. The response arrives as a location part. - `body: string` Prompt shown above the send-location button. - `type: "location_request"` - `"location_request"` - `ContactRequest object { body, type }` Asks the customer to share their own contact card with one tap. Useful when you know the customer only by a username identifier and need a phone number. The answer arrives as an ordinary contacts part whose card carries origin contact_request; a card the customer shares by hand carries origin other instead. The answer is not linked to your request as a reply: its message carries no reply_to_message_id, so match it by origin and timing. Sendable inside the customer window. - `body: string` Prompt shown above the share-contact button. - `type: "contact_request"` - `"contact_request"` - `AddressRequest object { body, country, type }` Reserved for asking an eligible customer in India to submit a structured address. Sending this part is not available until business and customer eligibility can be verified at acceptance. Address responses already arrive as address_reply parts. - `body: string` Prompt shown above the address form. - `country: "IN"` ISO country code. Structured address requests are currently available only in India. - `"IN"` - `type: "address_request"` - `"address_request"` - `Contacts object { contacts, type }` One or more contact cards. - `contacts: array of object { name, addresses, birthday, 5 more }` The contact cards to send. The channel permits far more; this API caps a message at five, because a message carrying hundreds of cards is a mistake rather than a use case. - `name: object { formatted_name, first_name, last_name, 3 more }` - `formatted_name: string` The contact's full display name. - `first_name: optional string` - `last_name: optional string` - `middle_name: optional string` - `prefix: optional string` - `suffix: optional string` - `addresses: optional array of object { city, country, country_code, 4 more }` - `city: optional string` - `country: optional string` - `country_code: optional string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `state: optional string` - `street: optional string` - `zip: optional string` - `birthday: optional string` The contact's birthday as YYYY-MM-DD. - `emails: optional array of object { email, kind }` - `email: string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `org: optional object { company, department, title }` - `company: optional string` - `department: optional string` - `title: optional string` - `origin: optional string` Response-only: how the customer came to share this card, as the channel reported it, verbatim. contact_request means they tapped the share button on a contact_request you sent; other means they shared a card themselves. New values may appear, so treat any other value as unrecognised rather than as either of these. Absent when the channel did not say, and on cards received before it was recorded. A send carrying it is rejected with a pointer at the member. - `phones: optional array of object { phone, kind, messaging_id }` - `phone: string` The phone number, ideally in +E.164 form. - `kind: optional string` A label for the number, e.g. CELL, MAIN, WORK, HOME. - `messaging_id: optional string` The contact's messaging-account identifier on this channel, when known — makes the card openable in the messaging app. - `urls: optional array of object { url, kind }` - `url: string` - `kind: optional string` A label for the URL, e.g. WORK, HOME. - `type: "contacts"` - `"contacts"` - `Location object { latitude, longitude, type, 2 more }` A location pin. - `latitude: number` Latitude in decimal degrees. - `longitude: number` Longitude in decimal degrees. - `type: "location"` - `"location"` - `address: optional string` The place's address, shown under the name. - `name: optional string` The place's name, shown on the pin. - `Reaction object { emoji, type, channel_message_id, message_id }` An emoji reaction to an earlier message in the chat. message_id is this API's Message.id for the target in both directions: it is what you send, and it is appended to an inbound reaction whenever the target is a message of the same chat. channel_message_id is the channel's opaque identifier and appears on inbound reactions only. - `emoji: string` A single emoji. Send an empty string to remove a previous reaction to the same message. - `type: "reaction"` - `"reaction"` - `channel_message_id: optional string` Inbound only: the channel's opaque identifier for the message being reacted to. Always present on an inbound reaction, beside message_id whenever the target resolved. Match it literally to Message.channel_message_id in the chat transcript; never parse it or compare it with Message.id. - `message_id: optional string` This API's Message.id for the message being reacted to. Outbound: required, and the API resolves it into the channel namespace before sending, so the message must be one this account can see in the chat the send addresses. Inbound: present whenever the target is a message of the same chat, so you can keep only this identifier; absent when the chat does not hold the target. - `InteractiveReply object { id, kind, title, 2 more }` Inbound only — never sendable. The customer's selection from an interactive_list (kind list_reply) or interactive_buttons (kind button_reply) message, carrying the id you assigned to the chosen row or button. - `id: string` The id you assigned to the chosen row or button, exactly as you sent it. - `kind: "list_reply" or "button_reply"` Which interactive message kind was answered. - `"list_reply"` - `"button_reply"` - `title: string` The chosen row's or button's visible title. - `type: "interactive_reply"` - `"interactive_reply"` - `description: optional string` The chosen list row's secondary text, when it had one. - `TemplateReply object { payload, text, type }` Inbound only — never sendable. The customer tapped a quick-reply button on an approved template you sent, or a reply button on a card of an interactive_carousel you sent. payload is the value you set on that button: the template's quick_reply slot payload (or the button's label when you left the slot out), or the carousel card button's id. text is the label the customer saw. A carousel tap carries nothing else that identifies the card, so the id you chose is the card's only identity. For a template tap, the message's reply_to_message_id names the template message that carried the button. Distinct from interactive_reply, which answers an interactive_buttons or interactive_list message. - `payload: string` The quick_reply slot's payload from your send, or the button label when the slot was omitted; for a carousel card, the tapped reply button's id. - `text: string` The tapped button's label, as the customer saw it. - `type: "template_reply"` - `"template_reply"` - `AddressReply object { type, values, saved_address_id }` Inbound only: the structured values submitted in response to an address request. - `type: "address_reply"` - `"address_reply"` - `values: object { address, building_name, city, 8 more }` - `address: optional string` - `building_name: optional string` - `city: optional string` - `floor_number: optional string` - `house_number: optional string` - `landmark_area: optional string` - `name: optional string` - `phone_number: optional string` - `pin_code: optional string` - `state: optional string` - `tower_number: optional string` - `saved_address_id: optional string` Identifier of the selected saved address, when one was selected. - `Order object { catalog_id, items, type, text }` Inbound only — never sendable. An order the customer placed from a product catalog. - `catalog_id: string` The catalog the ordered items belong to. - `items: array of object { currency, price, product_retailer_id, quantity }` The ordered items. - `currency: string` ISO 4217 currency code for price. - `price: number` The per-item price at order time. - `product_retailer_id: string` Your identifier for the product, as registered in the catalog. - `quantity: number` - `type: "order"` - `"order"` - `text: optional string` Free text the customer attached to the order, when any. - `Referral object { type, body, click_id, 7 more }` Inbound only — never sendable. The ad or post context a customer's first message arrived from (for example an ad whose call to action opens a chat). A referral also opens a free-entry-point customer window — see the chat's customer_window. - `type: "referral"` - `"referral"` - `body: optional string` The ad's body text at click time. - `click_id: optional string` The click identifier assigned by the ad platform, for attribution. - `headline: optional string` The ad's headline at click time. - `image_url: optional string` URL of the ad's image creative, when media_kind is image. - `media_kind: optional string` The ad creative's media kind, e.g. image or video. - `source_id: optional string` The ad or post id. - `source_kind: optional string` What the source was, e.g. ad or post. - `source_url: optional string` The URL of the ad or post the customer came from. - `video_url: optional string` URL of the ad's video creative, when media_kind is video. - `System object { body, type, event }` Inbound only — never sendable. A system event in the chat, such as the customer changing their number. New event kinds appear over time; body is always present and human-readable. - `body: string` Human-readable description of the system event. - `type: "system"` - `"system"` - `event: optional string` The system event's kind, when the channel identifies one. New kinds appear over time — treat unknown values as informational. - `Unsupported object { raw, type, kind }` Inbound only — never sendable. A message kind this API does not yet type natively, carried as a typed passthrough: raw holds the channel payload, so a new message kind is never a black box or a silent drop. Native part types for popular kinds are added over time; this part is the compatibility guarantee in the meantime. - `raw: unknown` The channel payload — any JSON value: object, array, string, number, boolean, or null. Deliberately unconstrained, because the whole point of this part is to carry a shape this API does not yet know. For rows written by API version 1.3.0 or later, object member order, number formatting and duplicated members survive storage and read-back. The canonical encoder may compact insignificant whitespace before storage. Rows written before API version 1.3.0 retain normalized JSON only: member order and number formatting may differ, and only the last duplicated member survives. - `type: "unsupported"` - `"unsupported"` - `kind: optional string` The channel's name for the message kind, when it declares one. - `status: string` The message's delivery state as last reported. Inbound messages read `received`: they arrived, and no delivery of ours ran. A message you sent starts `accepted` and moves through `sent`, `delivered` and `read` as the channel reports them, with `failed` as the definitive negative outcome. `unknown` means exactly that: the send is INDETERMINATE and we decline to guess. It is NOT terminal — an indeterminate send is never re-sent, and it resolves to `sent`, `delivered`, `read` or `failed` when the channel's own report arrives — so keep observing rather than treating it as an outcome. States are reported asynchronously on the chat's event sequence, and the set grows additively: treat a value you do not recognise as "no information" rather than failing on it. Retention of this published status follows the chat transcript policy: there is no scheduled pruning, but no fixed minimum availability period is published yet. The present absence of a scheduled age-based sweep is not a promise of indefinite availability. `delivered` is reported by the channel after it accepted the message and can lag by hours, never arrive at all, or be followed by a failure, so do not build timeouts around it arriving promptly. - `channel_message_id: optional string` The channel's opaque identifier for this message, when the channel has assigned one. An inbound reaction's `channel_message_id` matches this field literally; never parse it or compare it with `id`. It is absent while an accepted outbound message has not yet received a channel identifier, and until it is present an inbound reaction to this message carries only `channel_message_id`. - `failure: optional object { code, message }` Why a failed message failed, when we have a reason worth publishing. Present only on `status` `failed`, and not on every one of those: a message can fail for a reason outside the published vocabulary and carry no `failure` at all. Its absence means "no published reason", never "no reason". Most messages the channel refused do carry one: a specific code where one is published, and `channel_refused` for most of the rest; a few kinds of refusal still carry none. `status` stays the thing to branch on. This is additive detail beside it, so an integration written before this field existed still sees a terminal `failed` and behaves exactly as it did. - `code: string` The specific reason. `sender_deregistered` — the number this message was going out from is no longer a registered sending number, and the message never left. This is terminal: it is not a pause and it does not clear, so retrying the same message cannot succeed and that conversation is over. Reach this customer by starting a new one on another of your numbers with a template, exactly as you would any customer whose 24-hour window has closed; `GET /v1/chats` shows which number each conversation uses. You are not billed for a message that failed this way. `quality_hold_expired` — this marketing message remained held by an automatic safety control on its sending line for ten minutes and was not sent. This is terminal: retrying the same message cannot succeed on that conversation. Send marketing from another of your numbers with a template, or contact support about the sending line. You are not billed for a message that failed this way. `target_message_failed` — the message this one quotes or reacts to failed, or its outcome could not be established, before this message went out. This message was therefore never sent, because a quote is never sent without its context. A `message.failed` event reports it. This is terminal: send it again as a new message, without that target or naming one that was sent. You are not billed a channel charge for it, though it still counts toward your platform subscription's message volume. `recipient_country_restricted` — the business behind the sending number is not currently permitted to message customers in this recipient's country, so the message was not delivered. The restriction blocks every message type, including replies inside the customer's 24-hour window. This is terminal for the message: sending it again cannot succeed while the restriction stands. Most countries unlock only when the business has completed business verification and has held an assigned messaging tier of 2,000 or higher for 30 consecutive days. The assigned tier is what counts, not how many messages you send. Brazil and Indonesia also require the business's primary business location to be in that country, at any tier: a business located elsewhere cannot message customers there. Until the business qualifies, sends to that country will keep failing. The channel publishes no list of restricted country pairs and offers no API signal before a send. If the business meets these conditions and the restriction stands, review the messaging policy for the business's category. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `payment_method_required` — the business behind the sending number has no working payment method on its messaging account, so this message was not sent. This is terminal for the message: retrying it cannot succeed until a payment method is added. Add or update the payment method in the messaging account's billing settings, then send again as a new message. Replies inside an open 24-hour customer window are charged too once the sending number's monthly free allowance of them is used up, so they also need a working payment method and can fail this way. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `recipient_phone_number_required` — this customer is known only by a username identifier, not a phone number, and this message can be delivered only to a phone number, so it was not sent. This is terminal for the message: sending it again to this customer cannot succeed. One-time-code templates (copy code, one-tap or zero-tap autofill) are the usual cause; deliver the code another way. Other messages, including templates without a one-time-code button, can still be sent to this customer. When the template is known in advance to carry a one-time-code button, the send is refused at once with the error `recipient_phone_number_required` instead and nothing is accepted. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `business_restricted` — this message was refused because the business behind the sending number is most likely restricted on its messaging account, so it was not sent. This is terminal for the message: sending it again will not succeed while the restriction stands. Review the status of the business's messaging account, and if the business believes it complies with the messaging policies, request a review of the restriction. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `channel_refused` — this message was refused upstream and was not sent, for a reason that has no more specific code here, and it will not be retried automatically. Contact support with this message's `id` to learn the reason and whether sending it again can succeed. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. A more specific code may be published for some of these refusals in a later release; treat a code you do not recognise exactly as you treat this one. - `message: string` Human-readable, written for a person reading it. Do not branch on it. - `from: optional string` The number this message left by, or arrived on, in E.164 (leading `+`). Every message in one conversation carries the same value — a conversation never moves to another number. Absent only if the number is no longer one of yours. - `from_selection: optional object { reason }` Present only when this service chose the sending number for you — that is, when you omitted `from`. A send that named `from` omits this rather than reporting a choice nobody made. - `reason: string` Why this number was used. Exactly one of: - `reused_active_chat` — this customer already had a conversation and it continues on the same number. - `new_best_number` — there was no existing conversation, so the best available number was chosen. Like every other vocabulary here it is a plain string that may grow additively; treat a value you do not recognise as "chosen for you". - `reply_to_message_id: optional string` This API's `id` of the earlier message in this chat that this message replies to. On an inbound message it is the message the customer quoted; on an outbound message it is the `reply_to_message_id` you sent. Look the value up in this chat's transcript to show what was answered; it is the same namespace as `id`, never a channel identifier. Absent when there is no reply context this API can resolve — a message that quotes nothing, or one that quotes a message this API never recorded in this chat. Treat absence as "no reply context available", not as proof the message was not a reply. - `zero_retention: optional true` True when the message is under zero-day retention: its content is not kept, so later reads and idempotent retries return empty `parts`. The original send response still carries the content. Retention applies only within Linq's systems. The WhatsApp channel operator's own processing and retention of message content are governed by its terms and are not affected by this setting. - `true` ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/chats/$CHAT/messages \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" \ -d '{ "parts": [ { "body": "body", "type": "text" } ] }' ``` #### Response ```json { "id": "id", "chat_id": "chat_id", "created_at": "2019-12-27T18:11:19.117Z", "direction": "inbound", "parts": [ { "body": "body", "type": "text", "preview_url": true } ], "status": "status", "channel_message_id": "channel_message_id", "failure": { "code": "code", "message": "message" }, "from": "from", "from_selection": { "reason": "reason" }, "reply_to_message_id": "reply_to_message_id", "zero_retention": true } ``` --- # List chats URL: https://docs.linqapp.com/channel/whatsapp/api/resources/chats/methods/list/ **get** `/v1/chats` Lists the brand's chats, most recently active first. A chat moves to the front when its latest event is applied. The page is a keyset, not an offset: pass the previous page's `next_cursor` back verbatim. A cursor this API did not issue — including an empty one — is refused rather than treated as the beginning, so a paging loop cannot silently restart. **A walk of this list is not a snapshot, and the gap is one-directional.** The order is activity and activity only ever moves a chat toward the front, so a chat that receives a message while you are paging jumps ABOVE your cursor and is not returned again: on a busy account, a full walk silently omits the conversations that were active during it. It never returns one twice. That is a property of ordering by activity, so plan around it rather than against it: the chats you missed are exactly the chats that just had traffic, which `GET /v1/streams/events` announces as it happens and `GET /v1/chats/{chat}/events` reads back in full. Reconcile with those two, not by walking the list again. Within one chat the transcript's order is the journal's own immutable sequence and never moves; when ephemeral messages are enabled, expired messages and their related events are omitted and their `seq` positions remain as visible gaps. ### Query Parameters - `cursor: optional string` Cursor from a previous page's `next_cursor`. - `limit: optional number` Page size. The bounds are in this parameter's schema, not only in this sentence — a value outside them is refused, never clamped. ### Returns - `ChatPage object { data, has_more, next_cursor }` A page of chats. - `data: array of Chat` - `id: string` The chat's id. - `created_at: string` - `customer: string` Customer address as an opaque identifier. - `customer_window: object { expires_at, state, source }` The customer service window — first-class state on every chat read. Only `template` parts are sendable while it is closed. - `expires_at: string` When the open window expires. `null` when no window has ever opened. - `state: string` `open` or `closed`. - `source: optional string` What opened the current window: `customer_message`, or `free_entry_point` for ad-sourced windows. Absent when no window has ever opened. - `phone_number_id: string` The id of the sending number this chat is pinned to. - `updated_at: string` When the chat last changed — a new event moves it. - `customer_kind: optional string` The form of `customer`: `phone_number` or `username_identifier`. Branch on this rather than on the value's shape. Values may grow, so treat anything else as an address you can reply to but cannot read as a number. Absent for an address of neither form. - `from: optional string` The number this conversation sends from, in E.164 (leading `+`). This is the value to pass back as a send's `from` to address this exact conversation. Absent only if the number is no longer one of yours. - `has_more: boolean` True when another page exists — pass `next_cursor` to fetch it. - `next_cursor: optional string` Opaque cursor for the next page; present when `has_more` is true. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/chats \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` #### Response ```json { "data": [ { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "customer": "customer", "customer_window": { "expires_at": "2019-12-27T18:11:19.117Z", "state": "state", "source": "source" }, "phone_number_id": "phone_number_id", "updated_at": "2019-12-27T18:11:19.117Z", "customer_kind": "customer_kind", "from": "from" } ], "has_more": true, "next_cursor": "next_cursor" } ``` --- # Mark a chat read URL: https://docs.linqapp.com/channel/whatsapp/api/resources/chats/methods/mark_read/ **post** `/v1/chats/{chat}/read` Marks one unread inbound message as read, optionally showing the typing indicator. That message is the latest unread inbound one that can be marked read. An unread message of a type this API does not support (its only part is `unsupported`) cannot be marked read and is never the target; it is skipped in favour of a supported unread message, and the `chat.read` event names the message actually targeted. The upstream command targets that one message; this API does not promise that the channel also marks earlier inbound messages, and an unsupported one is known not to be marked. Omit the body, or send `{}`, for read-only; the two forms are identical. `typing: false` is identical too. If the chat is not available to this account, the request is refused with `404 chat_not_found`. If it has no unread inbound message, it is refused with `409 nothing_unread`; if it has unread inbound messages but every one is unsupported, it is refused with `409 nothing_readable`. This route does not act as a standalone typing refresh. `202` means the command and its `chat.read` journal event are durable; the upstream action is asynchronous. Read receipts and typing are outbound-only: this API never reports customer typing. Within one chat, order follows acceptance, and acceptance is this API's `202`: calls made concurrently can be accepted in either order, so wait for a send's `202` before calling this route if the read should follow it. This command is handed to the channel after the sends accepted before it. The wait ends when no earlier send is still on its way to the channel or awaiting an outcome, and lasts about 5 seconds from this command's acceptance: past that, for example behind a send whose outcome is still unknown, the command goes anyway. A send paused by a safety stop does not hold it beyond that wait. If the order cannot be checked, the command goes without waiting. This command does not wait for sends accepted after it, and one of those can reach the channel first. The read still goes; the typing indicator is omitted when a later send exists at hand-over, when the order could not be checked, or when the command is 25 seconds old or older. This is the order of handing to the channel, not a promise of the order the customer's device shows. ### Path Parameters - `chat: string` ### Body Parameters - `typing: optional boolean` Also show the customer the typing indicator, which auto-dismisses after a short time or when your next message arrives. Read receipts and typing are outbound-only: the API never reports customer typing. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/chats/$CHAT/read \ -X POST \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` --- # Get a chat URL: https://docs.linqapp.com/channel/whatsapp/api/resources/chats/methods/retrieve/ **get** `/v1/chats/{chat}` Reads one chat, including its live customer-window state. A chat id that is not this key's answers `404` — the same answer an id that does not exist gets, because a response must never confirm one across accounts. ### Path Parameters - `chat: string` ### Returns - `Chat object { id, created_at, customer, 5 more }` One customer conversation. - `id: string` The chat's id. - `created_at: string` - `customer: string` Customer address as an opaque identifier. - `customer_window: object { expires_at, state, source }` The customer service window — first-class state on every chat read. Only `template` parts are sendable while it is closed. - `expires_at: string` When the open window expires. `null` when no window has ever opened. - `state: string` `open` or `closed`. - `source: optional string` What opened the current window: `customer_message`, or `free_entry_point` for ad-sourced windows. Absent when no window has ever opened. - `phone_number_id: string` The id of the sending number this chat is pinned to. - `updated_at: string` When the chat last changed — a new event moves it. - `customer_kind: optional string` The form of `customer`: `phone_number` or `username_identifier`. Branch on this rather than on the value's shape. Values may grow, so treat anything else as an address you can reply to but cannot read as a number. Absent for an address of neither form. - `from: optional string` The number this conversation sends from, in E.164 (leading `+`). This is the value to pass back as a send's `from` to address this exact conversation. Absent only if the number is no longer one of yours. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/chats/$CHAT \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` #### Response ```json { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "customer": "customer", "customer_window": { "expires_at": "2019-12-27T18:11:19.117Z", "state": "state", "source": "source" }, "phone_number_id": "phone_number_id", "updated_at": "2019-12-27T18:11:19.117Z", "customer_kind": "customer_kind", "from": "from" } ``` --- # Events URL: https://docs.linqapp.com/channel/whatsapp/api/resources/chats/subresources/events/ ## List a chat's events **get** `/v1/chats/{chat}/events` Reads a chat's event sequence in order — the transcript API. Stored positions are assigned contiguously from `seq` 1 and never renumbered. When ephemeral messages are enabled, an expired message and its related events are omitted from this read, so returned `seq` values have gaps where those events were. **`order` chooses which end a bare request starts from.** It defaults to `asc`, which starts at the OLDEST event and pages forward — identical to every release before this one, so a request that does not send `order` is unchanged. `order=desc` starts at the NEWEST event and pages backward, newest entry first, which is what an inbox wants: the latest activity is the first page rather than the last. This is the BACKFILL for `GET /v1/streams/events`, which is a live stream and replays nothing: an event that passed while you were not connected is re-read here, addressed by the `chat_id` and `seq` range every stream frame carries. **The cursor is the `seq` of the last entry you processed**, in either direction, and it is exclusive — pass `next_cursor` back verbatim, or the `seq` you stopped at, and the next page continues from there. Under `asc` that means the entries ABOVE it and `next_cursor` is the page's highest `seq`; under `desc` it means the entries BELOW it and `next_cursor` is the page's lowest. The direction is not carried in the cursor, so send `order` on every request of a walk: the same cursor with the other `order` reads the other way rather than being refused. Paging never skips a visible event: the next page resumes after the last returned position and any expired ephemeral positions intentionally read past. A visible lookahead row withheld by the page limit remains for the next page. An event journaled between two requests is returned rather than stepped over. A backward walk is not disturbed by events journaled while it runs — they take positions above where it started, so they are neither repeated nor mistaken for a retention gap. **Being caught up and being lost are different answers.** A cursor at the end you are paging TOWARD returns an empty page — the chat's newest `seq` under `asc`, `seq` `1` under `desc` — and that is the ordinary polling result. A cursor BEYOND that end is refused with `422` (`invalid_paging`), because no such position has ever existed in this chat and answering it with silence would be indistinguishable from having caught up. Each direction has its own beyond-the-end: a cursor above the chat's newest `seq` is refused whichever `order` you asked for, and `0` — the position below the first, which is `1` — is refused under `desc`, where nothing lies below it. Either refusal names where the sequence actually ends, so a client that has drifted can resume. An empty cursor is refused the same way in both directions: omit the parameter to start at whichever end `order` selects. **Retention.** This journal has no scheduled pruning, so ordinary operation does not remove an old prefix or renumber its immutable sequence. That is not a permanent-retention promise or a fixed minimum availability period: authenticated account deletion, offboarding, or a lawful deletion requirement may remove the account-scoped transcript. This operation therefore has no `expires_at`, retained-floor field, or scheduled `cursor_expired` response. If prefix pruning is introduced later, its additive retained floor and typed expiry behavior will be published before any history is removed. ### Path Parameters - `chat: string` ### Query Parameters - `cursor: optional string` Cursor from a previous page's `next_cursor`, read in the direction `order` selects. Exclusive: the page starts after it under `asc`, before it under `desc`. - `limit: optional number` Page size. The bounds are in this parameter's schema, not only in this sentence — a value outside them is refused, never clamped. - `order: optional "asc" or "desc"` Which end a request with no cursor starts from, and which way a cursor is read: `asc` from the oldest event forward, `desc` from the newest event backward. Any other value is refused, never coerced. - `"asc"` - `"desc"` ### Returns - `ChatEventPage object { data, has_more, next_cursor }` A page of one chat's events, in the `seq` order the read asked for — ascending by default, descending under `order=desc`. - `data: array of ChatEvent` - `occurred_at: string` - `seq: number` The event's position in this chat's stored sequence. Positions are assigned contiguously from 1 and never renumbered. When ephemeral messages are enabled, reads omit an expired message and its related events, so the `seq` values returned to that account have gaps where those events were. Use this as the chat's events-read cursor. It is scoped to one chat, so it is NOT the `/v1/streams/events` stream cursor: that stream spans every chat and carries its own cursor in each frame's `id`. - `type: string` The event's kind, e.g. `message.received`, `message.sent`. Kinds grow additively — skip what you do not handle. `chat.event.unknown` is the one kind that never carries meaning: it marks a journal entry whose partner-visible kind is not published yet. It preserves that stored position instead of hiding an unpublished kind. Expired ephemeral messages are different: retention omits their related events from reads, leaving visible gaps in `seq`. Skip this kind. - `message: optional Message` The message this event is about, on message-kind events. - `id: string` This API's message id. Put this value in an outbound reaction's `message_id`; an inbound reaction to this message carries the same value in its `message_id`, so this is the one identifier you need to keep. Mark-as-read targets the latest unread inbound message in a chat, so it takes the chat id. - `chat_id: string` The chat this message belongs to. - `created_at: string` - `direction: "inbound" or "outbound"` `inbound` (from the customer) or `outbound` (sent by you). - `"inbound"` - `"outbound"` - `parts: array of object { body, type, preview_url } or object { kind, type, availability, 10 more } or object { language, name, type, 4 more } or 17 more` The message content — sendable parts, plus the inbound-only types on inbound messages. Empty only when `zero_retention` is true, or when an idempotent retry returns an ephemeral message whose content retention cleanup has removed. - `Text object { body, type, preview_url }` A plain text message. - `body: string` The message text. URLs render as tappable links. - `type: "text"` - `"text"` - `preview_url: optional boolean` Render a preview card for the first URL in body. Defaults to false. - `Media object { kind, type, availability, 10 more }` A media message — image, video, audio, document, or sticker. The two identifiers are distinct namespaces: inbound media carries the channel's transient media_id; outbound media carries our durable upload_ref from POST /v1/media. - `kind: "image" or "video" or "audio" or 2 more` Which kind of media this is. Captions apply to image, video and document only; filename applies to document only. - `"image"` - `"video"` - `"audio"` - `"document"` - `"sticker"` - `type: "media"` - `"media"` - `availability: optional "available" or "unavailable" or "pending"` Response only, inbound parts only: whether the download answers the bytes. available: the file was captured and is retained. unavailable: it is not downloadable now, and unavailable_reason says why; with timed_out the download answers 409 while capture continues and can later answer 200, otherwise it answers 410, or 404 once the file is no longer known. It describes the file, not the exact HTTP answer of a later download, which can also refuse for capacity or authorization. pending: capture has not finished yet; only reads of the conversation return pending, and a message event never does. A message.received event is recorded once every attachment has been captured or has failed, or ten minutes after the message arrived, whichever comes first; an event part without availability is from a historical event and may still be capturing, so retry its download as the 409 Retry-After directs. A message event keeps the value it was recorded with; reads return the current one. Historical messages received before it was recorded omit it. Never accepted on sends. - `"available"` - `"unavailable"` - `"pending"` - `byte_size: optional number` Response only, inbound parts only: the exact size in bytes of the retained attachment, equal to the download's Content-Length. Present only while the bytes are captured and retained — the same lifetime as a working url, ending 30 days after server receipt — so it can be absent from a message event while capture has not completed, and its absence is not final; once present it never changes. Absent rather than zero. Never accepted on sends. - `caption: optional string` Caption rendered with the media. Image, video and document only — a caption on an audio or sticker part is rejected, never dropped. - `filename: optional string` Display filename. Documents only — a filename on any other kind is rejected, never dropped. - `media_id: optional string` Inbound only: the channel's transient media identifier. It expires after seven days and is never an outbound address; an outbound value is rejected with a pointer to media_id and upload_ref as the remedy. - `mime_type: optional string` Response only, inbound parts only: the media type the channel declared when the message arrived, verbatim. It may carry parameters (for example audio/ogg; codecs=opus) and may differ from the Content-Type the download answers with, which describes the retained bytes. Present on the webhook body and on every later read with the same value. Historical messages received before it was recorded omit this field. Never accepted on sends. - `source_url: optional string` Outbound only: a public https URL of the bytes to send, as an alternative to upload_ref. Supply exactly one of upload_ref or source_url. The address is fetched once, before the send is accepted, and its exact bytes are stored as an ordinary upload in this account and key partition; the accepted message and every later read carry that upload's upload_ref, never the address, and no retry fetches it again. The URL must be absolute https on the default port with no credentials and no fragment, must resolve to a public address (every redirect hop included, at most three), and must answer with the complete bytes and their exact media type within the fetch deadline. The bytes are then held to the same media type and size rules as POST /v1/media for the part's kind; a mismatch is refused, never converted. - `unavailable_reason: optional string` Response only, present only when availability is unavailable. An open string: the values today are timed_out, capture_failed and expired, and new values may be added. timed_out: the file was still being retrieved ten minutes after the message arrived, so its message event was recorded without it; retrieval continues and the file may become downloadable later, which reads of the conversation report. capture_failed: the file could not be retrieved. expired: the file was retrieved and is no longer retained, or is no longer known (the download then answers 410 or 404). Treat an unknown value as capture_failed. Never accepted on sends. - `upload_ref: optional string` Outbound only: our durable handle returned by POST /v1/media. Handles visibly begin upload. and are reusable within the account and key partition that created them. - `url: optional string` Response only: stable attachment download URL requiring the account Bearer key on every request. Pending capture returns 409 with Retry-After; retained bytes expire 30 days after server receipt. Historical unbound messages omit this field. Never accepted on sends. - `voice: optional boolean` Audio only. On a send it is optional: true sends the audio as a voice note; false, or leaving it out, sends it as an ordinary audio file. A voice note needs an upload stored as audio/ogg that holds mono Opus audio, sent by upload_ref or source_url within the existing audio size limit. The bytes are sent as supplied: they are never converted or inspected, so encode them as mono Opus before uploading. The recipient sees a play button only when the voice file is 512 KB or smaller; a larger voice note is still delivered but must be downloaded before it plays. On incoming audio parts it is response-only: whether the channel reported the audio as a voice note, verbatim. true means it was recorded with the messaging client's voice-recording feature; false means it was sent as an audio file. Present on the webhook body and on every later read with the same value. Absent on an incoming part means the channel did not say, never that the audio is not a voice note. Other kinds never carry it, and historical messages received before it was recorded omit it. - `Template object { language, name, type, 4 more }` An approved message template — the one part type sendable outside an open customer service window. name and language identify the approved template; parameters fills its named placeholders. Authentication templates use this same generic part: their published parameter schema names exactly one parameter, `code` — the one-time code you generate, 1–15 characters — and the message shows it in its body and behind its code button. Every sendable template is registered and approved ahead of the send and publishes its own parameter schema — a send referencing an unknown template, a missing or unknown parameter, or a value that breaks the template's rules is rejected with a 422 naming the exact field. - `language: string` The template's language-and-locale code, e.g. en_US. - `name: string` The approved template's name. Lowercase letters, digits and underscores only. - `type: "template"` - `"template"` - `buttons: optional array of object { index, payload, type }` Send-time values for this approved template's own dynamic buttons, in ascending index order: a url button whose destination ends in {{1}} takes the value appended there and is REQUIRED; a quick_reply button takes the payload returned to you when it is tapped and is OPTIONAL — omit it and the button returns its label. Fixed buttons have no slot. The approved template's send_schema lists the (index, type) slots and an x-rule stating which are required; omit buttons entirely for a template with no url slot when the labels are what you want back. - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `cards: optional array of object { card_index, kind, upload_ref, 2 more }` Per-card values for an approved media-card carousel. The approved template's send_schema provides structural bounds and an x-rule listing the exact card order, media kind, named body values, and dynamic button slots enforced by runtime L2 validation. Omit for non-carousel templates. - `card_index: number` - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: string` A durable handle returned by POST /v1/media. It is resolved within this key's account and partition, then consumed into a transient channel media identifier only at delivery. - `buttons: optional array of object { index, payload, type }` - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `parameters: optional unknown` Named values for this card's body placeholders. - `header: optional object { kind, upload_ref }` The uploaded media used for this approved template's media header. Omit unless this template's send_schema requires it. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `parameters: optional unknown` Named values for the template's placeholders. The shape is per-template: each registered template publishes its own parameter schema — hand THAT schema to your model when composing a specific template. Omit for templates with no placeholders. - `InteractiveList object { body, button, sections, 3 more }` An interactive list message: body text plus a button that opens a sectioned list of selectable rows. The customer's selection arrives as an inbound interactive_reply part with kind list_reply, carrying the chosen row's id. - `body: string` The message body. - `button: string` Label of the button that opens the list. - `sections: array of object { rows, title }` The list's sections, each holding selectable rows. At most 10 rows in total across ALL sections combined — not 10 per section. - `rows: array of object { id, title, description }` This section's rows. The 10-row limit is on the TOTAL across all sections, so a second section reduces what this one may hold. - `id: string` Your identifier for the row — echoed back as the interactive_reply's id. - `title: string` The row's visible title. - `description: optional string` Secondary text under the title. - `title: optional string` Section title. Required when the list has more than one section. - `type: "interactive_list"` - `"interactive_list"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `InteractiveButtons object { body, buttons, type, 3 more }` An interactive reply-buttons message: body text plus up to three tappable buttons. The customer's tap arrives as an inbound interactive_reply part with kind button_reply, carrying the tapped button's id. - `body: string` The message body. - `buttons: array of object { id, title }` The tappable buttons — at most three. - `id: string` Your identifier for the button — echoed back as the interactive_reply's id. - `title: string` The button's visible label. - `type: "interactive_buttons"` - `"interactive_buttons"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `InteractiveCtaURL object { body, display_text, type, 4 more }` An interactive call-to-action message: body text plus one button that opens a URL. - `body: string` The message body. - `display_text: string` The button's visible label. - `type: "interactive_cta_url"` - `"interactive_cta_url"` - `url: string` The URL the button opens. Must be absolute, with an http or https scheme. - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref, filename }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `filename: optional string` The file name the customer sees on a document header. Documents only. - `InteractiveCarousel object { body, cards, type }` An interactive carousel: one message whose body sits above 2 to 10 horizontally scrolling cards. Each card shows an uploaded image, or a video from a public link, and either one button that opens a URL or reply buttons. A tap on a card's reply button arrives as an inbound template_reply part whose payload is that button's id; nothing else in the reply identifies the card, so the id you choose is the card's identity. - `body: string` The message text shown above the cards. - `cards: array of object { card_index, header, body, 2 more }` The cards, left to right. - `card_index: number` This card's zero-based position: the first card is 0, the next 1, and so on, in array order. - `header: object { kind, upload_ref, url }` The card's media: an image named by upload_ref, or a video named by the public https url it plays from. Every card carries the same kind. - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: optional string` A durable handle returned by POST /v1/media for an image upload. Image cards only. - `url: optional string` The public https address the card's video plays from. Video cards only. It is sent exactly as written and never fetched by this API, so it must be publicly reachable and serve a playable video; a link that does not play is accepted and then reported as a failed delivery (message.failed with channel_refused). - `body: optional string` Optional text below the card's image or video, with at most two line breaks. - `reply_buttons: optional array of object { id, title }` Buttons the customer taps to reply. Use either url_button or reply_buttons on every card. - `id: string` Your identifier for the button, echoed back as the template_reply's payload. Unique across the whole carousel. - `title: string` The button's visible label. - `url_button: optional object { display_text, url }` One button that opens a URL. Use either url_button or reply_buttons on every card. - `display_text: string` The button's visible label. - `url: string` The absolute https URL the button opens. - `type: "interactive_carousel"` - `"interactive_carousel"` - `LocationRequest object { body, type }` Asks the customer to share a location. The response arrives as a location part. - `body: string` Prompt shown above the send-location button. - `type: "location_request"` - `"location_request"` - `ContactRequest object { body, type }` Asks the customer to share their own contact card with one tap. Useful when you know the customer only by a username identifier and need a phone number. The answer arrives as an ordinary contacts part whose card carries origin contact_request; a card the customer shares by hand carries origin other instead. The answer is not linked to your request as a reply: its message carries no reply_to_message_id, so match it by origin and timing. Sendable inside the customer window. - `body: string` Prompt shown above the share-contact button. - `type: "contact_request"` - `"contact_request"` - `AddressRequest object { body, country, type }` Reserved for asking an eligible customer in India to submit a structured address. Sending this part is not available until business and customer eligibility can be verified at acceptance. Address responses already arrive as address_reply parts. - `body: string` Prompt shown above the address form. - `country: "IN"` ISO country code. Structured address requests are currently available only in India. - `"IN"` - `type: "address_request"` - `"address_request"` - `Contacts object { contacts, type }` One or more contact cards. - `contacts: array of object { name, addresses, birthday, 5 more }` The contact cards to send. The channel permits far more; this API caps a message at five, because a message carrying hundreds of cards is a mistake rather than a use case. - `name: object { formatted_name, first_name, last_name, 3 more }` - `formatted_name: string` The contact's full display name. - `first_name: optional string` - `last_name: optional string` - `middle_name: optional string` - `prefix: optional string` - `suffix: optional string` - `addresses: optional array of object { city, country, country_code, 4 more }` - `city: optional string` - `country: optional string` - `country_code: optional string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `state: optional string` - `street: optional string` - `zip: optional string` - `birthday: optional string` The contact's birthday as YYYY-MM-DD. - `emails: optional array of object { email, kind }` - `email: string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `org: optional object { company, department, title }` - `company: optional string` - `department: optional string` - `title: optional string` - `origin: optional string` Response-only: how the customer came to share this card, as the channel reported it, verbatim. contact_request means they tapped the share button on a contact_request you sent; other means they shared a card themselves. New values may appear, so treat any other value as unrecognised rather than as either of these. Absent when the channel did not say, and on cards received before it was recorded. A send carrying it is rejected with a pointer at the member. - `phones: optional array of object { phone, kind, messaging_id }` - `phone: string` The phone number, ideally in +E.164 form. - `kind: optional string` A label for the number, e.g. CELL, MAIN, WORK, HOME. - `messaging_id: optional string` The contact's messaging-account identifier on this channel, when known — makes the card openable in the messaging app. - `urls: optional array of object { url, kind }` - `url: string` - `kind: optional string` A label for the URL, e.g. WORK, HOME. - `type: "contacts"` - `"contacts"` - `Location object { latitude, longitude, type, 2 more }` A location pin. - `latitude: number` Latitude in decimal degrees. - `longitude: number` Longitude in decimal degrees. - `type: "location"` - `"location"` - `address: optional string` The place's address, shown under the name. - `name: optional string` The place's name, shown on the pin. - `Reaction object { emoji, type, channel_message_id, message_id }` An emoji reaction to an earlier message in the chat. message_id is this API's Message.id for the target in both directions: it is what you send, and it is appended to an inbound reaction whenever the target is a message of the same chat. channel_message_id is the channel's opaque identifier and appears on inbound reactions only. - `emoji: string` A single emoji. Send an empty string to remove a previous reaction to the same message. - `type: "reaction"` - `"reaction"` - `channel_message_id: optional string` Inbound only: the channel's opaque identifier for the message being reacted to. Always present on an inbound reaction, beside message_id whenever the target resolved. Match it literally to Message.channel_message_id in the chat transcript; never parse it or compare it with Message.id. - `message_id: optional string` This API's Message.id for the message being reacted to. Outbound: required, and the API resolves it into the channel namespace before sending, so the message must be one this account can see in the chat the send addresses. Inbound: present whenever the target is a message of the same chat, so you can keep only this identifier; absent when the chat does not hold the target. - `InteractiveReply object { id, kind, title, 2 more }` Inbound only — never sendable. The customer's selection from an interactive_list (kind list_reply) or interactive_buttons (kind button_reply) message, carrying the id you assigned to the chosen row or button. - `id: string` The id you assigned to the chosen row or button, exactly as you sent it. - `kind: "list_reply" or "button_reply"` Which interactive message kind was answered. - `"list_reply"` - `"button_reply"` - `title: string` The chosen row's or button's visible title. - `type: "interactive_reply"` - `"interactive_reply"` - `description: optional string` The chosen list row's secondary text, when it had one. - `TemplateReply object { payload, text, type }` Inbound only — never sendable. The customer tapped a quick-reply button on an approved template you sent, or a reply button on a card of an interactive_carousel you sent. payload is the value you set on that button: the template's quick_reply slot payload (or the button's label when you left the slot out), or the carousel card button's id. text is the label the customer saw. A carousel tap carries nothing else that identifies the card, so the id you chose is the card's only identity. For a template tap, the message's reply_to_message_id names the template message that carried the button. Distinct from interactive_reply, which answers an interactive_buttons or interactive_list message. - `payload: string` The quick_reply slot's payload from your send, or the button label when the slot was omitted; for a carousel card, the tapped reply button's id. - `text: string` The tapped button's label, as the customer saw it. - `type: "template_reply"` - `"template_reply"` - `AddressReply object { type, values, saved_address_id }` Inbound only: the structured values submitted in response to an address request. - `type: "address_reply"` - `"address_reply"` - `values: object { address, building_name, city, 8 more }` - `address: optional string` - `building_name: optional string` - `city: optional string` - `floor_number: optional string` - `house_number: optional string` - `landmark_area: optional string` - `name: optional string` - `phone_number: optional string` - `pin_code: optional string` - `state: optional string` - `tower_number: optional string` - `saved_address_id: optional string` Identifier of the selected saved address, when one was selected. - `Order object { catalog_id, items, type, text }` Inbound only — never sendable. An order the customer placed from a product catalog. - `catalog_id: string` The catalog the ordered items belong to. - `items: array of object { currency, price, product_retailer_id, quantity }` The ordered items. - `currency: string` ISO 4217 currency code for price. - `price: number` The per-item price at order time. - `product_retailer_id: string` Your identifier for the product, as registered in the catalog. - `quantity: number` - `type: "order"` - `"order"` - `text: optional string` Free text the customer attached to the order, when any. - `Referral object { type, body, click_id, 7 more }` Inbound only — never sendable. The ad or post context a customer's first message arrived from (for example an ad whose call to action opens a chat). A referral also opens a free-entry-point customer window — see the chat's customer_window. - `type: "referral"` - `"referral"` - `body: optional string` The ad's body text at click time. - `click_id: optional string` The click identifier assigned by the ad platform, for attribution. - `headline: optional string` The ad's headline at click time. - `image_url: optional string` URL of the ad's image creative, when media_kind is image. - `media_kind: optional string` The ad creative's media kind, e.g. image or video. - `source_id: optional string` The ad or post id. - `source_kind: optional string` What the source was, e.g. ad or post. - `source_url: optional string` The URL of the ad or post the customer came from. - `video_url: optional string` URL of the ad's video creative, when media_kind is video. - `System object { body, type, event }` Inbound only — never sendable. A system event in the chat, such as the customer changing their number. New event kinds appear over time; body is always present and human-readable. - `body: string` Human-readable description of the system event. - `type: "system"` - `"system"` - `event: optional string` The system event's kind, when the channel identifies one. New kinds appear over time — treat unknown values as informational. - `Unsupported object { raw, type, kind }` Inbound only — never sendable. A message kind this API does not yet type natively, carried as a typed passthrough: raw holds the channel payload, so a new message kind is never a black box or a silent drop. Native part types for popular kinds are added over time; this part is the compatibility guarantee in the meantime. - `raw: unknown` The channel payload — any JSON value: object, array, string, number, boolean, or null. Deliberately unconstrained, because the whole point of this part is to carry a shape this API does not yet know. For rows written by API version 1.3.0 or later, object member order, number formatting and duplicated members survive storage and read-back. The canonical encoder may compact insignificant whitespace before storage. Rows written before API version 1.3.0 retain normalized JSON only: member order and number formatting may differ, and only the last duplicated member survives. - `type: "unsupported"` - `"unsupported"` - `kind: optional string` The channel's name for the message kind, when it declares one. - `status: string` The message's delivery state as last reported. Inbound messages read `received`: they arrived, and no delivery of ours ran. A message you sent starts `accepted` and moves through `sent`, `delivered` and `read` as the channel reports them, with `failed` as the definitive negative outcome. `unknown` means exactly that: the send is INDETERMINATE and we decline to guess. It is NOT terminal — an indeterminate send is never re-sent, and it resolves to `sent`, `delivered`, `read` or `failed` when the channel's own report arrives — so keep observing rather than treating it as an outcome. States are reported asynchronously on the chat's event sequence, and the set grows additively: treat a value you do not recognise as "no information" rather than failing on it. Retention of this published status follows the chat transcript policy: there is no scheduled pruning, but no fixed minimum availability period is published yet. The present absence of a scheduled age-based sweep is not a promise of indefinite availability. `delivered` is reported by the channel after it accepted the message and can lag by hours, never arrive at all, or be followed by a failure, so do not build timeouts around it arriving promptly. - `channel_message_id: optional string` The channel's opaque identifier for this message, when the channel has assigned one. An inbound reaction's `channel_message_id` matches this field literally; never parse it or compare it with `id`. It is absent while an accepted outbound message has not yet received a channel identifier, and until it is present an inbound reaction to this message carries only `channel_message_id`. - `failure: optional object { code, message }` Why a failed message failed, when we have a reason worth publishing. Present only on `status` `failed`, and not on every one of those: a message can fail for a reason outside the published vocabulary and carry no `failure` at all. Its absence means "no published reason", never "no reason". Most messages the channel refused do carry one: a specific code where one is published, and `channel_refused` for most of the rest; a few kinds of refusal still carry none. `status` stays the thing to branch on. This is additive detail beside it, so an integration written before this field existed still sees a terminal `failed` and behaves exactly as it did. - `code: string` The specific reason. `sender_deregistered` — the number this message was going out from is no longer a registered sending number, and the message never left. This is terminal: it is not a pause and it does not clear, so retrying the same message cannot succeed and that conversation is over. Reach this customer by starting a new one on another of your numbers with a template, exactly as you would any customer whose 24-hour window has closed; `GET /v1/chats` shows which number each conversation uses. You are not billed for a message that failed this way. `quality_hold_expired` — this marketing message remained held by an automatic safety control on its sending line for ten minutes and was not sent. This is terminal: retrying the same message cannot succeed on that conversation. Send marketing from another of your numbers with a template, or contact support about the sending line. You are not billed for a message that failed this way. `target_message_failed` — the message this one quotes or reacts to failed, or its outcome could not be established, before this message went out. This message was therefore never sent, because a quote is never sent without its context. A `message.failed` event reports it. This is terminal: send it again as a new message, without that target or naming one that was sent. You are not billed a channel charge for it, though it still counts toward your platform subscription's message volume. `recipient_country_restricted` — the business behind the sending number is not currently permitted to message customers in this recipient's country, so the message was not delivered. The restriction blocks every message type, including replies inside the customer's 24-hour window. This is terminal for the message: sending it again cannot succeed while the restriction stands. Most countries unlock only when the business has completed business verification and has held an assigned messaging tier of 2,000 or higher for 30 consecutive days. The assigned tier is what counts, not how many messages you send. Brazil and Indonesia also require the business's primary business location to be in that country, at any tier: a business located elsewhere cannot message customers there. Until the business qualifies, sends to that country will keep failing. The channel publishes no list of restricted country pairs and offers no API signal before a send. If the business meets these conditions and the restriction stands, review the messaging policy for the business's category. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `payment_method_required` — the business behind the sending number has no working payment method on its messaging account, so this message was not sent. This is terminal for the message: retrying it cannot succeed until a payment method is added. Add or update the payment method in the messaging account's billing settings, then send again as a new message. Replies inside an open 24-hour customer window are charged too once the sending number's monthly free allowance of them is used up, so they also need a working payment method and can fail this way. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `recipient_phone_number_required` — this customer is known only by a username identifier, not a phone number, and this message can be delivered only to a phone number, so it was not sent. This is terminal for the message: sending it again to this customer cannot succeed. One-time-code templates (copy code, one-tap or zero-tap autofill) are the usual cause; deliver the code another way. Other messages, including templates without a one-time-code button, can still be sent to this customer. When the template is known in advance to carry a one-time-code button, the send is refused at once with the error `recipient_phone_number_required` instead and nothing is accepted. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `business_restricted` — this message was refused because the business behind the sending number is most likely restricted on its messaging account, so it was not sent. This is terminal for the message: sending it again will not succeed while the restriction stands. Review the status of the business's messaging account, and if the business believes it complies with the messaging policies, request a review of the restriction. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `channel_refused` — this message was refused upstream and was not sent, for a reason that has no more specific code here, and it will not be retried automatically. Contact support with this message's `id` to learn the reason and whether sending it again can succeed. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. A more specific code may be published for some of these refusals in a later release; treat a code you do not recognise exactly as you treat this one. - `message: string` Human-readable, written for a person reading it. Do not branch on it. - `from: optional string` The number this message left by, or arrived on, in E.164 (leading `+`). Every message in one conversation carries the same value — a conversation never moves to another number. Absent only if the number is no longer one of yours. - `reply_to_message_id: optional string` This API's `id` of the earlier message in this chat that this message replies to. On an inbound message it is the message the customer quoted; on an outbound message it is the `reply_to_message_id` you sent. Look the value up in this chat's transcript to show what was answered; it is the same namespace as `id`, never a channel identifier. Absent when there is no reply context this API can resolve — a message that quotes nothing, or one that quotes a message this API never recorded in this chat. Treat absence as "no reply context available", not as proof the message was not a reply. - `zero_retention: optional true` True when the message is under zero-day retention: its content is not kept, so later reads and idempotent retries return empty `parts`. The original send response still carries the content. Retention applies only within Linq's systems. The WhatsApp channel operator's own processing and retention of message content are governed by its terms and are not affected by this setting. - `true` - `has_more: boolean` True when another page exists in the direction you are paging — pass `next_cursor` to fetch it. - `next_cursor: optional string` Cursor for the next page in the same direction; present when `has_more` is true. It can advance past expired ephemeral events intentionally omitted from the read. Send it back with the same `order`. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/chats/$CHAT/events \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` #### Response ```json { "data": [ { "occurred_at": "2019-12-27T18:11:19.117Z", "seq": 0, "type": "type", "message": { "id": "id", "chat_id": "chat_id", "created_at": "2019-12-27T18:11:19.117Z", "direction": "inbound", "parts": [ { "body": "body", "type": "text", "preview_url": true } ], "status": "status", "channel_message_id": "channel_message_id", "failure": { "code": "code", "message": "message" }, "from": "from", "reply_to_message_id": "reply_to_message_id", "zero_retention": true } } ], "has_more": true, "next_cursor": "next_cursor" } ``` --- # List a chat's events URL: https://docs.linqapp.com/channel/whatsapp/api/resources/chats/subresources/events/methods/list/ **get** `/v1/chats/{chat}/events` Reads a chat's event sequence in order — the transcript API. Stored positions are assigned contiguously from `seq` 1 and never renumbered. When ephemeral messages are enabled, an expired message and its related events are omitted from this read, so returned `seq` values have gaps where those events were. **`order` chooses which end a bare request starts from.** It defaults to `asc`, which starts at the OLDEST event and pages forward — identical to every release before this one, so a request that does not send `order` is unchanged. `order=desc` starts at the NEWEST event and pages backward, newest entry first, which is what an inbox wants: the latest activity is the first page rather than the last. This is the BACKFILL for `GET /v1/streams/events`, which is a live stream and replays nothing: an event that passed while you were not connected is re-read here, addressed by the `chat_id` and `seq` range every stream frame carries. **The cursor is the `seq` of the last entry you processed**, in either direction, and it is exclusive — pass `next_cursor` back verbatim, or the `seq` you stopped at, and the next page continues from there. Under `asc` that means the entries ABOVE it and `next_cursor` is the page's highest `seq`; under `desc` it means the entries BELOW it and `next_cursor` is the page's lowest. The direction is not carried in the cursor, so send `order` on every request of a walk: the same cursor with the other `order` reads the other way rather than being refused. Paging never skips a visible event: the next page resumes after the last returned position and any expired ephemeral positions intentionally read past. A visible lookahead row withheld by the page limit remains for the next page. An event journaled between two requests is returned rather than stepped over. A backward walk is not disturbed by events journaled while it runs — they take positions above where it started, so they are neither repeated nor mistaken for a retention gap. **Being caught up and being lost are different answers.** A cursor at the end you are paging TOWARD returns an empty page — the chat's newest `seq` under `asc`, `seq` `1` under `desc` — and that is the ordinary polling result. A cursor BEYOND that end is refused with `422` (`invalid_paging`), because no such position has ever existed in this chat and answering it with silence would be indistinguishable from having caught up. Each direction has its own beyond-the-end: a cursor above the chat's newest `seq` is refused whichever `order` you asked for, and `0` — the position below the first, which is `1` — is refused under `desc`, where nothing lies below it. Either refusal names where the sequence actually ends, so a client that has drifted can resume. An empty cursor is refused the same way in both directions: omit the parameter to start at whichever end `order` selects. **Retention.** This journal has no scheduled pruning, so ordinary operation does not remove an old prefix or renumber its immutable sequence. That is not a permanent-retention promise or a fixed minimum availability period: authenticated account deletion, offboarding, or a lawful deletion requirement may remove the account-scoped transcript. This operation therefore has no `expires_at`, retained-floor field, or scheduled `cursor_expired` response. If prefix pruning is introduced later, its additive retained floor and typed expiry behavior will be published before any history is removed. ### Path Parameters - `chat: string` ### Query Parameters - `cursor: optional string` Cursor from a previous page's `next_cursor`, read in the direction `order` selects. Exclusive: the page starts after it under `asc`, before it under `desc`. - `limit: optional number` Page size. The bounds are in this parameter's schema, not only in this sentence — a value outside them is refused, never clamped. - `order: optional "asc" or "desc"` Which end a request with no cursor starts from, and which way a cursor is read: `asc` from the oldest event forward, `desc` from the newest event backward. Any other value is refused, never coerced. - `"asc"` - `"desc"` ### Returns - `ChatEventPage object { data, has_more, next_cursor }` A page of one chat's events, in the `seq` order the read asked for — ascending by default, descending under `order=desc`. - `data: array of ChatEvent` - `occurred_at: string` - `seq: number` The event's position in this chat's stored sequence. Positions are assigned contiguously from 1 and never renumbered. When ephemeral messages are enabled, reads omit an expired message and its related events, so the `seq` values returned to that account have gaps where those events were. Use this as the chat's events-read cursor. It is scoped to one chat, so it is NOT the `/v1/streams/events` stream cursor: that stream spans every chat and carries its own cursor in each frame's `id`. - `type: string` The event's kind, e.g. `message.received`, `message.sent`. Kinds grow additively — skip what you do not handle. `chat.event.unknown` is the one kind that never carries meaning: it marks a journal entry whose partner-visible kind is not published yet. It preserves that stored position instead of hiding an unpublished kind. Expired ephemeral messages are different: retention omits their related events from reads, leaving visible gaps in `seq`. Skip this kind. - `message: optional Message` The message this event is about, on message-kind events. - `id: string` This API's message id. Put this value in an outbound reaction's `message_id`; an inbound reaction to this message carries the same value in its `message_id`, so this is the one identifier you need to keep. Mark-as-read targets the latest unread inbound message in a chat, so it takes the chat id. - `chat_id: string` The chat this message belongs to. - `created_at: string` - `direction: "inbound" or "outbound"` `inbound` (from the customer) or `outbound` (sent by you). - `"inbound"` - `"outbound"` - `parts: array of object { body, type, preview_url } or object { kind, type, availability, 10 more } or object { language, name, type, 4 more } or 17 more` The message content — sendable parts, plus the inbound-only types on inbound messages. Empty only when `zero_retention` is true, or when an idempotent retry returns an ephemeral message whose content retention cleanup has removed. - `Text object { body, type, preview_url }` A plain text message. - `body: string` The message text. URLs render as tappable links. - `type: "text"` - `"text"` - `preview_url: optional boolean` Render a preview card for the first URL in body. Defaults to false. - `Media object { kind, type, availability, 10 more }` A media message — image, video, audio, document, or sticker. The two identifiers are distinct namespaces: inbound media carries the channel's transient media_id; outbound media carries our durable upload_ref from POST /v1/media. - `kind: "image" or "video" or "audio" or 2 more` Which kind of media this is. Captions apply to image, video and document only; filename applies to document only. - `"image"` - `"video"` - `"audio"` - `"document"` - `"sticker"` - `type: "media"` - `"media"` - `availability: optional "available" or "unavailable" or "pending"` Response only, inbound parts only: whether the download answers the bytes. available: the file was captured and is retained. unavailable: it is not downloadable now, and unavailable_reason says why; with timed_out the download answers 409 while capture continues and can later answer 200, otherwise it answers 410, or 404 once the file is no longer known. It describes the file, not the exact HTTP answer of a later download, which can also refuse for capacity or authorization. pending: capture has not finished yet; only reads of the conversation return pending, and a message event never does. A message.received event is recorded once every attachment has been captured or has failed, or ten minutes after the message arrived, whichever comes first; an event part without availability is from a historical event and may still be capturing, so retry its download as the 409 Retry-After directs. A message event keeps the value it was recorded with; reads return the current one. Historical messages received before it was recorded omit it. Never accepted on sends. - `"available"` - `"unavailable"` - `"pending"` - `byte_size: optional number` Response only, inbound parts only: the exact size in bytes of the retained attachment, equal to the download's Content-Length. Present only while the bytes are captured and retained — the same lifetime as a working url, ending 30 days after server receipt — so it can be absent from a message event while capture has not completed, and its absence is not final; once present it never changes. Absent rather than zero. Never accepted on sends. - `caption: optional string` Caption rendered with the media. Image, video and document only — a caption on an audio or sticker part is rejected, never dropped. - `filename: optional string` Display filename. Documents only — a filename on any other kind is rejected, never dropped. - `media_id: optional string` Inbound only: the channel's transient media identifier. It expires after seven days and is never an outbound address; an outbound value is rejected with a pointer to media_id and upload_ref as the remedy. - `mime_type: optional string` Response only, inbound parts only: the media type the channel declared when the message arrived, verbatim. It may carry parameters (for example audio/ogg; codecs=opus) and may differ from the Content-Type the download answers with, which describes the retained bytes. Present on the webhook body and on every later read with the same value. Historical messages received before it was recorded omit this field. Never accepted on sends. - `source_url: optional string` Outbound only: a public https URL of the bytes to send, as an alternative to upload_ref. Supply exactly one of upload_ref or source_url. The address is fetched once, before the send is accepted, and its exact bytes are stored as an ordinary upload in this account and key partition; the accepted message and every later read carry that upload's upload_ref, never the address, and no retry fetches it again. The URL must be absolute https on the default port with no credentials and no fragment, must resolve to a public address (every redirect hop included, at most three), and must answer with the complete bytes and their exact media type within the fetch deadline. The bytes are then held to the same media type and size rules as POST /v1/media for the part's kind; a mismatch is refused, never converted. - `unavailable_reason: optional string` Response only, present only when availability is unavailable. An open string: the values today are timed_out, capture_failed and expired, and new values may be added. timed_out: the file was still being retrieved ten minutes after the message arrived, so its message event was recorded without it; retrieval continues and the file may become downloadable later, which reads of the conversation report. capture_failed: the file could not be retrieved. expired: the file was retrieved and is no longer retained, or is no longer known (the download then answers 410 or 404). Treat an unknown value as capture_failed. Never accepted on sends. - `upload_ref: optional string` Outbound only: our durable handle returned by POST /v1/media. Handles visibly begin upload. and are reusable within the account and key partition that created them. - `url: optional string` Response only: stable attachment download URL requiring the account Bearer key on every request. Pending capture returns 409 with Retry-After; retained bytes expire 30 days after server receipt. Historical unbound messages omit this field. Never accepted on sends. - `voice: optional boolean` Audio only. On a send it is optional: true sends the audio as a voice note; false, or leaving it out, sends it as an ordinary audio file. A voice note needs an upload stored as audio/ogg that holds mono Opus audio, sent by upload_ref or source_url within the existing audio size limit. The bytes are sent as supplied: they are never converted or inspected, so encode them as mono Opus before uploading. The recipient sees a play button only when the voice file is 512 KB or smaller; a larger voice note is still delivered but must be downloaded before it plays. On incoming audio parts it is response-only: whether the channel reported the audio as a voice note, verbatim. true means it was recorded with the messaging client's voice-recording feature; false means it was sent as an audio file. Present on the webhook body and on every later read with the same value. Absent on an incoming part means the channel did not say, never that the audio is not a voice note. Other kinds never carry it, and historical messages received before it was recorded omit it. - `Template object { language, name, type, 4 more }` An approved message template — the one part type sendable outside an open customer service window. name and language identify the approved template; parameters fills its named placeholders. Authentication templates use this same generic part: their published parameter schema names exactly one parameter, `code` — the one-time code you generate, 1–15 characters — and the message shows it in its body and behind its code button. Every sendable template is registered and approved ahead of the send and publishes its own parameter schema — a send referencing an unknown template, a missing or unknown parameter, or a value that breaks the template's rules is rejected with a 422 naming the exact field. - `language: string` The template's language-and-locale code, e.g. en_US. - `name: string` The approved template's name. Lowercase letters, digits and underscores only. - `type: "template"` - `"template"` - `buttons: optional array of object { index, payload, type }` Send-time values for this approved template's own dynamic buttons, in ascending index order: a url button whose destination ends in {{1}} takes the value appended there and is REQUIRED; a quick_reply button takes the payload returned to you when it is tapped and is OPTIONAL — omit it and the button returns its label. Fixed buttons have no slot. The approved template's send_schema lists the (index, type) slots and an x-rule stating which are required; omit buttons entirely for a template with no url slot when the labels are what you want back. - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `cards: optional array of object { card_index, kind, upload_ref, 2 more }` Per-card values for an approved media-card carousel. The approved template's send_schema provides structural bounds and an x-rule listing the exact card order, media kind, named body values, and dynamic button slots enforced by runtime L2 validation. Omit for non-carousel templates. - `card_index: number` - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: string` A durable handle returned by POST /v1/media. It is resolved within this key's account and partition, then consumed into a transient channel media identifier only at delivery. - `buttons: optional array of object { index, payload, type }` - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `parameters: optional unknown` Named values for this card's body placeholders. - `header: optional object { kind, upload_ref }` The uploaded media used for this approved template's media header. Omit unless this template's send_schema requires it. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `parameters: optional unknown` Named values for the template's placeholders. The shape is per-template: each registered template publishes its own parameter schema — hand THAT schema to your model when composing a specific template. Omit for templates with no placeholders. - `InteractiveList object { body, button, sections, 3 more }` An interactive list message: body text plus a button that opens a sectioned list of selectable rows. The customer's selection arrives as an inbound interactive_reply part with kind list_reply, carrying the chosen row's id. - `body: string` The message body. - `button: string` Label of the button that opens the list. - `sections: array of object { rows, title }` The list's sections, each holding selectable rows. At most 10 rows in total across ALL sections combined — not 10 per section. - `rows: array of object { id, title, description }` This section's rows. The 10-row limit is on the TOTAL across all sections, so a second section reduces what this one may hold. - `id: string` Your identifier for the row — echoed back as the interactive_reply's id. - `title: string` The row's visible title. - `description: optional string` Secondary text under the title. - `title: optional string` Section title. Required when the list has more than one section. - `type: "interactive_list"` - `"interactive_list"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `InteractiveButtons object { body, buttons, type, 3 more }` An interactive reply-buttons message: body text plus up to three tappable buttons. The customer's tap arrives as an inbound interactive_reply part with kind button_reply, carrying the tapped button's id. - `body: string` The message body. - `buttons: array of object { id, title }` The tappable buttons — at most three. - `id: string` Your identifier for the button — echoed back as the interactive_reply's id. - `title: string` The button's visible label. - `type: "interactive_buttons"` - `"interactive_buttons"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `InteractiveCtaURL object { body, display_text, type, 4 more }` An interactive call-to-action message: body text plus one button that opens a URL. - `body: string` The message body. - `display_text: string` The button's visible label. - `type: "interactive_cta_url"` - `"interactive_cta_url"` - `url: string` The URL the button opens. Must be absolute, with an http or https scheme. - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref, filename }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `filename: optional string` The file name the customer sees on a document header. Documents only. - `InteractiveCarousel object { body, cards, type }` An interactive carousel: one message whose body sits above 2 to 10 horizontally scrolling cards. Each card shows an uploaded image, or a video from a public link, and either one button that opens a URL or reply buttons. A tap on a card's reply button arrives as an inbound template_reply part whose payload is that button's id; nothing else in the reply identifies the card, so the id you choose is the card's identity. - `body: string` The message text shown above the cards. - `cards: array of object { card_index, header, body, 2 more }` The cards, left to right. - `card_index: number` This card's zero-based position: the first card is 0, the next 1, and so on, in array order. - `header: object { kind, upload_ref, url }` The card's media: an image named by upload_ref, or a video named by the public https url it plays from. Every card carries the same kind. - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: optional string` A durable handle returned by POST /v1/media for an image upload. Image cards only. - `url: optional string` The public https address the card's video plays from. Video cards only. It is sent exactly as written and never fetched by this API, so it must be publicly reachable and serve a playable video; a link that does not play is accepted and then reported as a failed delivery (message.failed with channel_refused). - `body: optional string` Optional text below the card's image or video, with at most two line breaks. - `reply_buttons: optional array of object { id, title }` Buttons the customer taps to reply. Use either url_button or reply_buttons on every card. - `id: string` Your identifier for the button, echoed back as the template_reply's payload. Unique across the whole carousel. - `title: string` The button's visible label. - `url_button: optional object { display_text, url }` One button that opens a URL. Use either url_button or reply_buttons on every card. - `display_text: string` The button's visible label. - `url: string` The absolute https URL the button opens. - `type: "interactive_carousel"` - `"interactive_carousel"` - `LocationRequest object { body, type }` Asks the customer to share a location. The response arrives as a location part. - `body: string` Prompt shown above the send-location button. - `type: "location_request"` - `"location_request"` - `ContactRequest object { body, type }` Asks the customer to share their own contact card with one tap. Useful when you know the customer only by a username identifier and need a phone number. The answer arrives as an ordinary contacts part whose card carries origin contact_request; a card the customer shares by hand carries origin other instead. The answer is not linked to your request as a reply: its message carries no reply_to_message_id, so match it by origin and timing. Sendable inside the customer window. - `body: string` Prompt shown above the share-contact button. - `type: "contact_request"` - `"contact_request"` - `AddressRequest object { body, country, type }` Reserved for asking an eligible customer in India to submit a structured address. Sending this part is not available until business and customer eligibility can be verified at acceptance. Address responses already arrive as address_reply parts. - `body: string` Prompt shown above the address form. - `country: "IN"` ISO country code. Structured address requests are currently available only in India. - `"IN"` - `type: "address_request"` - `"address_request"` - `Contacts object { contacts, type }` One or more contact cards. - `contacts: array of object { name, addresses, birthday, 5 more }` The contact cards to send. The channel permits far more; this API caps a message at five, because a message carrying hundreds of cards is a mistake rather than a use case. - `name: object { formatted_name, first_name, last_name, 3 more }` - `formatted_name: string` The contact's full display name. - `first_name: optional string` - `last_name: optional string` - `middle_name: optional string` - `prefix: optional string` - `suffix: optional string` - `addresses: optional array of object { city, country, country_code, 4 more }` - `city: optional string` - `country: optional string` - `country_code: optional string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `state: optional string` - `street: optional string` - `zip: optional string` - `birthday: optional string` The contact's birthday as YYYY-MM-DD. - `emails: optional array of object { email, kind }` - `email: string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `org: optional object { company, department, title }` - `company: optional string` - `department: optional string` - `title: optional string` - `origin: optional string` Response-only: how the customer came to share this card, as the channel reported it, verbatim. contact_request means they tapped the share button on a contact_request you sent; other means they shared a card themselves. New values may appear, so treat any other value as unrecognised rather than as either of these. Absent when the channel did not say, and on cards received before it was recorded. A send carrying it is rejected with a pointer at the member. - `phones: optional array of object { phone, kind, messaging_id }` - `phone: string` The phone number, ideally in +E.164 form. - `kind: optional string` A label for the number, e.g. CELL, MAIN, WORK, HOME. - `messaging_id: optional string` The contact's messaging-account identifier on this channel, when known — makes the card openable in the messaging app. - `urls: optional array of object { url, kind }` - `url: string` - `kind: optional string` A label for the URL, e.g. WORK, HOME. - `type: "contacts"` - `"contacts"` - `Location object { latitude, longitude, type, 2 more }` A location pin. - `latitude: number` Latitude in decimal degrees. - `longitude: number` Longitude in decimal degrees. - `type: "location"` - `"location"` - `address: optional string` The place's address, shown under the name. - `name: optional string` The place's name, shown on the pin. - `Reaction object { emoji, type, channel_message_id, message_id }` An emoji reaction to an earlier message in the chat. message_id is this API's Message.id for the target in both directions: it is what you send, and it is appended to an inbound reaction whenever the target is a message of the same chat. channel_message_id is the channel's opaque identifier and appears on inbound reactions only. - `emoji: string` A single emoji. Send an empty string to remove a previous reaction to the same message. - `type: "reaction"` - `"reaction"` - `channel_message_id: optional string` Inbound only: the channel's opaque identifier for the message being reacted to. Always present on an inbound reaction, beside message_id whenever the target resolved. Match it literally to Message.channel_message_id in the chat transcript; never parse it or compare it with Message.id. - `message_id: optional string` This API's Message.id for the message being reacted to. Outbound: required, and the API resolves it into the channel namespace before sending, so the message must be one this account can see in the chat the send addresses. Inbound: present whenever the target is a message of the same chat, so you can keep only this identifier; absent when the chat does not hold the target. - `InteractiveReply object { id, kind, title, 2 more }` Inbound only — never sendable. The customer's selection from an interactive_list (kind list_reply) or interactive_buttons (kind button_reply) message, carrying the id you assigned to the chosen row or button. - `id: string` The id you assigned to the chosen row or button, exactly as you sent it. - `kind: "list_reply" or "button_reply"` Which interactive message kind was answered. - `"list_reply"` - `"button_reply"` - `title: string` The chosen row's or button's visible title. - `type: "interactive_reply"` - `"interactive_reply"` - `description: optional string` The chosen list row's secondary text, when it had one. - `TemplateReply object { payload, text, type }` Inbound only — never sendable. The customer tapped a quick-reply button on an approved template you sent, or a reply button on a card of an interactive_carousel you sent. payload is the value you set on that button: the template's quick_reply slot payload (or the button's label when you left the slot out), or the carousel card button's id. text is the label the customer saw. A carousel tap carries nothing else that identifies the card, so the id you chose is the card's only identity. For a template tap, the message's reply_to_message_id names the template message that carried the button. Distinct from interactive_reply, which answers an interactive_buttons or interactive_list message. - `payload: string` The quick_reply slot's payload from your send, or the button label when the slot was omitted; for a carousel card, the tapped reply button's id. - `text: string` The tapped button's label, as the customer saw it. - `type: "template_reply"` - `"template_reply"` - `AddressReply object { type, values, saved_address_id }` Inbound only: the structured values submitted in response to an address request. - `type: "address_reply"` - `"address_reply"` - `values: object { address, building_name, city, 8 more }` - `address: optional string` - `building_name: optional string` - `city: optional string` - `floor_number: optional string` - `house_number: optional string` - `landmark_area: optional string` - `name: optional string` - `phone_number: optional string` - `pin_code: optional string` - `state: optional string` - `tower_number: optional string` - `saved_address_id: optional string` Identifier of the selected saved address, when one was selected. - `Order object { catalog_id, items, type, text }` Inbound only — never sendable. An order the customer placed from a product catalog. - `catalog_id: string` The catalog the ordered items belong to. - `items: array of object { currency, price, product_retailer_id, quantity }` The ordered items. - `currency: string` ISO 4217 currency code for price. - `price: number` The per-item price at order time. - `product_retailer_id: string` Your identifier for the product, as registered in the catalog. - `quantity: number` - `type: "order"` - `"order"` - `text: optional string` Free text the customer attached to the order, when any. - `Referral object { type, body, click_id, 7 more }` Inbound only — never sendable. The ad or post context a customer's first message arrived from (for example an ad whose call to action opens a chat). A referral also opens a free-entry-point customer window — see the chat's customer_window. - `type: "referral"` - `"referral"` - `body: optional string` The ad's body text at click time. - `click_id: optional string` The click identifier assigned by the ad platform, for attribution. - `headline: optional string` The ad's headline at click time. - `image_url: optional string` URL of the ad's image creative, when media_kind is image. - `media_kind: optional string` The ad creative's media kind, e.g. image or video. - `source_id: optional string` The ad or post id. - `source_kind: optional string` What the source was, e.g. ad or post. - `source_url: optional string` The URL of the ad or post the customer came from. - `video_url: optional string` URL of the ad's video creative, when media_kind is video. - `System object { body, type, event }` Inbound only — never sendable. A system event in the chat, such as the customer changing their number. New event kinds appear over time; body is always present and human-readable. - `body: string` Human-readable description of the system event. - `type: "system"` - `"system"` - `event: optional string` The system event's kind, when the channel identifies one. New kinds appear over time — treat unknown values as informational. - `Unsupported object { raw, type, kind }` Inbound only — never sendable. A message kind this API does not yet type natively, carried as a typed passthrough: raw holds the channel payload, so a new message kind is never a black box or a silent drop. Native part types for popular kinds are added over time; this part is the compatibility guarantee in the meantime. - `raw: unknown` The channel payload — any JSON value: object, array, string, number, boolean, or null. Deliberately unconstrained, because the whole point of this part is to carry a shape this API does not yet know. For rows written by API version 1.3.0 or later, object member order, number formatting and duplicated members survive storage and read-back. The canonical encoder may compact insignificant whitespace before storage. Rows written before API version 1.3.0 retain normalized JSON only: member order and number formatting may differ, and only the last duplicated member survives. - `type: "unsupported"` - `"unsupported"` - `kind: optional string` The channel's name for the message kind, when it declares one. - `status: string` The message's delivery state as last reported. Inbound messages read `received`: they arrived, and no delivery of ours ran. A message you sent starts `accepted` and moves through `sent`, `delivered` and `read` as the channel reports them, with `failed` as the definitive negative outcome. `unknown` means exactly that: the send is INDETERMINATE and we decline to guess. It is NOT terminal — an indeterminate send is never re-sent, and it resolves to `sent`, `delivered`, `read` or `failed` when the channel's own report arrives — so keep observing rather than treating it as an outcome. States are reported asynchronously on the chat's event sequence, and the set grows additively: treat a value you do not recognise as "no information" rather than failing on it. Retention of this published status follows the chat transcript policy: there is no scheduled pruning, but no fixed minimum availability period is published yet. The present absence of a scheduled age-based sweep is not a promise of indefinite availability. `delivered` is reported by the channel after it accepted the message and can lag by hours, never arrive at all, or be followed by a failure, so do not build timeouts around it arriving promptly. - `channel_message_id: optional string` The channel's opaque identifier for this message, when the channel has assigned one. An inbound reaction's `channel_message_id` matches this field literally; never parse it or compare it with `id`. It is absent while an accepted outbound message has not yet received a channel identifier, and until it is present an inbound reaction to this message carries only `channel_message_id`. - `failure: optional object { code, message }` Why a failed message failed, when we have a reason worth publishing. Present only on `status` `failed`, and not on every one of those: a message can fail for a reason outside the published vocabulary and carry no `failure` at all. Its absence means "no published reason", never "no reason". Most messages the channel refused do carry one: a specific code where one is published, and `channel_refused` for most of the rest; a few kinds of refusal still carry none. `status` stays the thing to branch on. This is additive detail beside it, so an integration written before this field existed still sees a terminal `failed` and behaves exactly as it did. - `code: string` The specific reason. `sender_deregistered` — the number this message was going out from is no longer a registered sending number, and the message never left. This is terminal: it is not a pause and it does not clear, so retrying the same message cannot succeed and that conversation is over. Reach this customer by starting a new one on another of your numbers with a template, exactly as you would any customer whose 24-hour window has closed; `GET /v1/chats` shows which number each conversation uses. You are not billed for a message that failed this way. `quality_hold_expired` — this marketing message remained held by an automatic safety control on its sending line for ten minutes and was not sent. This is terminal: retrying the same message cannot succeed on that conversation. Send marketing from another of your numbers with a template, or contact support about the sending line. You are not billed for a message that failed this way. `target_message_failed` — the message this one quotes or reacts to failed, or its outcome could not be established, before this message went out. This message was therefore never sent, because a quote is never sent without its context. A `message.failed` event reports it. This is terminal: send it again as a new message, without that target or naming one that was sent. You are not billed a channel charge for it, though it still counts toward your platform subscription's message volume. `recipient_country_restricted` — the business behind the sending number is not currently permitted to message customers in this recipient's country, so the message was not delivered. The restriction blocks every message type, including replies inside the customer's 24-hour window. This is terminal for the message: sending it again cannot succeed while the restriction stands. Most countries unlock only when the business has completed business verification and has held an assigned messaging tier of 2,000 or higher for 30 consecutive days. The assigned tier is what counts, not how many messages you send. Brazil and Indonesia also require the business's primary business location to be in that country, at any tier: a business located elsewhere cannot message customers there. Until the business qualifies, sends to that country will keep failing. The channel publishes no list of restricted country pairs and offers no API signal before a send. If the business meets these conditions and the restriction stands, review the messaging policy for the business's category. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `payment_method_required` — the business behind the sending number has no working payment method on its messaging account, so this message was not sent. This is terminal for the message: retrying it cannot succeed until a payment method is added. Add or update the payment method in the messaging account's billing settings, then send again as a new message. Replies inside an open 24-hour customer window are charged too once the sending number's monthly free allowance of them is used up, so they also need a working payment method and can fail this way. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `recipient_phone_number_required` — this customer is known only by a username identifier, not a phone number, and this message can be delivered only to a phone number, so it was not sent. This is terminal for the message: sending it again to this customer cannot succeed. One-time-code templates (copy code, one-tap or zero-tap autofill) are the usual cause; deliver the code another way. Other messages, including templates without a one-time-code button, can still be sent to this customer. When the template is known in advance to carry a one-time-code button, the send is refused at once with the error `recipient_phone_number_required` instead and nothing is accepted. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `business_restricted` — this message was refused because the business behind the sending number is most likely restricted on its messaging account, so it was not sent. This is terminal for the message: sending it again will not succeed while the restriction stands. Review the status of the business's messaging account, and if the business believes it complies with the messaging policies, request a review of the restriction. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `channel_refused` — this message was refused upstream and was not sent, for a reason that has no more specific code here, and it will not be retried automatically. Contact support with this message's `id` to learn the reason and whether sending it again can succeed. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. A more specific code may be published for some of these refusals in a later release; treat a code you do not recognise exactly as you treat this one. - `message: string` Human-readable, written for a person reading it. Do not branch on it. - `from: optional string` The number this message left by, or arrived on, in E.164 (leading `+`). Every message in one conversation carries the same value — a conversation never moves to another number. Absent only if the number is no longer one of yours. - `reply_to_message_id: optional string` This API's `id` of the earlier message in this chat that this message replies to. On an inbound message it is the message the customer quoted; on an outbound message it is the `reply_to_message_id` you sent. Look the value up in this chat's transcript to show what was answered; it is the same namespace as `id`, never a channel identifier. Absent when there is no reply context this API can resolve — a message that quotes nothing, or one that quotes a message this API never recorded in this chat. Treat absence as "no reply context available", not as proof the message was not a reply. - `zero_retention: optional true` True when the message is under zero-day retention: its content is not kept, so later reads and idempotent retries return empty `parts`. The original send response still carries the content. Retention applies only within Linq's systems. The WhatsApp channel operator's own processing and retention of message content are governed by its terms and are not affected by this setting. - `true` - `has_more: boolean` True when another page exists in the direction you are paging — pass `next_cursor` to fetch it. - `next_cursor: optional string` Cursor for the next page in the same direction; present when `has_more` is true. It can advance past expired ephemeral events intentionally omitted from the read. Send it back with the same `order`. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/chats/$CHAT/events \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` #### Response ```json { "data": [ { "occurred_at": "2019-12-27T18:11:19.117Z", "seq": 0, "type": "type", "message": { "id": "id", "chat_id": "chat_id", "created_at": "2019-12-27T18:11:19.117Z", "direction": "inbound", "parts": [ { "body": "body", "type": "text", "preview_url": true } ], "status": "status", "channel_message_id": "channel_message_id", "failure": { "code": "code", "message": "message" }, "from": "from", "reply_to_message_id": "reply_to_message_id", "zero_retention": true } } ], "has_more": true, "next_cursor": "next_cursor" } ``` --- # Messages URL: https://docs.linqapp.com/channel/whatsapp/api/resources/chats/subresources/messages/ ## Send a message in a chat **post** `/v1/chats/{chat}/messages` Sends a reply on an existing chat's unchanged sending number. The chat supplies the customer and sender; this operation never creates, moves, repins or fails over a conversation. Acceptance and refusal semantics are otherwise identical to `POST /v1/messages`. ### Path Parameters - `chat: string` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `parts: array of object { body, type, preview_url } or object { kind, type, availability, 10 more } or object { language, name, type, 4 more } or 10 more` The message content — sendable parts only, at least one. **One outbound part per request.** Each request has its own acceptance result and optional idempotency key. Each accepted request maps to one native channel message with its own identifier, delivery outcome and charge evidence. A request carrying more than one part is refused with HTTP 422 (`multiple_parts_not_available`, a 1xxx `error.code`, 1019); the API neither fans it out nor offers an atomic batch. Separate requests are independent, and no cross-request delivery or receipt order is promised. A customer known only by a username identifier can receive every message type except a one-time-code template (a copy-code, one-tap or zero-tap autofill button), which can be delivered only to a phone number. When the template is known to carry such a button, the send is refused with HTTP 422 `recipient_phone_number_required` (a 4xxx `error.code`, 4011), pointered at the part, and nothing is accepted; deliver the code another way. - `Text object { body, type, preview_url }` A plain text message. - `body: string` The message text. URLs render as tappable links. - `type: "text"` - `"text"` - `preview_url: optional boolean` Render a preview card for the first URL in body. Defaults to false. - `Media object { kind, type, availability, 10 more }` A media message — image, video, audio, document, or sticker. The two identifiers are distinct namespaces: inbound media carries the channel's transient media_id; outbound media carries our durable upload_ref from POST /v1/media. - `kind: "image" or "video" or "audio" or 2 more` Which kind of media this is. Captions apply to image, video and document only; filename applies to document only. - `"image"` - `"video"` - `"audio"` - `"document"` - `"sticker"` - `type: "media"` - `"media"` - `availability: optional "available" or "unavailable" or "pending"` Response only, inbound parts only: whether the download answers the bytes. available: the file was captured and is retained. unavailable: it is not downloadable now, and unavailable_reason says why; with timed_out the download answers 409 while capture continues and can later answer 200, otherwise it answers 410, or 404 once the file is no longer known. It describes the file, not the exact HTTP answer of a later download, which can also refuse for capacity or authorization. pending: capture has not finished yet; only reads of the conversation return pending, and a message event never does. A message.received event is recorded once every attachment has been captured or has failed, or ten minutes after the message arrived, whichever comes first; an event part without availability is from a historical event and may still be capturing, so retry its download as the 409 Retry-After directs. A message event keeps the value it was recorded with; reads return the current one. Historical messages received before it was recorded omit it. Never accepted on sends. - `"available"` - `"unavailable"` - `"pending"` - `byte_size: optional number` Response only, inbound parts only: the exact size in bytes of the retained attachment, equal to the download's Content-Length. Present only while the bytes are captured and retained — the same lifetime as a working url, ending 30 days after server receipt — so it can be absent from a message event while capture has not completed, and its absence is not final; once present it never changes. Absent rather than zero. Never accepted on sends. - `caption: optional string` Caption rendered with the media. Image, video and document only — a caption on an audio or sticker part is rejected, never dropped. - `filename: optional string` Display filename. Documents only — a filename on any other kind is rejected, never dropped. - `media_id: optional string` Inbound only: the channel's transient media identifier. It expires after seven days and is never an outbound address; an outbound value is rejected with a pointer to media_id and upload_ref as the remedy. - `mime_type: optional string` Response only, inbound parts only: the media type the channel declared when the message arrived, verbatim. It may carry parameters (for example audio/ogg; codecs=opus) and may differ from the Content-Type the download answers with, which describes the retained bytes. Present on the webhook body and on every later read with the same value. Historical messages received before it was recorded omit this field. Never accepted on sends. - `source_url: optional string` Outbound only: a public https URL of the bytes to send, as an alternative to upload_ref. Supply exactly one of upload_ref or source_url. The address is fetched once, before the send is accepted, and its exact bytes are stored as an ordinary upload in this account and key partition; the accepted message and every later read carry that upload's upload_ref, never the address, and no retry fetches it again. The URL must be absolute https on the default port with no credentials and no fragment, must resolve to a public address (every redirect hop included, at most three), and must answer with the complete bytes and their exact media type within the fetch deadline. The bytes are then held to the same media type and size rules as POST /v1/media for the part's kind; a mismatch is refused, never converted. - `unavailable_reason: optional string` Response only, present only when availability is unavailable. An open string: the values today are timed_out, capture_failed and expired, and new values may be added. timed_out: the file was still being retrieved ten minutes after the message arrived, so its message event was recorded without it; retrieval continues and the file may become downloadable later, which reads of the conversation report. capture_failed: the file could not be retrieved. expired: the file was retrieved and is no longer retained, or is no longer known (the download then answers 410 or 404). Treat an unknown value as capture_failed. Never accepted on sends. - `upload_ref: optional string` Outbound only: our durable handle returned by POST /v1/media. Handles visibly begin upload. and are reusable within the account and key partition that created them. - `url: optional string` Response only: stable attachment download URL requiring the account Bearer key on every request. Pending capture returns 409 with Retry-After; retained bytes expire 30 days after server receipt. Historical unbound messages omit this field. Never accepted on sends. - `voice: optional boolean` Audio only. On a send it is optional: true sends the audio as a voice note; false, or leaving it out, sends it as an ordinary audio file. A voice note needs an upload stored as audio/ogg that holds mono Opus audio, sent by upload_ref or source_url within the existing audio size limit. The bytes are sent as supplied: they are never converted or inspected, so encode them as mono Opus before uploading. The recipient sees a play button only when the voice file is 512 KB or smaller; a larger voice note is still delivered but must be downloaded before it plays. On incoming audio parts it is response-only: whether the channel reported the audio as a voice note, verbatim. true means it was recorded with the messaging client's voice-recording feature; false means it was sent as an audio file. Present on the webhook body and on every later read with the same value. Absent on an incoming part means the channel did not say, never that the audio is not a voice note. Other kinds never carry it, and historical messages received before it was recorded omit it. - `Template object { language, name, type, 4 more }` An approved message template — the one part type sendable outside an open customer service window. name and language identify the approved template; parameters fills its named placeholders. Authentication templates use this same generic part: their published parameter schema names exactly one parameter, `code` — the one-time code you generate, 1–15 characters — and the message shows it in its body and behind its code button. Every sendable template is registered and approved ahead of the send and publishes its own parameter schema — a send referencing an unknown template, a missing or unknown parameter, or a value that breaks the template's rules is rejected with a 422 naming the exact field. - `language: string` The template's language-and-locale code, e.g. en_US. - `name: string` The approved template's name. Lowercase letters, digits and underscores only. - `type: "template"` - `"template"` - `buttons: optional array of object { index, payload, type }` Send-time values for this approved template's own dynamic buttons, in ascending index order: a url button whose destination ends in {{1}} takes the value appended there and is REQUIRED; a quick_reply button takes the payload returned to you when it is tapped and is OPTIONAL — omit it and the button returns its label. Fixed buttons have no slot. The approved template's send_schema lists the (index, type) slots and an x-rule stating which are required; omit buttons entirely for a template with no url slot when the labels are what you want back. - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `cards: optional array of object { card_index, kind, upload_ref, 2 more }` Per-card values for an approved media-card carousel. The approved template's send_schema provides structural bounds and an x-rule listing the exact card order, media kind, named body values, and dynamic button slots enforced by runtime L2 validation. Omit for non-carousel templates. - `card_index: number` - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: string` A durable handle returned by POST /v1/media. It is resolved within this key's account and partition, then consumed into a transient channel media identifier only at delivery. - `buttons: optional array of object { index, payload, type }` - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `parameters: optional unknown` Named values for this card's body placeholders. - `header: optional object { kind, upload_ref }` The uploaded media used for this approved template's media header. Omit unless this template's send_schema requires it. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `parameters: optional unknown` Named values for the template's placeholders. The shape is per-template: each registered template publishes its own parameter schema — hand THAT schema to your model when composing a specific template. Omit for templates with no placeholders. - `InteractiveList object { body, button, sections, 3 more }` An interactive list message: body text plus a button that opens a sectioned list of selectable rows. The customer's selection arrives as an inbound interactive_reply part with kind list_reply, carrying the chosen row's id. - `body: string` The message body. - `button: string` Label of the button that opens the list. - `sections: array of object { rows, title }` The list's sections, each holding selectable rows. At most 10 rows in total across ALL sections combined — not 10 per section. - `rows: array of object { id, title, description }` This section's rows. The 10-row limit is on the TOTAL across all sections, so a second section reduces what this one may hold. - `id: string` Your identifier for the row — echoed back as the interactive_reply's id. - `title: string` The row's visible title. - `description: optional string` Secondary text under the title. - `title: optional string` Section title. Required when the list has more than one section. - `type: "interactive_list"` - `"interactive_list"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `InteractiveButtons object { body, buttons, type, 3 more }` An interactive reply-buttons message: body text plus up to three tappable buttons. The customer's tap arrives as an inbound interactive_reply part with kind button_reply, carrying the tapped button's id. - `body: string` The message body. - `buttons: array of object { id, title }` The tappable buttons — at most three. - `id: string` Your identifier for the button — echoed back as the interactive_reply's id. - `title: string` The button's visible label. - `type: "interactive_buttons"` - `"interactive_buttons"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `InteractiveCtaURL object { body, display_text, type, 4 more }` An interactive call-to-action message: body text plus one button that opens a URL. - `body: string` The message body. - `display_text: string` The button's visible label. - `type: "interactive_cta_url"` - `"interactive_cta_url"` - `url: string` The URL the button opens. Must be absolute, with an http or https scheme. - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref, filename }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `filename: optional string` The file name the customer sees on a document header. Documents only. - `InteractiveCarousel object { body, cards, type }` An interactive carousel: one message whose body sits above 2 to 10 horizontally scrolling cards. Each card shows an uploaded image, or a video from a public link, and either one button that opens a URL or reply buttons. A tap on a card's reply button arrives as an inbound template_reply part whose payload is that button's id; nothing else in the reply identifies the card, so the id you choose is the card's identity. - `body: string` The message text shown above the cards. - `cards: array of object { card_index, header, body, 2 more }` The cards, left to right. - `card_index: number` This card's zero-based position: the first card is 0, the next 1, and so on, in array order. - `header: object { kind, upload_ref, url }` The card's media: an image named by upload_ref, or a video named by the public https url it plays from. Every card carries the same kind. - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: optional string` A durable handle returned by POST /v1/media for an image upload. Image cards only. - `url: optional string` The public https address the card's video plays from. Video cards only. It is sent exactly as written and never fetched by this API, so it must be publicly reachable and serve a playable video; a link that does not play is accepted and then reported as a failed delivery (message.failed with channel_refused). - `body: optional string` Optional text below the card's image or video, with at most two line breaks. - `reply_buttons: optional array of object { id, title }` Buttons the customer taps to reply. Use either url_button or reply_buttons on every card. - `id: string` Your identifier for the button, echoed back as the template_reply's payload. Unique across the whole carousel. - `title: string` The button's visible label. - `url_button: optional object { display_text, url }` One button that opens a URL. Use either url_button or reply_buttons on every card. - `display_text: string` The button's visible label. - `url: string` The absolute https URL the button opens. - `type: "interactive_carousel"` - `"interactive_carousel"` - `LocationRequest object { body, type }` Asks the customer to share a location. The response arrives as a location part. - `body: string` Prompt shown above the send-location button. - `type: "location_request"` - `"location_request"` - `ContactRequest object { body, type }` Asks the customer to share their own contact card with one tap. Useful when you know the customer only by a username identifier and need a phone number. The answer arrives as an ordinary contacts part whose card carries origin contact_request; a card the customer shares by hand carries origin other instead. The answer is not linked to your request as a reply: its message carries no reply_to_message_id, so match it by origin and timing. Sendable inside the customer window. - `body: string` Prompt shown above the share-contact button. - `type: "contact_request"` - `"contact_request"` - `AddressRequest object { body, country, type }` Reserved for asking an eligible customer in India to submit a structured address. Sending this part is not available until business and customer eligibility can be verified at acceptance. Address responses already arrive as address_reply parts. - `body: string` Prompt shown above the address form. - `country: "IN"` ISO country code. Structured address requests are currently available only in India. - `"IN"` - `type: "address_request"` - `"address_request"` - `Contacts object { contacts, type }` One or more contact cards. - `contacts: array of object { name, addresses, birthday, 5 more }` The contact cards to send. The channel permits far more; this API caps a message at five, because a message carrying hundreds of cards is a mistake rather than a use case. - `name: object { formatted_name, first_name, last_name, 3 more }` - `formatted_name: string` The contact's full display name. - `first_name: optional string` - `last_name: optional string` - `middle_name: optional string` - `prefix: optional string` - `suffix: optional string` - `addresses: optional array of object { city, country, country_code, 4 more }` - `city: optional string` - `country: optional string` - `country_code: optional string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `state: optional string` - `street: optional string` - `zip: optional string` - `birthday: optional string` The contact's birthday as YYYY-MM-DD. - `emails: optional array of object { email, kind }` - `email: string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `org: optional object { company, department, title }` - `company: optional string` - `department: optional string` - `title: optional string` - `origin: optional string` Response-only: how the customer came to share this card, as the channel reported it, verbatim. contact_request means they tapped the share button on a contact_request you sent; other means they shared a card themselves. New values may appear, so treat any other value as unrecognised rather than as either of these. Absent when the channel did not say, and on cards received before it was recorded. A send carrying it is rejected with a pointer at the member. - `phones: optional array of object { phone, kind, messaging_id }` - `phone: string` The phone number, ideally in +E.164 form. - `kind: optional string` A label for the number, e.g. CELL, MAIN, WORK, HOME. - `messaging_id: optional string` The contact's messaging-account identifier on this channel, when known — makes the card openable in the messaging app. - `urls: optional array of object { url, kind }` - `url: string` - `kind: optional string` A label for the URL, e.g. WORK, HOME. - `type: "contacts"` - `"contacts"` - `Location object { latitude, longitude, type, 2 more }` A location pin. - `latitude: number` Latitude in decimal degrees. - `longitude: number` Longitude in decimal degrees. - `type: "location"` - `"location"` - `address: optional string` The place's address, shown under the name. - `name: optional string` The place's name, shown on the pin. - `Reaction object { emoji, type, channel_message_id, message_id }` An emoji reaction to an earlier message in the chat. message_id is this API's Message.id for the target in both directions: it is what you send, and it is appended to an inbound reaction whenever the target is a message of the same chat. channel_message_id is the channel's opaque identifier and appears on inbound reactions only. - `emoji: string` A single emoji. Send an empty string to remove a previous reaction to the same message. - `type: "reaction"` - `"reaction"` - `channel_message_id: optional string` Inbound only: the channel's opaque identifier for the message being reacted to. Always present on an inbound reaction, beside message_id whenever the target resolved. Match it literally to Message.channel_message_id in the chat transcript; never parse it or compare it with Message.id. - `message_id: optional string` This API's Message.id for the message being reacted to. Outbound: required, and the API resolves it into the channel namespace before sending, so the message must be one this account can see in the chat the send addresses. Inbound: present whenever the target is a message of the same chat, so you can keep only this identifier; absent when the chat does not hold the target. - `reply_to_message_id: optional string` Our opaque `Message.id` for an earlier message in this same chat. The accepted message reads back with the same `reply_to_message_id`, and an inbound message that quotes one of yours carries the quoted message's `id` in the same field. - `send_at: optional string` RESERVED — scheduled sends are not yet available. Any value is refused. ### Returns - `AcceptedMessage object { id, chat_id, created_at, 9 more }` An accepted send: the message, plus how its sending number was chosen. - `id: string` This API's message id. Put this value in an outbound reaction's `message_id`; an inbound reaction to this message carries the same value in its `message_id`, so this is the one identifier you need to keep. Mark-as-read targets the latest unread inbound message in a chat, so it takes the chat id. - `chat_id: string` The chat this message belongs to. - `created_at: string` - `direction: "inbound" or "outbound"` `inbound` (from the customer) or `outbound` (sent by you). - `"inbound"` - `"outbound"` - `parts: array of object { body, type, preview_url } or object { kind, type, availability, 10 more } or object { language, name, type, 4 more } or 17 more` The message content — sendable parts, plus the inbound-only types on inbound messages. Empty only when `zero_retention` is true, or when an idempotent retry returns an ephemeral message whose content retention cleanup has removed. - `Text object { body, type, preview_url }` A plain text message. - `body: string` The message text. URLs render as tappable links. - `type: "text"` - `"text"` - `preview_url: optional boolean` Render a preview card for the first URL in body. Defaults to false. - `Media object { kind, type, availability, 10 more }` A media message — image, video, audio, document, or sticker. The two identifiers are distinct namespaces: inbound media carries the channel's transient media_id; outbound media carries our durable upload_ref from POST /v1/media. - `kind: "image" or "video" or "audio" or 2 more` Which kind of media this is. Captions apply to image, video and document only; filename applies to document only. - `"image"` - `"video"` - `"audio"` - `"document"` - `"sticker"` - `type: "media"` - `"media"` - `availability: optional "available" or "unavailable" or "pending"` Response only, inbound parts only: whether the download answers the bytes. available: the file was captured and is retained. unavailable: it is not downloadable now, and unavailable_reason says why; with timed_out the download answers 409 while capture continues and can later answer 200, otherwise it answers 410, or 404 once the file is no longer known. It describes the file, not the exact HTTP answer of a later download, which can also refuse for capacity or authorization. pending: capture has not finished yet; only reads of the conversation return pending, and a message event never does. A message.received event is recorded once every attachment has been captured or has failed, or ten minutes after the message arrived, whichever comes first; an event part without availability is from a historical event and may still be capturing, so retry its download as the 409 Retry-After directs. A message event keeps the value it was recorded with; reads return the current one. Historical messages received before it was recorded omit it. Never accepted on sends. - `"available"` - `"unavailable"` - `"pending"` - `byte_size: optional number` Response only, inbound parts only: the exact size in bytes of the retained attachment, equal to the download's Content-Length. Present only while the bytes are captured and retained — the same lifetime as a working url, ending 30 days after server receipt — so it can be absent from a message event while capture has not completed, and its absence is not final; once present it never changes. Absent rather than zero. Never accepted on sends. - `caption: optional string` Caption rendered with the media. Image, video and document only — a caption on an audio or sticker part is rejected, never dropped. - `filename: optional string` Display filename. Documents only — a filename on any other kind is rejected, never dropped. - `media_id: optional string` Inbound only: the channel's transient media identifier. It expires after seven days and is never an outbound address; an outbound value is rejected with a pointer to media_id and upload_ref as the remedy. - `mime_type: optional string` Response only, inbound parts only: the media type the channel declared when the message arrived, verbatim. It may carry parameters (for example audio/ogg; codecs=opus) and may differ from the Content-Type the download answers with, which describes the retained bytes. Present on the webhook body and on every later read with the same value. Historical messages received before it was recorded omit this field. Never accepted on sends. - `source_url: optional string` Outbound only: a public https URL of the bytes to send, as an alternative to upload_ref. Supply exactly one of upload_ref or source_url. The address is fetched once, before the send is accepted, and its exact bytes are stored as an ordinary upload in this account and key partition; the accepted message and every later read carry that upload's upload_ref, never the address, and no retry fetches it again. The URL must be absolute https on the default port with no credentials and no fragment, must resolve to a public address (every redirect hop included, at most three), and must answer with the complete bytes and their exact media type within the fetch deadline. The bytes are then held to the same media type and size rules as POST /v1/media for the part's kind; a mismatch is refused, never converted. - `unavailable_reason: optional string` Response only, present only when availability is unavailable. An open string: the values today are timed_out, capture_failed and expired, and new values may be added. timed_out: the file was still being retrieved ten minutes after the message arrived, so its message event was recorded without it; retrieval continues and the file may become downloadable later, which reads of the conversation report. capture_failed: the file could not be retrieved. expired: the file was retrieved and is no longer retained, or is no longer known (the download then answers 410 or 404). Treat an unknown value as capture_failed. Never accepted on sends. - `upload_ref: optional string` Outbound only: our durable handle returned by POST /v1/media. Handles visibly begin upload. and are reusable within the account and key partition that created them. - `url: optional string` Response only: stable attachment download URL requiring the account Bearer key on every request. Pending capture returns 409 with Retry-After; retained bytes expire 30 days after server receipt. Historical unbound messages omit this field. Never accepted on sends. - `voice: optional boolean` Audio only. On a send it is optional: true sends the audio as a voice note; false, or leaving it out, sends it as an ordinary audio file. A voice note needs an upload stored as audio/ogg that holds mono Opus audio, sent by upload_ref or source_url within the existing audio size limit. The bytes are sent as supplied: they are never converted or inspected, so encode them as mono Opus before uploading. The recipient sees a play button only when the voice file is 512 KB or smaller; a larger voice note is still delivered but must be downloaded before it plays. On incoming audio parts it is response-only: whether the channel reported the audio as a voice note, verbatim. true means it was recorded with the messaging client's voice-recording feature; false means it was sent as an audio file. Present on the webhook body and on every later read with the same value. Absent on an incoming part means the channel did not say, never that the audio is not a voice note. Other kinds never carry it, and historical messages received before it was recorded omit it. - `Template object { language, name, type, 4 more }` An approved message template — the one part type sendable outside an open customer service window. name and language identify the approved template; parameters fills its named placeholders. Authentication templates use this same generic part: their published parameter schema names exactly one parameter, `code` — the one-time code you generate, 1–15 characters — and the message shows it in its body and behind its code button. Every sendable template is registered and approved ahead of the send and publishes its own parameter schema — a send referencing an unknown template, a missing or unknown parameter, or a value that breaks the template's rules is rejected with a 422 naming the exact field. - `language: string` The template's language-and-locale code, e.g. en_US. - `name: string` The approved template's name. Lowercase letters, digits and underscores only. - `type: "template"` - `"template"` - `buttons: optional array of object { index, payload, type }` Send-time values for this approved template's own dynamic buttons, in ascending index order: a url button whose destination ends in {{1}} takes the value appended there and is REQUIRED; a quick_reply button takes the payload returned to you when it is tapped and is OPTIONAL — omit it and the button returns its label. Fixed buttons have no slot. The approved template's send_schema lists the (index, type) slots and an x-rule stating which are required; omit buttons entirely for a template with no url slot when the labels are what you want back. - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `cards: optional array of object { card_index, kind, upload_ref, 2 more }` Per-card values for an approved media-card carousel. The approved template's send_schema provides structural bounds and an x-rule listing the exact card order, media kind, named body values, and dynamic button slots enforced by runtime L2 validation. Omit for non-carousel templates. - `card_index: number` - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: string` A durable handle returned by POST /v1/media. It is resolved within this key's account and partition, then consumed into a transient channel media identifier only at delivery. - `buttons: optional array of object { index, payload, type }` - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `parameters: optional unknown` Named values for this card's body placeholders. - `header: optional object { kind, upload_ref }` The uploaded media used for this approved template's media header. Omit unless this template's send_schema requires it. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `parameters: optional unknown` Named values for the template's placeholders. The shape is per-template: each registered template publishes its own parameter schema — hand THAT schema to your model when composing a specific template. Omit for templates with no placeholders. - `InteractiveList object { body, button, sections, 3 more }` An interactive list message: body text plus a button that opens a sectioned list of selectable rows. The customer's selection arrives as an inbound interactive_reply part with kind list_reply, carrying the chosen row's id. - `body: string` The message body. - `button: string` Label of the button that opens the list. - `sections: array of object { rows, title }` The list's sections, each holding selectable rows. At most 10 rows in total across ALL sections combined — not 10 per section. - `rows: array of object { id, title, description }` This section's rows. The 10-row limit is on the TOTAL across all sections, so a second section reduces what this one may hold. - `id: string` Your identifier for the row — echoed back as the interactive_reply's id. - `title: string` The row's visible title. - `description: optional string` Secondary text under the title. - `title: optional string` Section title. Required when the list has more than one section. - `type: "interactive_list"` - `"interactive_list"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `InteractiveButtons object { body, buttons, type, 3 more }` An interactive reply-buttons message: body text plus up to three tappable buttons. The customer's tap arrives as an inbound interactive_reply part with kind button_reply, carrying the tapped button's id. - `body: string` The message body. - `buttons: array of object { id, title }` The tappable buttons — at most three. - `id: string` Your identifier for the button — echoed back as the interactive_reply's id. - `title: string` The button's visible label. - `type: "interactive_buttons"` - `"interactive_buttons"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `InteractiveCtaURL object { body, display_text, type, 4 more }` An interactive call-to-action message: body text plus one button that opens a URL. - `body: string` The message body. - `display_text: string` The button's visible label. - `type: "interactive_cta_url"` - `"interactive_cta_url"` - `url: string` The URL the button opens. Must be absolute, with an http or https scheme. - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref, filename }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `filename: optional string` The file name the customer sees on a document header. Documents only. - `InteractiveCarousel object { body, cards, type }` An interactive carousel: one message whose body sits above 2 to 10 horizontally scrolling cards. Each card shows an uploaded image, or a video from a public link, and either one button that opens a URL or reply buttons. A tap on a card's reply button arrives as an inbound template_reply part whose payload is that button's id; nothing else in the reply identifies the card, so the id you choose is the card's identity. - `body: string` The message text shown above the cards. - `cards: array of object { card_index, header, body, 2 more }` The cards, left to right. - `card_index: number` This card's zero-based position: the first card is 0, the next 1, and so on, in array order. - `header: object { kind, upload_ref, url }` The card's media: an image named by upload_ref, or a video named by the public https url it plays from. Every card carries the same kind. - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: optional string` A durable handle returned by POST /v1/media for an image upload. Image cards only. - `url: optional string` The public https address the card's video plays from. Video cards only. It is sent exactly as written and never fetched by this API, so it must be publicly reachable and serve a playable video; a link that does not play is accepted and then reported as a failed delivery (message.failed with channel_refused). - `body: optional string` Optional text below the card's image or video, with at most two line breaks. - `reply_buttons: optional array of object { id, title }` Buttons the customer taps to reply. Use either url_button or reply_buttons on every card. - `id: string` Your identifier for the button, echoed back as the template_reply's payload. Unique across the whole carousel. - `title: string` The button's visible label. - `url_button: optional object { display_text, url }` One button that opens a URL. Use either url_button or reply_buttons on every card. - `display_text: string` The button's visible label. - `url: string` The absolute https URL the button opens. - `type: "interactive_carousel"` - `"interactive_carousel"` - `LocationRequest object { body, type }` Asks the customer to share a location. The response arrives as a location part. - `body: string` Prompt shown above the send-location button. - `type: "location_request"` - `"location_request"` - `ContactRequest object { body, type }` Asks the customer to share their own contact card with one tap. Useful when you know the customer only by a username identifier and need a phone number. The answer arrives as an ordinary contacts part whose card carries origin contact_request; a card the customer shares by hand carries origin other instead. The answer is not linked to your request as a reply: its message carries no reply_to_message_id, so match it by origin and timing. Sendable inside the customer window. - `body: string` Prompt shown above the share-contact button. - `type: "contact_request"` - `"contact_request"` - `AddressRequest object { body, country, type }` Reserved for asking an eligible customer in India to submit a structured address. Sending this part is not available until business and customer eligibility can be verified at acceptance. Address responses already arrive as address_reply parts. - `body: string` Prompt shown above the address form. - `country: "IN"` ISO country code. Structured address requests are currently available only in India. - `"IN"` - `type: "address_request"` - `"address_request"` - `Contacts object { contacts, type }` One or more contact cards. - `contacts: array of object { name, addresses, birthday, 5 more }` The contact cards to send. The channel permits far more; this API caps a message at five, because a message carrying hundreds of cards is a mistake rather than a use case. - `name: object { formatted_name, first_name, last_name, 3 more }` - `formatted_name: string` The contact's full display name. - `first_name: optional string` - `last_name: optional string` - `middle_name: optional string` - `prefix: optional string` - `suffix: optional string` - `addresses: optional array of object { city, country, country_code, 4 more }` - `city: optional string` - `country: optional string` - `country_code: optional string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `state: optional string` - `street: optional string` - `zip: optional string` - `birthday: optional string` The contact's birthday as YYYY-MM-DD. - `emails: optional array of object { email, kind }` - `email: string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `org: optional object { company, department, title }` - `company: optional string` - `department: optional string` - `title: optional string` - `origin: optional string` Response-only: how the customer came to share this card, as the channel reported it, verbatim. contact_request means they tapped the share button on a contact_request you sent; other means they shared a card themselves. New values may appear, so treat any other value as unrecognised rather than as either of these. Absent when the channel did not say, and on cards received before it was recorded. A send carrying it is rejected with a pointer at the member. - `phones: optional array of object { phone, kind, messaging_id }` - `phone: string` The phone number, ideally in +E.164 form. - `kind: optional string` A label for the number, e.g. CELL, MAIN, WORK, HOME. - `messaging_id: optional string` The contact's messaging-account identifier on this channel, when known — makes the card openable in the messaging app. - `urls: optional array of object { url, kind }` - `url: string` - `kind: optional string` A label for the URL, e.g. WORK, HOME. - `type: "contacts"` - `"contacts"` - `Location object { latitude, longitude, type, 2 more }` A location pin. - `latitude: number` Latitude in decimal degrees. - `longitude: number` Longitude in decimal degrees. - `type: "location"` - `"location"` - `address: optional string` The place's address, shown under the name. - `name: optional string` The place's name, shown on the pin. - `Reaction object { emoji, type, channel_message_id, message_id }` An emoji reaction to an earlier message in the chat. message_id is this API's Message.id for the target in both directions: it is what you send, and it is appended to an inbound reaction whenever the target is a message of the same chat. channel_message_id is the channel's opaque identifier and appears on inbound reactions only. - `emoji: string` A single emoji. Send an empty string to remove a previous reaction to the same message. - `type: "reaction"` - `"reaction"` - `channel_message_id: optional string` Inbound only: the channel's opaque identifier for the message being reacted to. Always present on an inbound reaction, beside message_id whenever the target resolved. Match it literally to Message.channel_message_id in the chat transcript; never parse it or compare it with Message.id. - `message_id: optional string` This API's Message.id for the message being reacted to. Outbound: required, and the API resolves it into the channel namespace before sending, so the message must be one this account can see in the chat the send addresses. Inbound: present whenever the target is a message of the same chat, so you can keep only this identifier; absent when the chat does not hold the target. - `InteractiveReply object { id, kind, title, 2 more }` Inbound only — never sendable. The customer's selection from an interactive_list (kind list_reply) or interactive_buttons (kind button_reply) message, carrying the id you assigned to the chosen row or button. - `id: string` The id you assigned to the chosen row or button, exactly as you sent it. - `kind: "list_reply" or "button_reply"` Which interactive message kind was answered. - `"list_reply"` - `"button_reply"` - `title: string` The chosen row's or button's visible title. - `type: "interactive_reply"` - `"interactive_reply"` - `description: optional string` The chosen list row's secondary text, when it had one. - `TemplateReply object { payload, text, type }` Inbound only — never sendable. The customer tapped a quick-reply button on an approved template you sent, or a reply button on a card of an interactive_carousel you sent. payload is the value you set on that button: the template's quick_reply slot payload (or the button's label when you left the slot out), or the carousel card button's id. text is the label the customer saw. A carousel tap carries nothing else that identifies the card, so the id you chose is the card's only identity. For a template tap, the message's reply_to_message_id names the template message that carried the button. Distinct from interactive_reply, which answers an interactive_buttons or interactive_list message. - `payload: string` The quick_reply slot's payload from your send, or the button label when the slot was omitted; for a carousel card, the tapped reply button's id. - `text: string` The tapped button's label, as the customer saw it. - `type: "template_reply"` - `"template_reply"` - `AddressReply object { type, values, saved_address_id }` Inbound only: the structured values submitted in response to an address request. - `type: "address_reply"` - `"address_reply"` - `values: object { address, building_name, city, 8 more }` - `address: optional string` - `building_name: optional string` - `city: optional string` - `floor_number: optional string` - `house_number: optional string` - `landmark_area: optional string` - `name: optional string` - `phone_number: optional string` - `pin_code: optional string` - `state: optional string` - `tower_number: optional string` - `saved_address_id: optional string` Identifier of the selected saved address, when one was selected. - `Order object { catalog_id, items, type, text }` Inbound only — never sendable. An order the customer placed from a product catalog. - `catalog_id: string` The catalog the ordered items belong to. - `items: array of object { currency, price, product_retailer_id, quantity }` The ordered items. - `currency: string` ISO 4217 currency code for price. - `price: number` The per-item price at order time. - `product_retailer_id: string` Your identifier for the product, as registered in the catalog. - `quantity: number` - `type: "order"` - `"order"` - `text: optional string` Free text the customer attached to the order, when any. - `Referral object { type, body, click_id, 7 more }` Inbound only — never sendable. The ad or post context a customer's first message arrived from (for example an ad whose call to action opens a chat). A referral also opens a free-entry-point customer window — see the chat's customer_window. - `type: "referral"` - `"referral"` - `body: optional string` The ad's body text at click time. - `click_id: optional string` The click identifier assigned by the ad platform, for attribution. - `headline: optional string` The ad's headline at click time. - `image_url: optional string` URL of the ad's image creative, when media_kind is image. - `media_kind: optional string` The ad creative's media kind, e.g. image or video. - `source_id: optional string` The ad or post id. - `source_kind: optional string` What the source was, e.g. ad or post. - `source_url: optional string` The URL of the ad or post the customer came from. - `video_url: optional string` URL of the ad's video creative, when media_kind is video. - `System object { body, type, event }` Inbound only — never sendable. A system event in the chat, such as the customer changing their number. New event kinds appear over time; body is always present and human-readable. - `body: string` Human-readable description of the system event. - `type: "system"` - `"system"` - `event: optional string` The system event's kind, when the channel identifies one. New kinds appear over time — treat unknown values as informational. - `Unsupported object { raw, type, kind }` Inbound only — never sendable. A message kind this API does not yet type natively, carried as a typed passthrough: raw holds the channel payload, so a new message kind is never a black box or a silent drop. Native part types for popular kinds are added over time; this part is the compatibility guarantee in the meantime. - `raw: unknown` The channel payload — any JSON value: object, array, string, number, boolean, or null. Deliberately unconstrained, because the whole point of this part is to carry a shape this API does not yet know. For rows written by API version 1.3.0 or later, object member order, number formatting and duplicated members survive storage and read-back. The canonical encoder may compact insignificant whitespace before storage. Rows written before API version 1.3.0 retain normalized JSON only: member order and number formatting may differ, and only the last duplicated member survives. - `type: "unsupported"` - `"unsupported"` - `kind: optional string` The channel's name for the message kind, when it declares one. - `status: string` The message's delivery state as last reported. Inbound messages read `received`: they arrived, and no delivery of ours ran. A message you sent starts `accepted` and moves through `sent`, `delivered` and `read` as the channel reports them, with `failed` as the definitive negative outcome. `unknown` means exactly that: the send is INDETERMINATE and we decline to guess. It is NOT terminal — an indeterminate send is never re-sent, and it resolves to `sent`, `delivered`, `read` or `failed` when the channel's own report arrives — so keep observing rather than treating it as an outcome. States are reported asynchronously on the chat's event sequence, and the set grows additively: treat a value you do not recognise as "no information" rather than failing on it. Retention of this published status follows the chat transcript policy: there is no scheduled pruning, but no fixed minimum availability period is published yet. The present absence of a scheduled age-based sweep is not a promise of indefinite availability. `delivered` is reported by the channel after it accepted the message and can lag by hours, never arrive at all, or be followed by a failure, so do not build timeouts around it arriving promptly. - `channel_message_id: optional string` The channel's opaque identifier for this message, when the channel has assigned one. An inbound reaction's `channel_message_id` matches this field literally; never parse it or compare it with `id`. It is absent while an accepted outbound message has not yet received a channel identifier, and until it is present an inbound reaction to this message carries only `channel_message_id`. - `failure: optional object { code, message }` Why a failed message failed, when we have a reason worth publishing. Present only on `status` `failed`, and not on every one of those: a message can fail for a reason outside the published vocabulary and carry no `failure` at all. Its absence means "no published reason", never "no reason". Most messages the channel refused do carry one: a specific code where one is published, and `channel_refused` for most of the rest; a few kinds of refusal still carry none. `status` stays the thing to branch on. This is additive detail beside it, so an integration written before this field existed still sees a terminal `failed` and behaves exactly as it did. - `code: string` The specific reason. `sender_deregistered` — the number this message was going out from is no longer a registered sending number, and the message never left. This is terminal: it is not a pause and it does not clear, so retrying the same message cannot succeed and that conversation is over. Reach this customer by starting a new one on another of your numbers with a template, exactly as you would any customer whose 24-hour window has closed; `GET /v1/chats` shows which number each conversation uses. You are not billed for a message that failed this way. `quality_hold_expired` — this marketing message remained held by an automatic safety control on its sending line for ten minutes and was not sent. This is terminal: retrying the same message cannot succeed on that conversation. Send marketing from another of your numbers with a template, or contact support about the sending line. You are not billed for a message that failed this way. `target_message_failed` — the message this one quotes or reacts to failed, or its outcome could not be established, before this message went out. This message was therefore never sent, because a quote is never sent without its context. A `message.failed` event reports it. This is terminal: send it again as a new message, without that target or naming one that was sent. You are not billed a channel charge for it, though it still counts toward your platform subscription's message volume. `recipient_country_restricted` — the business behind the sending number is not currently permitted to message customers in this recipient's country, so the message was not delivered. The restriction blocks every message type, including replies inside the customer's 24-hour window. This is terminal for the message: sending it again cannot succeed while the restriction stands. Most countries unlock only when the business has completed business verification and has held an assigned messaging tier of 2,000 or higher for 30 consecutive days. The assigned tier is what counts, not how many messages you send. Brazil and Indonesia also require the business's primary business location to be in that country, at any tier: a business located elsewhere cannot message customers there. Until the business qualifies, sends to that country will keep failing. The channel publishes no list of restricted country pairs and offers no API signal before a send. If the business meets these conditions and the restriction stands, review the messaging policy for the business's category. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `payment_method_required` — the business behind the sending number has no working payment method on its messaging account, so this message was not sent. This is terminal for the message: retrying it cannot succeed until a payment method is added. Add or update the payment method in the messaging account's billing settings, then send again as a new message. Replies inside an open 24-hour customer window are charged too once the sending number's monthly free allowance of them is used up, so they also need a working payment method and can fail this way. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `recipient_phone_number_required` — this customer is known only by a username identifier, not a phone number, and this message can be delivered only to a phone number, so it was not sent. This is terminal for the message: sending it again to this customer cannot succeed. One-time-code templates (copy code, one-tap or zero-tap autofill) are the usual cause; deliver the code another way. Other messages, including templates without a one-time-code button, can still be sent to this customer. When the template is known in advance to carry a one-time-code button, the send is refused at once with the error `recipient_phone_number_required` instead and nothing is accepted. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `business_restricted` — this message was refused because the business behind the sending number is most likely restricted on its messaging account, so it was not sent. This is terminal for the message: sending it again will not succeed while the restriction stands. Review the status of the business's messaging account, and if the business believes it complies with the messaging policies, request a review of the restriction. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `channel_refused` — this message was refused upstream and was not sent, for a reason that has no more specific code here, and it will not be retried automatically. Contact support with this message's `id` to learn the reason and whether sending it again can succeed. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. A more specific code may be published for some of these refusals in a later release; treat a code you do not recognise exactly as you treat this one. - `message: string` Human-readable, written for a person reading it. Do not branch on it. - `from: optional string` The number this message left by, or arrived on, in E.164 (leading `+`). Every message in one conversation carries the same value — a conversation never moves to another number. Absent only if the number is no longer one of yours. - `from_selection: optional object { reason }` Present only when this service chose the sending number for you — that is, when you omitted `from`. A send that named `from` omits this rather than reporting a choice nobody made. - `reason: string` Why this number was used. Exactly one of: - `reused_active_chat` — this customer already had a conversation and it continues on the same number. - `new_best_number` — there was no existing conversation, so the best available number was chosen. Like every other vocabulary here it is a plain string that may grow additively; treat a value you do not recognise as "chosen for you". - `reply_to_message_id: optional string` This API's `id` of the earlier message in this chat that this message replies to. On an inbound message it is the message the customer quoted; on an outbound message it is the `reply_to_message_id` you sent. Look the value up in this chat's transcript to show what was answered; it is the same namespace as `id`, never a channel identifier. Absent when there is no reply context this API can resolve — a message that quotes nothing, or one that quotes a message this API never recorded in this chat. Treat absence as "no reply context available", not as proof the message was not a reply. - `zero_retention: optional true` True when the message is under zero-day retention: its content is not kept, so later reads and idempotent retries return empty `parts`. The original send response still carries the content. Retention applies only within Linq's systems. The WhatsApp channel operator's own processing and retention of message content are governed by its terms and are not affected by this setting. - `true` ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/chats/$CHAT/messages \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" \ -d '{ "parts": [ { "body": "body", "type": "text" } ] }' ``` #### Response ```json { "id": "id", "chat_id": "chat_id", "created_at": "2019-12-27T18:11:19.117Z", "direction": "inbound", "parts": [ { "body": "body", "type": "text", "preview_url": true } ], "status": "status", "channel_message_id": "channel_message_id", "failure": { "code": "code", "message": "message" }, "from": "from", "from_selection": { "reason": "reason" }, "reply_to_message_id": "reply_to_message_id", "zero_retention": true } ``` --- # Send a message in a chat URL: https://docs.linqapp.com/channel/whatsapp/api/resources/chats/subresources/messages/methods/send/ **post** `/v1/chats/{chat}/messages` Sends a reply on an existing chat's unchanged sending number. The chat supplies the customer and sender; this operation never creates, moves, repins or fails over a conversation. Acceptance and refusal semantics are otherwise identical to `POST /v1/messages`. ### Path Parameters - `chat: string` ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `parts: array of object { body, type, preview_url } or object { kind, type, availability, 10 more } or object { language, name, type, 4 more } or 10 more` The message content — sendable parts only, at least one. **One outbound part per request.** Each request has its own acceptance result and optional idempotency key. Each accepted request maps to one native channel message with its own identifier, delivery outcome and charge evidence. A request carrying more than one part is refused with HTTP 422 (`multiple_parts_not_available`, a 1xxx `error.code`, 1019); the API neither fans it out nor offers an atomic batch. Separate requests are independent, and no cross-request delivery or receipt order is promised. A customer known only by a username identifier can receive every message type except a one-time-code template (a copy-code, one-tap or zero-tap autofill button), which can be delivered only to a phone number. When the template is known to carry such a button, the send is refused with HTTP 422 `recipient_phone_number_required` (a 4xxx `error.code`, 4011), pointered at the part, and nothing is accepted; deliver the code another way. - `Text object { body, type, preview_url }` A plain text message. - `body: string` The message text. URLs render as tappable links. - `type: "text"` - `"text"` - `preview_url: optional boolean` Render a preview card for the first URL in body. Defaults to false. - `Media object { kind, type, availability, 10 more }` A media message — image, video, audio, document, or sticker. The two identifiers are distinct namespaces: inbound media carries the channel's transient media_id; outbound media carries our durable upload_ref from POST /v1/media. - `kind: "image" or "video" or "audio" or 2 more` Which kind of media this is. Captions apply to image, video and document only; filename applies to document only. - `"image"` - `"video"` - `"audio"` - `"document"` - `"sticker"` - `type: "media"` - `"media"` - `availability: optional "available" or "unavailable" or "pending"` Response only, inbound parts only: whether the download answers the bytes. available: the file was captured and is retained. unavailable: it is not downloadable now, and unavailable_reason says why; with timed_out the download answers 409 while capture continues and can later answer 200, otherwise it answers 410, or 404 once the file is no longer known. It describes the file, not the exact HTTP answer of a later download, which can also refuse for capacity or authorization. pending: capture has not finished yet; only reads of the conversation return pending, and a message event never does. A message.received event is recorded once every attachment has been captured or has failed, or ten minutes after the message arrived, whichever comes first; an event part without availability is from a historical event and may still be capturing, so retry its download as the 409 Retry-After directs. A message event keeps the value it was recorded with; reads return the current one. Historical messages received before it was recorded omit it. Never accepted on sends. - `"available"` - `"unavailable"` - `"pending"` - `byte_size: optional number` Response only, inbound parts only: the exact size in bytes of the retained attachment, equal to the download's Content-Length. Present only while the bytes are captured and retained — the same lifetime as a working url, ending 30 days after server receipt — so it can be absent from a message event while capture has not completed, and its absence is not final; once present it never changes. Absent rather than zero. Never accepted on sends. - `caption: optional string` Caption rendered with the media. Image, video and document only — a caption on an audio or sticker part is rejected, never dropped. - `filename: optional string` Display filename. Documents only — a filename on any other kind is rejected, never dropped. - `media_id: optional string` Inbound only: the channel's transient media identifier. It expires after seven days and is never an outbound address; an outbound value is rejected with a pointer to media_id and upload_ref as the remedy. - `mime_type: optional string` Response only, inbound parts only: the media type the channel declared when the message arrived, verbatim. It may carry parameters (for example audio/ogg; codecs=opus) and may differ from the Content-Type the download answers with, which describes the retained bytes. Present on the webhook body and on every later read with the same value. Historical messages received before it was recorded omit this field. Never accepted on sends. - `source_url: optional string` Outbound only: a public https URL of the bytes to send, as an alternative to upload_ref. Supply exactly one of upload_ref or source_url. The address is fetched once, before the send is accepted, and its exact bytes are stored as an ordinary upload in this account and key partition; the accepted message and every later read carry that upload's upload_ref, never the address, and no retry fetches it again. The URL must be absolute https on the default port with no credentials and no fragment, must resolve to a public address (every redirect hop included, at most three), and must answer with the complete bytes and their exact media type within the fetch deadline. The bytes are then held to the same media type and size rules as POST /v1/media for the part's kind; a mismatch is refused, never converted. - `unavailable_reason: optional string` Response only, present only when availability is unavailable. An open string: the values today are timed_out, capture_failed and expired, and new values may be added. timed_out: the file was still being retrieved ten minutes after the message arrived, so its message event was recorded without it; retrieval continues and the file may become downloadable later, which reads of the conversation report. capture_failed: the file could not be retrieved. expired: the file was retrieved and is no longer retained, or is no longer known (the download then answers 410 or 404). Treat an unknown value as capture_failed. Never accepted on sends. - `upload_ref: optional string` Outbound only: our durable handle returned by POST /v1/media. Handles visibly begin upload. and are reusable within the account and key partition that created them. - `url: optional string` Response only: stable attachment download URL requiring the account Bearer key on every request. Pending capture returns 409 with Retry-After; retained bytes expire 30 days after server receipt. Historical unbound messages omit this field. Never accepted on sends. - `voice: optional boolean` Audio only. On a send it is optional: true sends the audio as a voice note; false, or leaving it out, sends it as an ordinary audio file. A voice note needs an upload stored as audio/ogg that holds mono Opus audio, sent by upload_ref or source_url within the existing audio size limit. The bytes are sent as supplied: they are never converted or inspected, so encode them as mono Opus before uploading. The recipient sees a play button only when the voice file is 512 KB or smaller; a larger voice note is still delivered but must be downloaded before it plays. On incoming audio parts it is response-only: whether the channel reported the audio as a voice note, verbatim. true means it was recorded with the messaging client's voice-recording feature; false means it was sent as an audio file. Present on the webhook body and on every later read with the same value. Absent on an incoming part means the channel did not say, never that the audio is not a voice note. Other kinds never carry it, and historical messages received before it was recorded omit it. - `Template object { language, name, type, 4 more }` An approved message template — the one part type sendable outside an open customer service window. name and language identify the approved template; parameters fills its named placeholders. Authentication templates use this same generic part: their published parameter schema names exactly one parameter, `code` — the one-time code you generate, 1–15 characters — and the message shows it in its body and behind its code button. Every sendable template is registered and approved ahead of the send and publishes its own parameter schema — a send referencing an unknown template, a missing or unknown parameter, or a value that breaks the template's rules is rejected with a 422 naming the exact field. - `language: string` The template's language-and-locale code, e.g. en_US. - `name: string` The approved template's name. Lowercase letters, digits and underscores only. - `type: "template"` - `"template"` - `buttons: optional array of object { index, payload, type }` Send-time values for this approved template's own dynamic buttons, in ascending index order: a url button whose destination ends in {{1}} takes the value appended there and is REQUIRED; a quick_reply button takes the payload returned to you when it is tapped and is OPTIONAL — omit it and the button returns its label. Fixed buttons have no slot. The approved template's send_schema lists the (index, type) slots and an x-rule stating which are required; omit buttons entirely for a template with no url slot when the labels are what you want back. - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `cards: optional array of object { card_index, kind, upload_ref, 2 more }` Per-card values for an approved media-card carousel. The approved template's send_schema provides structural bounds and an x-rule listing the exact card order, media kind, named body values, and dynamic button slots enforced by runtime L2 validation. Omit for non-carousel templates. - `card_index: number` - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: string` A durable handle returned by POST /v1/media. It is resolved within this key's account and partition, then consumed into a transient channel media identifier only at delivery. - `buttons: optional array of object { index, payload, type }` - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `parameters: optional unknown` Named values for this card's body placeholders. - `header: optional object { kind, upload_ref }` The uploaded media used for this approved template's media header. Omit unless this template's send_schema requires it. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `parameters: optional unknown` Named values for the template's placeholders. The shape is per-template: each registered template publishes its own parameter schema — hand THAT schema to your model when composing a specific template. Omit for templates with no placeholders. - `InteractiveList object { body, button, sections, 3 more }` An interactive list message: body text plus a button that opens a sectioned list of selectable rows. The customer's selection arrives as an inbound interactive_reply part with kind list_reply, carrying the chosen row's id. - `body: string` The message body. - `button: string` Label of the button that opens the list. - `sections: array of object { rows, title }` The list's sections, each holding selectable rows. At most 10 rows in total across ALL sections combined — not 10 per section. - `rows: array of object { id, title, description }` This section's rows. The 10-row limit is on the TOTAL across all sections, so a second section reduces what this one may hold. - `id: string` Your identifier for the row — echoed back as the interactive_reply's id. - `title: string` The row's visible title. - `description: optional string` Secondary text under the title. - `title: optional string` Section title. Required when the list has more than one section. - `type: "interactive_list"` - `"interactive_list"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `InteractiveButtons object { body, buttons, type, 3 more }` An interactive reply-buttons message: body text plus up to three tappable buttons. The customer's tap arrives as an inbound interactive_reply part with kind button_reply, carrying the tapped button's id. - `body: string` The message body. - `buttons: array of object { id, title }` The tappable buttons — at most three. - `id: string` Your identifier for the button — echoed back as the interactive_reply's id. - `title: string` The button's visible label. - `type: "interactive_buttons"` - `"interactive_buttons"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `InteractiveCtaURL object { body, display_text, type, 4 more }` An interactive call-to-action message: body text plus one button that opens a URL. - `body: string` The message body. - `display_text: string` The button's visible label. - `type: "interactive_cta_url"` - `"interactive_cta_url"` - `url: string` The URL the button opens. Must be absolute, with an http or https scheme. - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref, filename }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `filename: optional string` The file name the customer sees on a document header. Documents only. - `InteractiveCarousel object { body, cards, type }` An interactive carousel: one message whose body sits above 2 to 10 horizontally scrolling cards. Each card shows an uploaded image, or a video from a public link, and either one button that opens a URL or reply buttons. A tap on a card's reply button arrives as an inbound template_reply part whose payload is that button's id; nothing else in the reply identifies the card, so the id you choose is the card's identity. - `body: string` The message text shown above the cards. - `cards: array of object { card_index, header, body, 2 more }` The cards, left to right. - `card_index: number` This card's zero-based position: the first card is 0, the next 1, and so on, in array order. - `header: object { kind, upload_ref, url }` The card's media: an image named by upload_ref, or a video named by the public https url it plays from. Every card carries the same kind. - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: optional string` A durable handle returned by POST /v1/media for an image upload. Image cards only. - `url: optional string` The public https address the card's video plays from. Video cards only. It is sent exactly as written and never fetched by this API, so it must be publicly reachable and serve a playable video; a link that does not play is accepted and then reported as a failed delivery (message.failed with channel_refused). - `body: optional string` Optional text below the card's image or video, with at most two line breaks. - `reply_buttons: optional array of object { id, title }` Buttons the customer taps to reply. Use either url_button or reply_buttons on every card. - `id: string` Your identifier for the button, echoed back as the template_reply's payload. Unique across the whole carousel. - `title: string` The button's visible label. - `url_button: optional object { display_text, url }` One button that opens a URL. Use either url_button or reply_buttons on every card. - `display_text: string` The button's visible label. - `url: string` The absolute https URL the button opens. - `type: "interactive_carousel"` - `"interactive_carousel"` - `LocationRequest object { body, type }` Asks the customer to share a location. The response arrives as a location part. - `body: string` Prompt shown above the send-location button. - `type: "location_request"` - `"location_request"` - `ContactRequest object { body, type }` Asks the customer to share their own contact card with one tap. Useful when you know the customer only by a username identifier and need a phone number. The answer arrives as an ordinary contacts part whose card carries origin contact_request; a card the customer shares by hand carries origin other instead. The answer is not linked to your request as a reply: its message carries no reply_to_message_id, so match it by origin and timing. Sendable inside the customer window. - `body: string` Prompt shown above the share-contact button. - `type: "contact_request"` - `"contact_request"` - `AddressRequest object { body, country, type }` Reserved for asking an eligible customer in India to submit a structured address. Sending this part is not available until business and customer eligibility can be verified at acceptance. Address responses already arrive as address_reply parts. - `body: string` Prompt shown above the address form. - `country: "IN"` ISO country code. Structured address requests are currently available only in India. - `"IN"` - `type: "address_request"` - `"address_request"` - `Contacts object { contacts, type }` One or more contact cards. - `contacts: array of object { name, addresses, birthday, 5 more }` The contact cards to send. The channel permits far more; this API caps a message at five, because a message carrying hundreds of cards is a mistake rather than a use case. - `name: object { formatted_name, first_name, last_name, 3 more }` - `formatted_name: string` The contact's full display name. - `first_name: optional string` - `last_name: optional string` - `middle_name: optional string` - `prefix: optional string` - `suffix: optional string` - `addresses: optional array of object { city, country, country_code, 4 more }` - `city: optional string` - `country: optional string` - `country_code: optional string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `state: optional string` - `street: optional string` - `zip: optional string` - `birthday: optional string` The contact's birthday as YYYY-MM-DD. - `emails: optional array of object { email, kind }` - `email: string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `org: optional object { company, department, title }` - `company: optional string` - `department: optional string` - `title: optional string` - `origin: optional string` Response-only: how the customer came to share this card, as the channel reported it, verbatim. contact_request means they tapped the share button on a contact_request you sent; other means they shared a card themselves. New values may appear, so treat any other value as unrecognised rather than as either of these. Absent when the channel did not say, and on cards received before it was recorded. A send carrying it is rejected with a pointer at the member. - `phones: optional array of object { phone, kind, messaging_id }` - `phone: string` The phone number, ideally in +E.164 form. - `kind: optional string` A label for the number, e.g. CELL, MAIN, WORK, HOME. - `messaging_id: optional string` The contact's messaging-account identifier on this channel, when known — makes the card openable in the messaging app. - `urls: optional array of object { url, kind }` - `url: string` - `kind: optional string` A label for the URL, e.g. WORK, HOME. - `type: "contacts"` - `"contacts"` - `Location object { latitude, longitude, type, 2 more }` A location pin. - `latitude: number` Latitude in decimal degrees. - `longitude: number` Longitude in decimal degrees. - `type: "location"` - `"location"` - `address: optional string` The place's address, shown under the name. - `name: optional string` The place's name, shown on the pin. - `Reaction object { emoji, type, channel_message_id, message_id }` An emoji reaction to an earlier message in the chat. message_id is this API's Message.id for the target in both directions: it is what you send, and it is appended to an inbound reaction whenever the target is a message of the same chat. channel_message_id is the channel's opaque identifier and appears on inbound reactions only. - `emoji: string` A single emoji. Send an empty string to remove a previous reaction to the same message. - `type: "reaction"` - `"reaction"` - `channel_message_id: optional string` Inbound only: the channel's opaque identifier for the message being reacted to. Always present on an inbound reaction, beside message_id whenever the target resolved. Match it literally to Message.channel_message_id in the chat transcript; never parse it or compare it with Message.id. - `message_id: optional string` This API's Message.id for the message being reacted to. Outbound: required, and the API resolves it into the channel namespace before sending, so the message must be one this account can see in the chat the send addresses. Inbound: present whenever the target is a message of the same chat, so you can keep only this identifier; absent when the chat does not hold the target. - `reply_to_message_id: optional string` Our opaque `Message.id` for an earlier message in this same chat. The accepted message reads back with the same `reply_to_message_id`, and an inbound message that quotes one of yours carries the quoted message's `id` in the same field. - `send_at: optional string` RESERVED — scheduled sends are not yet available. Any value is refused. ### Returns - `AcceptedMessage object { id, chat_id, created_at, 9 more }` An accepted send: the message, plus how its sending number was chosen. - `id: string` This API's message id. Put this value in an outbound reaction's `message_id`; an inbound reaction to this message carries the same value in its `message_id`, so this is the one identifier you need to keep. Mark-as-read targets the latest unread inbound message in a chat, so it takes the chat id. - `chat_id: string` The chat this message belongs to. - `created_at: string` - `direction: "inbound" or "outbound"` `inbound` (from the customer) or `outbound` (sent by you). - `"inbound"` - `"outbound"` - `parts: array of object { body, type, preview_url } or object { kind, type, availability, 10 more } or object { language, name, type, 4 more } or 17 more` The message content — sendable parts, plus the inbound-only types on inbound messages. Empty only when `zero_retention` is true, or when an idempotent retry returns an ephemeral message whose content retention cleanup has removed. - `Text object { body, type, preview_url }` A plain text message. - `body: string` The message text. URLs render as tappable links. - `type: "text"` - `"text"` - `preview_url: optional boolean` Render a preview card for the first URL in body. Defaults to false. - `Media object { kind, type, availability, 10 more }` A media message — image, video, audio, document, or sticker. The two identifiers are distinct namespaces: inbound media carries the channel's transient media_id; outbound media carries our durable upload_ref from POST /v1/media. - `kind: "image" or "video" or "audio" or 2 more` Which kind of media this is. Captions apply to image, video and document only; filename applies to document only. - `"image"` - `"video"` - `"audio"` - `"document"` - `"sticker"` - `type: "media"` - `"media"` - `availability: optional "available" or "unavailable" or "pending"` Response only, inbound parts only: whether the download answers the bytes. available: the file was captured and is retained. unavailable: it is not downloadable now, and unavailable_reason says why; with timed_out the download answers 409 while capture continues and can later answer 200, otherwise it answers 410, or 404 once the file is no longer known. It describes the file, not the exact HTTP answer of a later download, which can also refuse for capacity or authorization. pending: capture has not finished yet; only reads of the conversation return pending, and a message event never does. A message.received event is recorded once every attachment has been captured or has failed, or ten minutes after the message arrived, whichever comes first; an event part without availability is from a historical event and may still be capturing, so retry its download as the 409 Retry-After directs. A message event keeps the value it was recorded with; reads return the current one. Historical messages received before it was recorded omit it. Never accepted on sends. - `"available"` - `"unavailable"` - `"pending"` - `byte_size: optional number` Response only, inbound parts only: the exact size in bytes of the retained attachment, equal to the download's Content-Length. Present only while the bytes are captured and retained — the same lifetime as a working url, ending 30 days after server receipt — so it can be absent from a message event while capture has not completed, and its absence is not final; once present it never changes. Absent rather than zero. Never accepted on sends. - `caption: optional string` Caption rendered with the media. Image, video and document only — a caption on an audio or sticker part is rejected, never dropped. - `filename: optional string` Display filename. Documents only — a filename on any other kind is rejected, never dropped. - `media_id: optional string` Inbound only: the channel's transient media identifier. It expires after seven days and is never an outbound address; an outbound value is rejected with a pointer to media_id and upload_ref as the remedy. - `mime_type: optional string` Response only, inbound parts only: the media type the channel declared when the message arrived, verbatim. It may carry parameters (for example audio/ogg; codecs=opus) and may differ from the Content-Type the download answers with, which describes the retained bytes. Present on the webhook body and on every later read with the same value. Historical messages received before it was recorded omit this field. Never accepted on sends. - `source_url: optional string` Outbound only: a public https URL of the bytes to send, as an alternative to upload_ref. Supply exactly one of upload_ref or source_url. The address is fetched once, before the send is accepted, and its exact bytes are stored as an ordinary upload in this account and key partition; the accepted message and every later read carry that upload's upload_ref, never the address, and no retry fetches it again. The URL must be absolute https on the default port with no credentials and no fragment, must resolve to a public address (every redirect hop included, at most three), and must answer with the complete bytes and their exact media type within the fetch deadline. The bytes are then held to the same media type and size rules as POST /v1/media for the part's kind; a mismatch is refused, never converted. - `unavailable_reason: optional string` Response only, present only when availability is unavailable. An open string: the values today are timed_out, capture_failed and expired, and new values may be added. timed_out: the file was still being retrieved ten minutes after the message arrived, so its message event was recorded without it; retrieval continues and the file may become downloadable later, which reads of the conversation report. capture_failed: the file could not be retrieved. expired: the file was retrieved and is no longer retained, or is no longer known (the download then answers 410 or 404). Treat an unknown value as capture_failed. Never accepted on sends. - `upload_ref: optional string` Outbound only: our durable handle returned by POST /v1/media. Handles visibly begin upload. and are reusable within the account and key partition that created them. - `url: optional string` Response only: stable attachment download URL requiring the account Bearer key on every request. Pending capture returns 409 with Retry-After; retained bytes expire 30 days after server receipt. Historical unbound messages omit this field. Never accepted on sends. - `voice: optional boolean` Audio only. On a send it is optional: true sends the audio as a voice note; false, or leaving it out, sends it as an ordinary audio file. A voice note needs an upload stored as audio/ogg that holds mono Opus audio, sent by upload_ref or source_url within the existing audio size limit. The bytes are sent as supplied: they are never converted or inspected, so encode them as mono Opus before uploading. The recipient sees a play button only when the voice file is 512 KB or smaller; a larger voice note is still delivered but must be downloaded before it plays. On incoming audio parts it is response-only: whether the channel reported the audio as a voice note, verbatim. true means it was recorded with the messaging client's voice-recording feature; false means it was sent as an audio file. Present on the webhook body and on every later read with the same value. Absent on an incoming part means the channel did not say, never that the audio is not a voice note. Other kinds never carry it, and historical messages received before it was recorded omit it. - `Template object { language, name, type, 4 more }` An approved message template — the one part type sendable outside an open customer service window. name and language identify the approved template; parameters fills its named placeholders. Authentication templates use this same generic part: their published parameter schema names exactly one parameter, `code` — the one-time code you generate, 1–15 characters — and the message shows it in its body and behind its code button. Every sendable template is registered and approved ahead of the send and publishes its own parameter schema — a send referencing an unknown template, a missing or unknown parameter, or a value that breaks the template's rules is rejected with a 422 naming the exact field. - `language: string` The template's language-and-locale code, e.g. en_US. - `name: string` The approved template's name. Lowercase letters, digits and underscores only. - `type: "template"` - `"template"` - `buttons: optional array of object { index, payload, type }` Send-time values for this approved template's own dynamic buttons, in ascending index order: a url button whose destination ends in {{1}} takes the value appended there and is REQUIRED; a quick_reply button takes the payload returned to you when it is tapped and is OPTIONAL — omit it and the button returns its label. Fixed buttons have no slot. The approved template's send_schema lists the (index, type) slots and an x-rule stating which are required; omit buttons entirely for a template with no url slot when the labels are what you want back. - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `cards: optional array of object { card_index, kind, upload_ref, 2 more }` Per-card values for an approved media-card carousel. The approved template's send_schema provides structural bounds and an x-rule listing the exact card order, media kind, named body values, and dynamic button slots enforced by runtime L2 validation. Omit for non-carousel templates. - `card_index: number` - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: string` A durable handle returned by POST /v1/media. It is resolved within this key's account and partition, then consumed into a transient channel media identifier only at delivery. - `buttons: optional array of object { index, payload, type }` - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `parameters: optional unknown` Named values for this card's body placeholders. - `header: optional object { kind, upload_ref }` The uploaded media used for this approved template's media header. Omit unless this template's send_schema requires it. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `parameters: optional unknown` Named values for the template's placeholders. The shape is per-template: each registered template publishes its own parameter schema — hand THAT schema to your model when composing a specific template. Omit for templates with no placeholders. - `InteractiveList object { body, button, sections, 3 more }` An interactive list message: body text plus a button that opens a sectioned list of selectable rows. The customer's selection arrives as an inbound interactive_reply part with kind list_reply, carrying the chosen row's id. - `body: string` The message body. - `button: string` Label of the button that opens the list. - `sections: array of object { rows, title }` The list's sections, each holding selectable rows. At most 10 rows in total across ALL sections combined — not 10 per section. - `rows: array of object { id, title, description }` This section's rows. The 10-row limit is on the TOTAL across all sections, so a second section reduces what this one may hold. - `id: string` Your identifier for the row — echoed back as the interactive_reply's id. - `title: string` The row's visible title. - `description: optional string` Secondary text under the title. - `title: optional string` Section title. Required when the list has more than one section. - `type: "interactive_list"` - `"interactive_list"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `InteractiveButtons object { body, buttons, type, 3 more }` An interactive reply-buttons message: body text plus up to three tappable buttons. The customer's tap arrives as an inbound interactive_reply part with kind button_reply, carrying the tapped button's id. - `body: string` The message body. - `buttons: array of object { id, title }` The tappable buttons — at most three. - `id: string` Your identifier for the button — echoed back as the interactive_reply's id. - `title: string` The button's visible label. - `type: "interactive_buttons"` - `"interactive_buttons"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `InteractiveCtaURL object { body, display_text, type, 4 more }` An interactive call-to-action message: body text plus one button that opens a URL. - `body: string` The message body. - `display_text: string` The button's visible label. - `type: "interactive_cta_url"` - `"interactive_cta_url"` - `url: string` The URL the button opens. Must be absolute, with an http or https scheme. - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref, filename }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `filename: optional string` The file name the customer sees on a document header. Documents only. - `InteractiveCarousel object { body, cards, type }` An interactive carousel: one message whose body sits above 2 to 10 horizontally scrolling cards. Each card shows an uploaded image, or a video from a public link, and either one button that opens a URL or reply buttons. A tap on a card's reply button arrives as an inbound template_reply part whose payload is that button's id; nothing else in the reply identifies the card, so the id you choose is the card's identity. - `body: string` The message text shown above the cards. - `cards: array of object { card_index, header, body, 2 more }` The cards, left to right. - `card_index: number` This card's zero-based position: the first card is 0, the next 1, and so on, in array order. - `header: object { kind, upload_ref, url }` The card's media: an image named by upload_ref, or a video named by the public https url it plays from. Every card carries the same kind. - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: optional string` A durable handle returned by POST /v1/media for an image upload. Image cards only. - `url: optional string` The public https address the card's video plays from. Video cards only. It is sent exactly as written and never fetched by this API, so it must be publicly reachable and serve a playable video; a link that does not play is accepted and then reported as a failed delivery (message.failed with channel_refused). - `body: optional string` Optional text below the card's image or video, with at most two line breaks. - `reply_buttons: optional array of object { id, title }` Buttons the customer taps to reply. Use either url_button or reply_buttons on every card. - `id: string` Your identifier for the button, echoed back as the template_reply's payload. Unique across the whole carousel. - `title: string` The button's visible label. - `url_button: optional object { display_text, url }` One button that opens a URL. Use either url_button or reply_buttons on every card. - `display_text: string` The button's visible label. - `url: string` The absolute https URL the button opens. - `type: "interactive_carousel"` - `"interactive_carousel"` - `LocationRequest object { body, type }` Asks the customer to share a location. The response arrives as a location part. - `body: string` Prompt shown above the send-location button. - `type: "location_request"` - `"location_request"` - `ContactRequest object { body, type }` Asks the customer to share their own contact card with one tap. Useful when you know the customer only by a username identifier and need a phone number. The answer arrives as an ordinary contacts part whose card carries origin contact_request; a card the customer shares by hand carries origin other instead. The answer is not linked to your request as a reply: its message carries no reply_to_message_id, so match it by origin and timing. Sendable inside the customer window. - `body: string` Prompt shown above the share-contact button. - `type: "contact_request"` - `"contact_request"` - `AddressRequest object { body, country, type }` Reserved for asking an eligible customer in India to submit a structured address. Sending this part is not available until business and customer eligibility can be verified at acceptance. Address responses already arrive as address_reply parts. - `body: string` Prompt shown above the address form. - `country: "IN"` ISO country code. Structured address requests are currently available only in India. - `"IN"` - `type: "address_request"` - `"address_request"` - `Contacts object { contacts, type }` One or more contact cards. - `contacts: array of object { name, addresses, birthday, 5 more }` The contact cards to send. The channel permits far more; this API caps a message at five, because a message carrying hundreds of cards is a mistake rather than a use case. - `name: object { formatted_name, first_name, last_name, 3 more }` - `formatted_name: string` The contact's full display name. - `first_name: optional string` - `last_name: optional string` - `middle_name: optional string` - `prefix: optional string` - `suffix: optional string` - `addresses: optional array of object { city, country, country_code, 4 more }` - `city: optional string` - `country: optional string` - `country_code: optional string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `state: optional string` - `street: optional string` - `zip: optional string` - `birthday: optional string` The contact's birthday as YYYY-MM-DD. - `emails: optional array of object { email, kind }` - `email: string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `org: optional object { company, department, title }` - `company: optional string` - `department: optional string` - `title: optional string` - `origin: optional string` Response-only: how the customer came to share this card, as the channel reported it, verbatim. contact_request means they tapped the share button on a contact_request you sent; other means they shared a card themselves. New values may appear, so treat any other value as unrecognised rather than as either of these. Absent when the channel did not say, and on cards received before it was recorded. A send carrying it is rejected with a pointer at the member. - `phones: optional array of object { phone, kind, messaging_id }` - `phone: string` The phone number, ideally in +E.164 form. - `kind: optional string` A label for the number, e.g. CELL, MAIN, WORK, HOME. - `messaging_id: optional string` The contact's messaging-account identifier on this channel, when known — makes the card openable in the messaging app. - `urls: optional array of object { url, kind }` - `url: string` - `kind: optional string` A label for the URL, e.g. WORK, HOME. - `type: "contacts"` - `"contacts"` - `Location object { latitude, longitude, type, 2 more }` A location pin. - `latitude: number` Latitude in decimal degrees. - `longitude: number` Longitude in decimal degrees. - `type: "location"` - `"location"` - `address: optional string` The place's address, shown under the name. - `name: optional string` The place's name, shown on the pin. - `Reaction object { emoji, type, channel_message_id, message_id }` An emoji reaction to an earlier message in the chat. message_id is this API's Message.id for the target in both directions: it is what you send, and it is appended to an inbound reaction whenever the target is a message of the same chat. channel_message_id is the channel's opaque identifier and appears on inbound reactions only. - `emoji: string` A single emoji. Send an empty string to remove a previous reaction to the same message. - `type: "reaction"` - `"reaction"` - `channel_message_id: optional string` Inbound only: the channel's opaque identifier for the message being reacted to. Always present on an inbound reaction, beside message_id whenever the target resolved. Match it literally to Message.channel_message_id in the chat transcript; never parse it or compare it with Message.id. - `message_id: optional string` This API's Message.id for the message being reacted to. Outbound: required, and the API resolves it into the channel namespace before sending, so the message must be one this account can see in the chat the send addresses. Inbound: present whenever the target is a message of the same chat, so you can keep only this identifier; absent when the chat does not hold the target. - `InteractiveReply object { id, kind, title, 2 more }` Inbound only — never sendable. The customer's selection from an interactive_list (kind list_reply) or interactive_buttons (kind button_reply) message, carrying the id you assigned to the chosen row or button. - `id: string` The id you assigned to the chosen row or button, exactly as you sent it. - `kind: "list_reply" or "button_reply"` Which interactive message kind was answered. - `"list_reply"` - `"button_reply"` - `title: string` The chosen row's or button's visible title. - `type: "interactive_reply"` - `"interactive_reply"` - `description: optional string` The chosen list row's secondary text, when it had one. - `TemplateReply object { payload, text, type }` Inbound only — never sendable. The customer tapped a quick-reply button on an approved template you sent, or a reply button on a card of an interactive_carousel you sent. payload is the value you set on that button: the template's quick_reply slot payload (or the button's label when you left the slot out), or the carousel card button's id. text is the label the customer saw. A carousel tap carries nothing else that identifies the card, so the id you chose is the card's only identity. For a template tap, the message's reply_to_message_id names the template message that carried the button. Distinct from interactive_reply, which answers an interactive_buttons or interactive_list message. - `payload: string` The quick_reply slot's payload from your send, or the button label when the slot was omitted; for a carousel card, the tapped reply button's id. - `text: string` The tapped button's label, as the customer saw it. - `type: "template_reply"` - `"template_reply"` - `AddressReply object { type, values, saved_address_id }` Inbound only: the structured values submitted in response to an address request. - `type: "address_reply"` - `"address_reply"` - `values: object { address, building_name, city, 8 more }` - `address: optional string` - `building_name: optional string` - `city: optional string` - `floor_number: optional string` - `house_number: optional string` - `landmark_area: optional string` - `name: optional string` - `phone_number: optional string` - `pin_code: optional string` - `state: optional string` - `tower_number: optional string` - `saved_address_id: optional string` Identifier of the selected saved address, when one was selected. - `Order object { catalog_id, items, type, text }` Inbound only — never sendable. An order the customer placed from a product catalog. - `catalog_id: string` The catalog the ordered items belong to. - `items: array of object { currency, price, product_retailer_id, quantity }` The ordered items. - `currency: string` ISO 4217 currency code for price. - `price: number` The per-item price at order time. - `product_retailer_id: string` Your identifier for the product, as registered in the catalog. - `quantity: number` - `type: "order"` - `"order"` - `text: optional string` Free text the customer attached to the order, when any. - `Referral object { type, body, click_id, 7 more }` Inbound only — never sendable. The ad or post context a customer's first message arrived from (for example an ad whose call to action opens a chat). A referral also opens a free-entry-point customer window — see the chat's customer_window. - `type: "referral"` - `"referral"` - `body: optional string` The ad's body text at click time. - `click_id: optional string` The click identifier assigned by the ad platform, for attribution. - `headline: optional string` The ad's headline at click time. - `image_url: optional string` URL of the ad's image creative, when media_kind is image. - `media_kind: optional string` The ad creative's media kind, e.g. image or video. - `source_id: optional string` The ad or post id. - `source_kind: optional string` What the source was, e.g. ad or post. - `source_url: optional string` The URL of the ad or post the customer came from. - `video_url: optional string` URL of the ad's video creative, when media_kind is video. - `System object { body, type, event }` Inbound only — never sendable. A system event in the chat, such as the customer changing their number. New event kinds appear over time; body is always present and human-readable. - `body: string` Human-readable description of the system event. - `type: "system"` - `"system"` - `event: optional string` The system event's kind, when the channel identifies one. New kinds appear over time — treat unknown values as informational. - `Unsupported object { raw, type, kind }` Inbound only — never sendable. A message kind this API does not yet type natively, carried as a typed passthrough: raw holds the channel payload, so a new message kind is never a black box or a silent drop. Native part types for popular kinds are added over time; this part is the compatibility guarantee in the meantime. - `raw: unknown` The channel payload — any JSON value: object, array, string, number, boolean, or null. Deliberately unconstrained, because the whole point of this part is to carry a shape this API does not yet know. For rows written by API version 1.3.0 or later, object member order, number formatting and duplicated members survive storage and read-back. The canonical encoder may compact insignificant whitespace before storage. Rows written before API version 1.3.0 retain normalized JSON only: member order and number formatting may differ, and only the last duplicated member survives. - `type: "unsupported"` - `"unsupported"` - `kind: optional string` The channel's name for the message kind, when it declares one. - `status: string` The message's delivery state as last reported. Inbound messages read `received`: they arrived, and no delivery of ours ran. A message you sent starts `accepted` and moves through `sent`, `delivered` and `read` as the channel reports them, with `failed` as the definitive negative outcome. `unknown` means exactly that: the send is INDETERMINATE and we decline to guess. It is NOT terminal — an indeterminate send is never re-sent, and it resolves to `sent`, `delivered`, `read` or `failed` when the channel's own report arrives — so keep observing rather than treating it as an outcome. States are reported asynchronously on the chat's event sequence, and the set grows additively: treat a value you do not recognise as "no information" rather than failing on it. Retention of this published status follows the chat transcript policy: there is no scheduled pruning, but no fixed minimum availability period is published yet. The present absence of a scheduled age-based sweep is not a promise of indefinite availability. `delivered` is reported by the channel after it accepted the message and can lag by hours, never arrive at all, or be followed by a failure, so do not build timeouts around it arriving promptly. - `channel_message_id: optional string` The channel's opaque identifier for this message, when the channel has assigned one. An inbound reaction's `channel_message_id` matches this field literally; never parse it or compare it with `id`. It is absent while an accepted outbound message has not yet received a channel identifier, and until it is present an inbound reaction to this message carries only `channel_message_id`. - `failure: optional object { code, message }` Why a failed message failed, when we have a reason worth publishing. Present only on `status` `failed`, and not on every one of those: a message can fail for a reason outside the published vocabulary and carry no `failure` at all. Its absence means "no published reason", never "no reason". Most messages the channel refused do carry one: a specific code where one is published, and `channel_refused` for most of the rest; a few kinds of refusal still carry none. `status` stays the thing to branch on. This is additive detail beside it, so an integration written before this field existed still sees a terminal `failed` and behaves exactly as it did. - `code: string` The specific reason. `sender_deregistered` — the number this message was going out from is no longer a registered sending number, and the message never left. This is terminal: it is not a pause and it does not clear, so retrying the same message cannot succeed and that conversation is over. Reach this customer by starting a new one on another of your numbers with a template, exactly as you would any customer whose 24-hour window has closed; `GET /v1/chats` shows which number each conversation uses. You are not billed for a message that failed this way. `quality_hold_expired` — this marketing message remained held by an automatic safety control on its sending line for ten minutes and was not sent. This is terminal: retrying the same message cannot succeed on that conversation. Send marketing from another of your numbers with a template, or contact support about the sending line. You are not billed for a message that failed this way. `target_message_failed` — the message this one quotes or reacts to failed, or its outcome could not be established, before this message went out. This message was therefore never sent, because a quote is never sent without its context. A `message.failed` event reports it. This is terminal: send it again as a new message, without that target or naming one that was sent. You are not billed a channel charge for it, though it still counts toward your platform subscription's message volume. `recipient_country_restricted` — the business behind the sending number is not currently permitted to message customers in this recipient's country, so the message was not delivered. The restriction blocks every message type, including replies inside the customer's 24-hour window. This is terminal for the message: sending it again cannot succeed while the restriction stands. Most countries unlock only when the business has completed business verification and has held an assigned messaging tier of 2,000 or higher for 30 consecutive days. The assigned tier is what counts, not how many messages you send. Brazil and Indonesia also require the business's primary business location to be in that country, at any tier: a business located elsewhere cannot message customers there. Until the business qualifies, sends to that country will keep failing. The channel publishes no list of restricted country pairs and offers no API signal before a send. If the business meets these conditions and the restriction stands, review the messaging policy for the business's category. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `payment_method_required` — the business behind the sending number has no working payment method on its messaging account, so this message was not sent. This is terminal for the message: retrying it cannot succeed until a payment method is added. Add or update the payment method in the messaging account's billing settings, then send again as a new message. Replies inside an open 24-hour customer window are charged too once the sending number's monthly free allowance of them is used up, so they also need a working payment method and can fail this way. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `recipient_phone_number_required` — this customer is known only by a username identifier, not a phone number, and this message can be delivered only to a phone number, so it was not sent. This is terminal for the message: sending it again to this customer cannot succeed. One-time-code templates (copy code, one-tap or zero-tap autofill) are the usual cause; deliver the code another way. Other messages, including templates without a one-time-code button, can still be sent to this customer. When the template is known in advance to carry a one-time-code button, the send is refused at once with the error `recipient_phone_number_required` instead and nothing is accepted. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `business_restricted` — this message was refused because the business behind the sending number is most likely restricted on its messaging account, so it was not sent. This is terminal for the message: sending it again will not succeed while the restriction stands. Review the status of the business's messaging account, and if the business believes it complies with the messaging policies, request a review of the restriction. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `channel_refused` — this message was refused upstream and was not sent, for a reason that has no more specific code here, and it will not be retried automatically. Contact support with this message's `id` to learn the reason and whether sending it again can succeed. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. A more specific code may be published for some of these refusals in a later release; treat a code you do not recognise exactly as you treat this one. - `message: string` Human-readable, written for a person reading it. Do not branch on it. - `from: optional string` The number this message left by, or arrived on, in E.164 (leading `+`). Every message in one conversation carries the same value — a conversation never moves to another number. Absent only if the number is no longer one of yours. - `from_selection: optional object { reason }` Present only when this service chose the sending number for you — that is, when you omitted `from`. A send that named `from` omits this rather than reporting a choice nobody made. - `reason: string` Why this number was used. Exactly one of: - `reused_active_chat` — this customer already had a conversation and it continues on the same number. - `new_best_number` — there was no existing conversation, so the best available number was chosen. Like every other vocabulary here it is a plain string that may grow additively; treat a value you do not recognise as "chosen for you". - `reply_to_message_id: optional string` This API's `id` of the earlier message in this chat that this message replies to. On an inbound message it is the message the customer quoted; on an outbound message it is the `reply_to_message_id` you sent. Look the value up in this chat's transcript to show what was answered; it is the same namespace as `id`, never a channel identifier. Absent when there is no reply context this API can resolve — a message that quotes nothing, or one that quotes a message this API never recorded in this chat. Treat absence as "no reply context available", not as proof the message was not a reply. - `zero_retention: optional true` True when the message is under zero-day retention: its content is not kept, so later reads and idempotent retries return empty `parts`. The original send response still carries the content. Retention applies only within Linq's systems. The WhatsApp channel operator's own processing and retention of message content are governed by its terms and are not affected by this setting. - `true` ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/chats/$CHAT/messages \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" \ -d '{ "parts": [ { "body": "body", "type": "text" } ] }' ``` #### Response ```json { "id": "id", "chat_id": "chat_id", "created_at": "2019-12-27T18:11:19.117Z", "direction": "inbound", "parts": [ { "body": "body", "type": "text", "preview_url": true } ], "status": "status", "channel_message_id": "channel_message_id", "failure": { "code": "code", "message": "message" }, "from": "from", "from_selection": { "reason": "reason" }, "reply_to_message_id": "reply_to_message_id", "zero_retention": true } ``` --- # Contract URL: https://docs.linqapp.com/channel/whatsapp/api/resources/contract/ ## Download the OpenAPI definition **get** `/v1/openapi.yaml` Downloads this API's OpenAPI 3.1 definition, served as `application/yaml`. It is the authority for request and response shapes and the error envelope. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/openapi.yaml ``` ## Get a part type's JSON Schema **get** `/v1/parts/{type}` Reads one part type's JSON Schema (2020-12) byte-verbatim, served as `application/schema+json` — ready to hand to a structured-output model as a tool schema. Codified length and item bounds are machine-readable in the schemas; cross-field rules they cannot express are declared in `x-rule`. A specific template's generated parameter schema comes from `GET /v1/templates`. A violation returns HTTP 422 naming the exact field. Unknown part types answer HTTP 404 `part_type_not_found` (a 2xxx `error.code`, 2013). ### Path Parameters - `type: string` ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/parts/$TYPE ``` ## Domain Types ### Contract OpenAPI Response - `ContractOpenAPIResponse = string` ### Contract Part Schema Response - `ContractPartSchemaResponse = unknown` --- # Download the OpenAPI definition URL: https://docs.linqapp.com/channel/whatsapp/api/resources/contract/methods/openapi/ **get** `/v1/openapi.yaml` Downloads this API's OpenAPI 3.1 definition, served as `application/yaml`. It is the authority for request and response shapes and the error envelope. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/openapi.yaml ``` --- # Get a part type's JSON Schema URL: https://docs.linqapp.com/channel/whatsapp/api/resources/contract/methods/part_schema/ **get** `/v1/parts/{type}` Reads one part type's JSON Schema (2020-12) byte-verbatim, served as `application/schema+json` — ready to hand to a structured-output model as a tool schema. Codified length and item bounds are machine-readable in the schemas; cross-field rules they cannot express are declared in `x-rule`. A specific template's generated parameter schema comes from `GET /v1/templates`. A violation returns HTTP 422 naming the exact field. Unknown part types answer HTTP 404 `part_type_not_found` (a 2xxx `error.code`, 2013). ### Path Parameters - `type: string` ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/parts/$TYPE ``` --- # Destination Messages URL: https://docs.linqapp.com/channel/whatsapp/api/resources/destination_messages/ ## Send a message **post** `/v1/messages` Sends a message. Acceptance is durable and asynchronous: a `202` means the message is journaled and will be delivered in order; delivery states arrive on the chat's event sequence (and your webhooks/streams), never on this call. The chat is created on first send to a new customer. Within one chat, sends are handed to the channel in the order they were accepted, each after the previous one has been answered or has failed. A send paused by a safety stop can be overtaken by later sends the stop does not cover, and a send whose outcome stays unknown stops holding later sends after about 15 minutes. A send that quotes or reacts to an earlier message is the exception: it never overtakes that message, and waits with it under a safety stop while later sends the stop does not cover overtake both. This is the order of handing to the channel, not a promise of the order the customer's device shows. The `202` body's `status` is `accepted` — the message exists and is ours to deliver, and nothing more is claimed by it. Watch `GET /v1/streams/events` for `message.sent`, `message.delivered`, `message.read` and `message.failed` to learn what became of it. The stream does not replay, so connect it first; anything you miss is read back from `GET /v1/chats/{chat}/events`, where the same message also carries its latest `status`. Every gate runs before anything is written, so a refusal means nothing was stored and nothing will be sent — always safe to correct and retry. A request that TIMES OUT is the one case that is not safe to retry without `Idempotency-Key`. Supply one unique key per logical message to make a timed-out acceptance safe to repeat. An operational safety stop or the absence of an active sending number refuses with retryable HTTP 503 (`sending_paused` or `no_sending_number`) and a 4xxx `error.code`; nothing is journaled. A stop on the number a conversation already uses answers the same way, with `sending_paused` — and so does a stop on a number you named with `from`. It is ours to lift, and you are never told to move a customer to another number, or that your request was malformed, over one. `from_ambiguous` joins that class in the rare case where a `from` you supplied matches more than one of your numbers: it names no single conversation, so nothing is chosen for you and an operator resolves it. If the service cannot verify the safety state, it likewise refuses with HTTP 503 `sending_guard_unavailable` (a 3xxx `error.code`, 3009) instead of assuming sending is allowed. These operator-dependent states carry no `Retry-After` because there is no honest recovery time to publish. **Which number the message leaves by.** Omit `from` and this service picks: a customer you have messaged before keeps the number they already see, and a new customer is placed on the best available one. The accepted message reports the number as `from`, and reports how it was chosen in `from_selection`. A conversation NEVER moves to another number. If the number a conversation uses is no longer a registered sending number of yours, the request is refused with HTTP 422 `pinned_line_unsendable` (a 4xxx `error.code`, 4004) and NOTHING changes — no message is sent, no conversation is created, and the next send to that customer resolves the same way. `error.context.pinned_from` names the stuck number and `error.context.available_from` names the one that could serve instead; that number is a separate conversation with its own 24-hour window, so you open it yourself by sending an approved template with `from` set to it. This is deliberate: nothing is ever sent on your behalf that you did not compose, and nothing is billed that you did not request. Spend limits apply to every send, including templates. A projected reservation beyond a daily or monthly cap is refused with HTTP 429 `spend_limit_exceeded` (a 4xxx `error.code`, 4006); `Retry-After` names the exact UTC day/month reset and nothing is journaled. If the rate catalog has no applicable rate, the service fails closed with HTTP 503 `rate_not_configured` (a 3xxx `error.code`, 3020); only operator action can clear it, so contact support rather than retrying. If the catalog lookup, cap, or counter is temporarily unavailable, the retryable refusal is HTTP 503 `entitlement_unavailable` (a 3xxx `error.code`, 3004). Crossing 80% does not change acceptance: the response remains 202 and carries `X-Spend-Warning` once for each cap window crossed by that request. Values are comma-separated `brand_day`, `brand_month`, or `number_day`; the warning is emitted once per window, not on every later send. Every send except a reaction reserves its projected charge at accept, including a reply inside an open customer window: the channel charges those replies once the sending number's monthly free allowance of them is used up, and a reply that turns out to be free has its reservation released when its receipt arrives. A daily ceiling refuses any message carrying a `template` part, including a template sent inside an open window. A message without one (text, media, a reaction or another in-window reply) is still accepted past a daily ceiling, and its charge still counts toward the day and the month. The monthly account ceiling is hard and stops every send at the ceiling, including a reaction. Separately from spend, the channel limits how many DISTINCT customers a new conversation may be started with in a moving 24-hour period. A template send that would exceed it is refused with HTTP 429 `tier_quota_exceeded` (a 4xxx `error.code`, 4008) and nothing is journaled; replies inside an open customer conversation are unaffected and never count against it, and a second template to a customer already counted in the period costs nothing. `Retry-After` on this refusal is a MINIMUM REQUESTED WAIT computed from the period as it stood when the request was refused: retry no earlier than that, and a retry then may still be refused. It is not an expiry — the earliest free place can move later as you send to customers already counted, and can open earlier when messages fail to deliver. **You may not be able to produce this refusal in an integration test**, in sandbox or in live: it is raised only where the channel has reported a limit for the account concerned, so an environment where no limit has been reported will never return it. Handle it from the response code rather than from having seen it. ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `parts: array of object { body, type, preview_url } or object { kind, type, availability, 10 more } or object { language, name, type, 4 more } or 10 more` The message content — sendable parts only, at least one. **One outbound part per request.** Each request has its own acceptance result and optional idempotency key. Each accepted request maps to one native channel message with its own identifier, delivery outcome and charge evidence. A request carrying more than one part is refused with HTTP 422 (`multiple_parts_not_available`, a 1xxx `error.code`, 1019); the API neither fans it out nor offers an atomic batch. Separate requests are independent, and no cross-request delivery or receipt order is promised. **A `reaction` addresses its target by this API's `Message.id`**, which the service resolves into the channel's own namespace before sending. The target must be a message this account can see in the chat the send addresses: otherwise the send is refused with HTTP 422 `reaction_target_not_found` (2049) or `reaction_target_wrong_chat` (1040). A target that has already failed is refused with `reaction_target_not_ready` (2050). Each is pointered at the part's `message_id`. A target this API has not sent yet is normally accepted: the reaction goes out after it, and later messages in the chat wait behind the pair, except that under a safety stop later sends the stop does not cover overtake both. A not-ready refusal can still happen for a target that has not reached `sent` or has only just reached it, and it is safe to retry once the target reads `sent`. A send naming a target that reads `unknown` may be accepted and fail later with `target_message_failed`, or may be refused as not ready. Do not wait for a target that reads `failed` or `unknown`, because it may never reach `sent`: react to another message. If the target fails, or its outcome cannot be established, before the reaction goes out, the reaction is never sent and ends `failed` with `target_message_failed`. If the channel accepts the target and reports it failed later, a reaction that has gone out stays sent, and one that has not gone out normally fails the same way. A `message.failed` event reports a reaction accepted this way that ends `failed`, including a refusal of its own send. A live reaction the channel accepts ends at status `sent`: no delivered or read receipt is reported for one. It can still end `failed` if the channel refuses it on the wire. Media is sendable after its bytes are uploaded with `POST /v1/media` (the part carries that operation's `upload_ref`) or by naming a public https address in `source_url`, which the service fetches once before accepting the send and stores as an upload of its own; the accepted message carries the resulting `upload_ref`, never the address. Outbound parts never carry inbound `media_id`. Outside an open customer window the array must be exactly one `template` part; a freeform part there is refused with HTTP 422 `outside_customer_window` (a 2xxx `error.code`, 2036) and the remedy in the message. A customer known only by a username identifier can receive every message type except a one-time-code template (a copy-code, one-tap or zero-tap autofill button), which can be delivered only to a phone number. When the template is known to carry such a button, the send is refused with HTTP 422 `recipient_phone_number_required` (a 4xxx `error.code`, 4011), pointered at the part, and nothing is accepted; deliver the code another way. - `Text object { body, type, preview_url }` A plain text message. - `body: string` The message text. URLs render as tappable links. - `type: "text"` - `"text"` - `preview_url: optional boolean` Render a preview card for the first URL in body. Defaults to false. - `Media object { kind, type, availability, 10 more }` A media message — image, video, audio, document, or sticker. The two identifiers are distinct namespaces: inbound media carries the channel's transient media_id; outbound media carries our durable upload_ref from POST /v1/media. - `kind: "image" or "video" or "audio" or 2 more` Which kind of media this is. Captions apply to image, video and document only; filename applies to document only. - `"image"` - `"video"` - `"audio"` - `"document"` - `"sticker"` - `type: "media"` - `"media"` - `availability: optional "available" or "unavailable" or "pending"` Response only, inbound parts only: whether the download answers the bytes. available: the file was captured and is retained. unavailable: it is not downloadable now, and unavailable_reason says why; with timed_out the download answers 409 while capture continues and can later answer 200, otherwise it answers 410, or 404 once the file is no longer known. It describes the file, not the exact HTTP answer of a later download, which can also refuse for capacity or authorization. pending: capture has not finished yet; only reads of the conversation return pending, and a message event never does. A message.received event is recorded once every attachment has been captured or has failed, or ten minutes after the message arrived, whichever comes first; an event part without availability is from a historical event and may still be capturing, so retry its download as the 409 Retry-After directs. A message event keeps the value it was recorded with; reads return the current one. Historical messages received before it was recorded omit it. Never accepted on sends. - `"available"` - `"unavailable"` - `"pending"` - `byte_size: optional number` Response only, inbound parts only: the exact size in bytes of the retained attachment, equal to the download's Content-Length. Present only while the bytes are captured and retained — the same lifetime as a working url, ending 30 days after server receipt — so it can be absent from a message event while capture has not completed, and its absence is not final; once present it never changes. Absent rather than zero. Never accepted on sends. - `caption: optional string` Caption rendered with the media. Image, video and document only — a caption on an audio or sticker part is rejected, never dropped. - `filename: optional string` Display filename. Documents only — a filename on any other kind is rejected, never dropped. - `media_id: optional string` Inbound only: the channel's transient media identifier. It expires after seven days and is never an outbound address; an outbound value is rejected with a pointer to media_id and upload_ref as the remedy. - `mime_type: optional string` Response only, inbound parts only: the media type the channel declared when the message arrived, verbatim. It may carry parameters (for example audio/ogg; codecs=opus) and may differ from the Content-Type the download answers with, which describes the retained bytes. Present on the webhook body and on every later read with the same value. Historical messages received before it was recorded omit this field. Never accepted on sends. - `source_url: optional string` Outbound only: a public https URL of the bytes to send, as an alternative to upload_ref. Supply exactly one of upload_ref or source_url. The address is fetched once, before the send is accepted, and its exact bytes are stored as an ordinary upload in this account and key partition; the accepted message and every later read carry that upload's upload_ref, never the address, and no retry fetches it again. The URL must be absolute https on the default port with no credentials and no fragment, must resolve to a public address (every redirect hop included, at most three), and must answer with the complete bytes and their exact media type within the fetch deadline. The bytes are then held to the same media type and size rules as POST /v1/media for the part's kind; a mismatch is refused, never converted. - `unavailable_reason: optional string` Response only, present only when availability is unavailable. An open string: the values today are timed_out, capture_failed and expired, and new values may be added. timed_out: the file was still being retrieved ten minutes after the message arrived, so its message event was recorded without it; retrieval continues and the file may become downloadable later, which reads of the conversation report. capture_failed: the file could not be retrieved. expired: the file was retrieved and is no longer retained, or is no longer known (the download then answers 410 or 404). Treat an unknown value as capture_failed. Never accepted on sends. - `upload_ref: optional string` Outbound only: our durable handle returned by POST /v1/media. Handles visibly begin upload. and are reusable within the account and key partition that created them. - `url: optional string` Response only: stable attachment download URL requiring the account Bearer key on every request. Pending capture returns 409 with Retry-After; retained bytes expire 30 days after server receipt. Historical unbound messages omit this field. Never accepted on sends. - `voice: optional boolean` Audio only. On a send it is optional: true sends the audio as a voice note; false, or leaving it out, sends it as an ordinary audio file. A voice note needs an upload stored as audio/ogg that holds mono Opus audio, sent by upload_ref or source_url within the existing audio size limit. The bytes are sent as supplied: they are never converted or inspected, so encode them as mono Opus before uploading. The recipient sees a play button only when the voice file is 512 KB or smaller; a larger voice note is still delivered but must be downloaded before it plays. On incoming audio parts it is response-only: whether the channel reported the audio as a voice note, verbatim. true means it was recorded with the messaging client's voice-recording feature; false means it was sent as an audio file. Present on the webhook body and on every later read with the same value. Absent on an incoming part means the channel did not say, never that the audio is not a voice note. Other kinds never carry it, and historical messages received before it was recorded omit it. - `Template object { language, name, type, 4 more }` An approved message template — the one part type sendable outside an open customer service window. name and language identify the approved template; parameters fills its named placeholders. Authentication templates use this same generic part: their published parameter schema names exactly one parameter, `code` — the one-time code you generate, 1–15 characters — and the message shows it in its body and behind its code button. Every sendable template is registered and approved ahead of the send and publishes its own parameter schema — a send referencing an unknown template, a missing or unknown parameter, or a value that breaks the template's rules is rejected with a 422 naming the exact field. - `language: string` The template's language-and-locale code, e.g. en_US. - `name: string` The approved template's name. Lowercase letters, digits and underscores only. - `type: "template"` - `"template"` - `buttons: optional array of object { index, payload, type }` Send-time values for this approved template's own dynamic buttons, in ascending index order: a url button whose destination ends in {{1}} takes the value appended there and is REQUIRED; a quick_reply button takes the payload returned to you when it is tapped and is OPTIONAL — omit it and the button returns its label. Fixed buttons have no slot. The approved template's send_schema lists the (index, type) slots and an x-rule stating which are required; omit buttons entirely for a template with no url slot when the labels are what you want back. - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `cards: optional array of object { card_index, kind, upload_ref, 2 more }` Per-card values for an approved media-card carousel. The approved template's send_schema provides structural bounds and an x-rule listing the exact card order, media kind, named body values, and dynamic button slots enforced by runtime L2 validation. Omit for non-carousel templates. - `card_index: number` - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: string` A durable handle returned by POST /v1/media. It is resolved within this key's account and partition, then consumed into a transient channel media identifier only at delivery. - `buttons: optional array of object { index, payload, type }` - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `parameters: optional unknown` Named values for this card's body placeholders. - `header: optional object { kind, upload_ref }` The uploaded media used for this approved template's media header. Omit unless this template's send_schema requires it. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `parameters: optional unknown` Named values for the template's placeholders. The shape is per-template: each registered template publishes its own parameter schema — hand THAT schema to your model when composing a specific template. Omit for templates with no placeholders. - `InteractiveList object { body, button, sections, 3 more }` An interactive list message: body text plus a button that opens a sectioned list of selectable rows. The customer's selection arrives as an inbound interactive_reply part with kind list_reply, carrying the chosen row's id. - `body: string` The message body. - `button: string` Label of the button that opens the list. - `sections: array of object { rows, title }` The list's sections, each holding selectable rows. At most 10 rows in total across ALL sections combined — not 10 per section. - `rows: array of object { id, title, description }` This section's rows. The 10-row limit is on the TOTAL across all sections, so a second section reduces what this one may hold. - `id: string` Your identifier for the row — echoed back as the interactive_reply's id. - `title: string` The row's visible title. - `description: optional string` Secondary text under the title. - `title: optional string` Section title. Required when the list has more than one section. - `type: "interactive_list"` - `"interactive_list"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `InteractiveButtons object { body, buttons, type, 3 more }` An interactive reply-buttons message: body text plus up to three tappable buttons. The customer's tap arrives as an inbound interactive_reply part with kind button_reply, carrying the tapped button's id. - `body: string` The message body. - `buttons: array of object { id, title }` The tappable buttons — at most three. - `id: string` Your identifier for the button — echoed back as the interactive_reply's id. - `title: string` The button's visible label. - `type: "interactive_buttons"` - `"interactive_buttons"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `InteractiveCtaURL object { body, display_text, type, 4 more }` An interactive call-to-action message: body text plus one button that opens a URL. - `body: string` The message body. - `display_text: string` The button's visible label. - `type: "interactive_cta_url"` - `"interactive_cta_url"` - `url: string` The URL the button opens. Must be absolute, with an http or https scheme. - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref, filename }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `filename: optional string` The file name the customer sees on a document header. Documents only. - `InteractiveCarousel object { body, cards, type }` An interactive carousel: one message whose body sits above 2 to 10 horizontally scrolling cards. Each card shows an uploaded image, or a video from a public link, and either one button that opens a URL or reply buttons. A tap on a card's reply button arrives as an inbound template_reply part whose payload is that button's id; nothing else in the reply identifies the card, so the id you choose is the card's identity. - `body: string` The message text shown above the cards. - `cards: array of object { card_index, header, body, 2 more }` The cards, left to right. - `card_index: number` This card's zero-based position: the first card is 0, the next 1, and so on, in array order. - `header: object { kind, upload_ref, url }` The card's media: an image named by upload_ref, or a video named by the public https url it plays from. Every card carries the same kind. - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: optional string` A durable handle returned by POST /v1/media for an image upload. Image cards only. - `url: optional string` The public https address the card's video plays from. Video cards only. It is sent exactly as written and never fetched by this API, so it must be publicly reachable and serve a playable video; a link that does not play is accepted and then reported as a failed delivery (message.failed with channel_refused). - `body: optional string` Optional text below the card's image or video, with at most two line breaks. - `reply_buttons: optional array of object { id, title }` Buttons the customer taps to reply. Use either url_button or reply_buttons on every card. - `id: string` Your identifier for the button, echoed back as the template_reply's payload. Unique across the whole carousel. - `title: string` The button's visible label. - `url_button: optional object { display_text, url }` One button that opens a URL. Use either url_button or reply_buttons on every card. - `display_text: string` The button's visible label. - `url: string` The absolute https URL the button opens. - `type: "interactive_carousel"` - `"interactive_carousel"` - `LocationRequest object { body, type }` Asks the customer to share a location. The response arrives as a location part. - `body: string` Prompt shown above the send-location button. - `type: "location_request"` - `"location_request"` - `ContactRequest object { body, type }` Asks the customer to share their own contact card with one tap. Useful when you know the customer only by a username identifier and need a phone number. The answer arrives as an ordinary contacts part whose card carries origin contact_request; a card the customer shares by hand carries origin other instead. The answer is not linked to your request as a reply: its message carries no reply_to_message_id, so match it by origin and timing. Sendable inside the customer window. - `body: string` Prompt shown above the share-contact button. - `type: "contact_request"` - `"contact_request"` - `AddressRequest object { body, country, type }` Reserved for asking an eligible customer in India to submit a structured address. Sending this part is not available until business and customer eligibility can be verified at acceptance. Address responses already arrive as address_reply parts. - `body: string` Prompt shown above the address form. - `country: "IN"` ISO country code. Structured address requests are currently available only in India. - `"IN"` - `type: "address_request"` - `"address_request"` - `Contacts object { contacts, type }` One or more contact cards. - `contacts: array of object { name, addresses, birthday, 5 more }` The contact cards to send. The channel permits far more; this API caps a message at five, because a message carrying hundreds of cards is a mistake rather than a use case. - `name: object { formatted_name, first_name, last_name, 3 more }` - `formatted_name: string` The contact's full display name. - `first_name: optional string` - `last_name: optional string` - `middle_name: optional string` - `prefix: optional string` - `suffix: optional string` - `addresses: optional array of object { city, country, country_code, 4 more }` - `city: optional string` - `country: optional string` - `country_code: optional string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `state: optional string` - `street: optional string` - `zip: optional string` - `birthday: optional string` The contact's birthday as YYYY-MM-DD. - `emails: optional array of object { email, kind }` - `email: string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `org: optional object { company, department, title }` - `company: optional string` - `department: optional string` - `title: optional string` - `origin: optional string` Response-only: how the customer came to share this card, as the channel reported it, verbatim. contact_request means they tapped the share button on a contact_request you sent; other means they shared a card themselves. New values may appear, so treat any other value as unrecognised rather than as either of these. Absent when the channel did not say, and on cards received before it was recorded. A send carrying it is rejected with a pointer at the member. - `phones: optional array of object { phone, kind, messaging_id }` - `phone: string` The phone number, ideally in +E.164 form. - `kind: optional string` A label for the number, e.g. CELL, MAIN, WORK, HOME. - `messaging_id: optional string` The contact's messaging-account identifier on this channel, when known — makes the card openable in the messaging app. - `urls: optional array of object { url, kind }` - `url: string` - `kind: optional string` A label for the URL, e.g. WORK, HOME. - `type: "contacts"` - `"contacts"` - `Location object { latitude, longitude, type, 2 more }` A location pin. - `latitude: number` Latitude in decimal degrees. - `longitude: number` Longitude in decimal degrees. - `type: "location"` - `"location"` - `address: optional string` The place's address, shown under the name. - `name: optional string` The place's name, shown on the pin. - `Reaction object { emoji, type, channel_message_id, message_id }` An emoji reaction to an earlier message in the chat. message_id is this API's Message.id for the target in both directions: it is what you send, and it is appended to an inbound reaction whenever the target is a message of the same chat. channel_message_id is the channel's opaque identifier and appears on inbound reactions only. - `emoji: string` A single emoji. Send an empty string to remove a previous reaction to the same message. - `type: "reaction"` - `"reaction"` - `channel_message_id: optional string` Inbound only: the channel's opaque identifier for the message being reacted to. Always present on an inbound reaction, beside message_id whenever the target resolved. Match it literally to Message.channel_message_id in the chat transcript; never parse it or compare it with Message.id. - `message_id: optional string` This API's Message.id for the message being reacted to. Outbound: required, and the API resolves it into the channel namespace before sending, so the message must be one this account can see in the chat the send addresses. Inbound: present whenever the target is a message of the same chat, so you can keep only this identifier; absent when the chat does not hold the target. - `to: string` The customer to message: the exact opaque customer address this API reports as the chat's `customer` field (read with `GET /v1/chats` or `GET /v1/chats/{chat}`), copied verbatim and never parsed, built or reformatted. It is usually the customer's phone number in the channel's digits-only form (country code first, no `+` and no punctuation, such as `15550101234`); a customer who uses a username and has not shared a phone number is identified by a username identifier instead (such as `US.13491208655302741918`). Treat both the same way: copy the value. **The value is matched literally and never normalized**, because the address is the channel's to define, not ours to rewrite. It is the conversation's identity, so two spellings of the same number are two different conversations, each with its own window and its own event sequence. Concretely: the value is compared verbatim to the chat's `customer` field, the customer id exactly as that customer's inbound messages arrived. A newly recorded chat event carries that value as `data.customer`; for an older event, read the chat's `customer` with `GET /v1/chats/{chat}`. A leading `+` makes it a different value — `+12059367930` does not find the conversation delivered as `12059367930` — and such a send is refused with `outside_customer_window` (`2036`) as if that customer had never written. When this account does hold an open window under the value without the `+`, the refusal's `details[0].message` says so and names both values, so the fix is to resend with the delivered value or on `POST /v1/chats/{chat}/messages`, which needs no address at all. - `exclude: optional array of string` Numbers NOT to send from, in E.164 — a filter on a choice this service is making for you. It applies only when `from` is omitted; supplying both is refused. It affects this request alone: nothing is stored, and no operator setting changes. It cannot move a conversation. If it names the number an existing conversation already uses, or removes every number that could have served, the send is refused with `exclude_leaves_no_sender` rather than quietly sent from a number you asked to avoid. - `from: optional string` The number to send FROM, in E.164 (e.g. `+15550001111`). Together with `to` it names the exact conversation: one customer, one of your numbers. **Omit it and this service chooses**, exactly as it always has — a conversation you have already had continues on its own number, and a new customer is placed on the best available one. Omitting the field and sending an empty string are DIFFERENT requests: an empty string is refused rather than treated as "choose for me", because a client that computed nothing did not mean to hand the choice back. Supply it to reply on a specific number — in particular the second conversation a customer starts by messaging another of your numbers, which is its own chat with its own window. The number must be one of your registered sending numbers: `from_not_available` (422, a 1xxx `error.code`, 1013) if it is not one of your numbers at all, and `from_not_sendable` (422, a 4xxx `error.code`, 4003) if it is yours but is no longer registered to send. A number that is only PAUSED is neither of those — it answers retryable HTTP 503 `sending_paused` (a 4xxx `error.code`, 4005), the same as every other paused send, because that one is ours to lift and worth retrying shortly. It is matched on its digits, so `+15550001111` and `1 (555) 000-1111` are the same number — unlike `to`, which is the channel's own address form and is matched literally. Naming a number never moves an existing conversation onto it. It does decide where a BRAND-NEW one lives: if you have never exchanged a message with this customer, the number you name becomes the one they keep, and a later omitted-`from` send to them continues on it. That is the same rule as ever — a customer's number is fixed by the first contact, whoever chose it — and it is why naming a number for a customer you have already messaged changes nothing about their existing conversation. - `reply_to_message_id: optional string` Our opaque `Message.id` for an earlier message in this same chat. When present, this send is displayed as a visual reply to that message. Unknown ids return `reply_target_not_found`; an id from another chat returns `reply_target_wrong_chat`; and a message that has already failed returns `reply_target_not_ready`. Nothing is accepted when any of those refusals is returned. A target this API has not sent yet is normally accepted: this send goes out after it, quoting it, and later messages in the chat wait behind the pair, except that under a safety stop later sends the stop does not cover overtake both. A not-ready refusal can still happen for a target that has not reached `sent` or has only just reached it, and it is safe to retry once the target reads `sent`. A send naming a target that reads `unknown` may be accepted and fail later with `target_message_failed`, or may be refused as not ready. Do not wait for a target that reads `failed` or `unknown`, because it may never reach `sent`: send without `reply_to_message_id` or quote another message. If the target fails, or its outcome cannot be established, before this send goes out, this send is never sent and ends `failed` with `target_message_failed`; it is never sent without the quote and never quotes anything else. If the channel accepts the target and reports it failed later, a send that has gone out stays sent, and one that has not gone out normally fails the same way. A `message.failed` event reports a send accepted this way that ends `failed`, including a refusal of its own send. The accepted message reads back with the same `reply_to_message_id`, and an inbound message that quotes one of yours carries the quoted message's `id` in the same field. - `send_at: optional string` RESERVED — scheduled sends are not yet available. The field is declared so its later arrival is purely additive; until then ANY value here, including a past timestamp, is rejected loudly with HTTP 422 `send_at_not_available` (a 1xxx `error.code`, 1039). Omit the field entirely. ### Returns - `AcceptedMessage object { id, chat_id, created_at, 9 more }` An accepted send: the message, plus how its sending number was chosen. - `id: string` This API's message id. Put this value in an outbound reaction's `message_id`; an inbound reaction to this message carries the same value in its `message_id`, so this is the one identifier you need to keep. Mark-as-read targets the latest unread inbound message in a chat, so it takes the chat id. - `chat_id: string` The chat this message belongs to. - `created_at: string` - `direction: "inbound" or "outbound"` `inbound` (from the customer) or `outbound` (sent by you). - `"inbound"` - `"outbound"` - `parts: array of object { body, type, preview_url } or object { kind, type, availability, 10 more } or object { language, name, type, 4 more } or 17 more` The message content — sendable parts, plus the inbound-only types on inbound messages. Empty only when `zero_retention` is true, or when an idempotent retry returns an ephemeral message whose content retention cleanup has removed. - `Text object { body, type, preview_url }` A plain text message. - `body: string` The message text. URLs render as tappable links. - `type: "text"` - `"text"` - `preview_url: optional boolean` Render a preview card for the first URL in body. Defaults to false. - `Media object { kind, type, availability, 10 more }` A media message — image, video, audio, document, or sticker. The two identifiers are distinct namespaces: inbound media carries the channel's transient media_id; outbound media carries our durable upload_ref from POST /v1/media. - `kind: "image" or "video" or "audio" or 2 more` Which kind of media this is. Captions apply to image, video and document only; filename applies to document only. - `"image"` - `"video"` - `"audio"` - `"document"` - `"sticker"` - `type: "media"` - `"media"` - `availability: optional "available" or "unavailable" or "pending"` Response only, inbound parts only: whether the download answers the bytes. available: the file was captured and is retained. unavailable: it is not downloadable now, and unavailable_reason says why; with timed_out the download answers 409 while capture continues and can later answer 200, otherwise it answers 410, or 404 once the file is no longer known. It describes the file, not the exact HTTP answer of a later download, which can also refuse for capacity or authorization. pending: capture has not finished yet; only reads of the conversation return pending, and a message event never does. A message.received event is recorded once every attachment has been captured or has failed, or ten minutes after the message arrived, whichever comes first; an event part without availability is from a historical event and may still be capturing, so retry its download as the 409 Retry-After directs. A message event keeps the value it was recorded with; reads return the current one. Historical messages received before it was recorded omit it. Never accepted on sends. - `"available"` - `"unavailable"` - `"pending"` - `byte_size: optional number` Response only, inbound parts only: the exact size in bytes of the retained attachment, equal to the download's Content-Length. Present only while the bytes are captured and retained — the same lifetime as a working url, ending 30 days after server receipt — so it can be absent from a message event while capture has not completed, and its absence is not final; once present it never changes. Absent rather than zero. Never accepted on sends. - `caption: optional string` Caption rendered with the media. Image, video and document only — a caption on an audio or sticker part is rejected, never dropped. - `filename: optional string` Display filename. Documents only — a filename on any other kind is rejected, never dropped. - `media_id: optional string` Inbound only: the channel's transient media identifier. It expires after seven days and is never an outbound address; an outbound value is rejected with a pointer to media_id and upload_ref as the remedy. - `mime_type: optional string` Response only, inbound parts only: the media type the channel declared when the message arrived, verbatim. It may carry parameters (for example audio/ogg; codecs=opus) and may differ from the Content-Type the download answers with, which describes the retained bytes. Present on the webhook body and on every later read with the same value. Historical messages received before it was recorded omit this field. Never accepted on sends. - `source_url: optional string` Outbound only: a public https URL of the bytes to send, as an alternative to upload_ref. Supply exactly one of upload_ref or source_url. The address is fetched once, before the send is accepted, and its exact bytes are stored as an ordinary upload in this account and key partition; the accepted message and every later read carry that upload's upload_ref, never the address, and no retry fetches it again. The URL must be absolute https on the default port with no credentials and no fragment, must resolve to a public address (every redirect hop included, at most three), and must answer with the complete bytes and their exact media type within the fetch deadline. The bytes are then held to the same media type and size rules as POST /v1/media for the part's kind; a mismatch is refused, never converted. - `unavailable_reason: optional string` Response only, present only when availability is unavailable. An open string: the values today are timed_out, capture_failed and expired, and new values may be added. timed_out: the file was still being retrieved ten minutes after the message arrived, so its message event was recorded without it; retrieval continues and the file may become downloadable later, which reads of the conversation report. capture_failed: the file could not be retrieved. expired: the file was retrieved and is no longer retained, or is no longer known (the download then answers 410 or 404). Treat an unknown value as capture_failed. Never accepted on sends. - `upload_ref: optional string` Outbound only: our durable handle returned by POST /v1/media. Handles visibly begin upload. and are reusable within the account and key partition that created them. - `url: optional string` Response only: stable attachment download URL requiring the account Bearer key on every request. Pending capture returns 409 with Retry-After; retained bytes expire 30 days after server receipt. Historical unbound messages omit this field. Never accepted on sends. - `voice: optional boolean` Audio only. On a send it is optional: true sends the audio as a voice note; false, or leaving it out, sends it as an ordinary audio file. A voice note needs an upload stored as audio/ogg that holds mono Opus audio, sent by upload_ref or source_url within the existing audio size limit. The bytes are sent as supplied: they are never converted or inspected, so encode them as mono Opus before uploading. The recipient sees a play button only when the voice file is 512 KB or smaller; a larger voice note is still delivered but must be downloaded before it plays. On incoming audio parts it is response-only: whether the channel reported the audio as a voice note, verbatim. true means it was recorded with the messaging client's voice-recording feature; false means it was sent as an audio file. Present on the webhook body and on every later read with the same value. Absent on an incoming part means the channel did not say, never that the audio is not a voice note. Other kinds never carry it, and historical messages received before it was recorded omit it. - `Template object { language, name, type, 4 more }` An approved message template — the one part type sendable outside an open customer service window. name and language identify the approved template; parameters fills its named placeholders. Authentication templates use this same generic part: their published parameter schema names exactly one parameter, `code` — the one-time code you generate, 1–15 characters — and the message shows it in its body and behind its code button. Every sendable template is registered and approved ahead of the send and publishes its own parameter schema — a send referencing an unknown template, a missing or unknown parameter, or a value that breaks the template's rules is rejected with a 422 naming the exact field. - `language: string` The template's language-and-locale code, e.g. en_US. - `name: string` The approved template's name. Lowercase letters, digits and underscores only. - `type: "template"` - `"template"` - `buttons: optional array of object { index, payload, type }` Send-time values for this approved template's own dynamic buttons, in ascending index order: a url button whose destination ends in {{1}} takes the value appended there and is REQUIRED; a quick_reply button takes the payload returned to you when it is tapped and is OPTIONAL — omit it and the button returns its label. Fixed buttons have no slot. The approved template's send_schema lists the (index, type) slots and an x-rule stating which are required; omit buttons entirely for a template with no url slot when the labels are what you want back. - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `cards: optional array of object { card_index, kind, upload_ref, 2 more }` Per-card values for an approved media-card carousel. The approved template's send_schema provides structural bounds and an x-rule listing the exact card order, media kind, named body values, and dynamic button slots enforced by runtime L2 validation. Omit for non-carousel templates. - `card_index: number` - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: string` A durable handle returned by POST /v1/media. It is resolved within this key's account and partition, then consumed into a transient channel media identifier only at delivery. - `buttons: optional array of object { index, payload, type }` - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `parameters: optional unknown` Named values for this card's body placeholders. - `header: optional object { kind, upload_ref }` The uploaded media used for this approved template's media header. Omit unless this template's send_schema requires it. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `parameters: optional unknown` Named values for the template's placeholders. The shape is per-template: each registered template publishes its own parameter schema — hand THAT schema to your model when composing a specific template. Omit for templates with no placeholders. - `InteractiveList object { body, button, sections, 3 more }` An interactive list message: body text plus a button that opens a sectioned list of selectable rows. The customer's selection arrives as an inbound interactive_reply part with kind list_reply, carrying the chosen row's id. - `body: string` The message body. - `button: string` Label of the button that opens the list. - `sections: array of object { rows, title }` The list's sections, each holding selectable rows. At most 10 rows in total across ALL sections combined — not 10 per section. - `rows: array of object { id, title, description }` This section's rows. The 10-row limit is on the TOTAL across all sections, so a second section reduces what this one may hold. - `id: string` Your identifier for the row — echoed back as the interactive_reply's id. - `title: string` The row's visible title. - `description: optional string` Secondary text under the title. - `title: optional string` Section title. Required when the list has more than one section. - `type: "interactive_list"` - `"interactive_list"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `InteractiveButtons object { body, buttons, type, 3 more }` An interactive reply-buttons message: body text plus up to three tappable buttons. The customer's tap arrives as an inbound interactive_reply part with kind button_reply, carrying the tapped button's id. - `body: string` The message body. - `buttons: array of object { id, title }` The tappable buttons — at most three. - `id: string` Your identifier for the button — echoed back as the interactive_reply's id. - `title: string` The button's visible label. - `type: "interactive_buttons"` - `"interactive_buttons"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `InteractiveCtaURL object { body, display_text, type, 4 more }` An interactive call-to-action message: body text plus one button that opens a URL. - `body: string` The message body. - `display_text: string` The button's visible label. - `type: "interactive_cta_url"` - `"interactive_cta_url"` - `url: string` The URL the button opens. Must be absolute, with an http or https scheme. - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref, filename }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `filename: optional string` The file name the customer sees on a document header. Documents only. - `InteractiveCarousel object { body, cards, type }` An interactive carousel: one message whose body sits above 2 to 10 horizontally scrolling cards. Each card shows an uploaded image, or a video from a public link, and either one button that opens a URL or reply buttons. A tap on a card's reply button arrives as an inbound template_reply part whose payload is that button's id; nothing else in the reply identifies the card, so the id you choose is the card's identity. - `body: string` The message text shown above the cards. - `cards: array of object { card_index, header, body, 2 more }` The cards, left to right. - `card_index: number` This card's zero-based position: the first card is 0, the next 1, and so on, in array order. - `header: object { kind, upload_ref, url }` The card's media: an image named by upload_ref, or a video named by the public https url it plays from. Every card carries the same kind. - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: optional string` A durable handle returned by POST /v1/media for an image upload. Image cards only. - `url: optional string` The public https address the card's video plays from. Video cards only. It is sent exactly as written and never fetched by this API, so it must be publicly reachable and serve a playable video; a link that does not play is accepted and then reported as a failed delivery (message.failed with channel_refused). - `body: optional string` Optional text below the card's image or video, with at most two line breaks. - `reply_buttons: optional array of object { id, title }` Buttons the customer taps to reply. Use either url_button or reply_buttons on every card. - `id: string` Your identifier for the button, echoed back as the template_reply's payload. Unique across the whole carousel. - `title: string` The button's visible label. - `url_button: optional object { display_text, url }` One button that opens a URL. Use either url_button or reply_buttons on every card. - `display_text: string` The button's visible label. - `url: string` The absolute https URL the button opens. - `type: "interactive_carousel"` - `"interactive_carousel"` - `LocationRequest object { body, type }` Asks the customer to share a location. The response arrives as a location part. - `body: string` Prompt shown above the send-location button. - `type: "location_request"` - `"location_request"` - `ContactRequest object { body, type }` Asks the customer to share their own contact card with one tap. Useful when you know the customer only by a username identifier and need a phone number. The answer arrives as an ordinary contacts part whose card carries origin contact_request; a card the customer shares by hand carries origin other instead. The answer is not linked to your request as a reply: its message carries no reply_to_message_id, so match it by origin and timing. Sendable inside the customer window. - `body: string` Prompt shown above the share-contact button. - `type: "contact_request"` - `"contact_request"` - `AddressRequest object { body, country, type }` Reserved for asking an eligible customer in India to submit a structured address. Sending this part is not available until business and customer eligibility can be verified at acceptance. Address responses already arrive as address_reply parts. - `body: string` Prompt shown above the address form. - `country: "IN"` ISO country code. Structured address requests are currently available only in India. - `"IN"` - `type: "address_request"` - `"address_request"` - `Contacts object { contacts, type }` One or more contact cards. - `contacts: array of object { name, addresses, birthday, 5 more }` The contact cards to send. The channel permits far more; this API caps a message at five, because a message carrying hundreds of cards is a mistake rather than a use case. - `name: object { formatted_name, first_name, last_name, 3 more }` - `formatted_name: string` The contact's full display name. - `first_name: optional string` - `last_name: optional string` - `middle_name: optional string` - `prefix: optional string` - `suffix: optional string` - `addresses: optional array of object { city, country, country_code, 4 more }` - `city: optional string` - `country: optional string` - `country_code: optional string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `state: optional string` - `street: optional string` - `zip: optional string` - `birthday: optional string` The contact's birthday as YYYY-MM-DD. - `emails: optional array of object { email, kind }` - `email: string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `org: optional object { company, department, title }` - `company: optional string` - `department: optional string` - `title: optional string` - `origin: optional string` Response-only: how the customer came to share this card, as the channel reported it, verbatim. contact_request means they tapped the share button on a contact_request you sent; other means they shared a card themselves. New values may appear, so treat any other value as unrecognised rather than as either of these. Absent when the channel did not say, and on cards received before it was recorded. A send carrying it is rejected with a pointer at the member. - `phones: optional array of object { phone, kind, messaging_id }` - `phone: string` The phone number, ideally in +E.164 form. - `kind: optional string` A label for the number, e.g. CELL, MAIN, WORK, HOME. - `messaging_id: optional string` The contact's messaging-account identifier on this channel, when known — makes the card openable in the messaging app. - `urls: optional array of object { url, kind }` - `url: string` - `kind: optional string` A label for the URL, e.g. WORK, HOME. - `type: "contacts"` - `"contacts"` - `Location object { latitude, longitude, type, 2 more }` A location pin. - `latitude: number` Latitude in decimal degrees. - `longitude: number` Longitude in decimal degrees. - `type: "location"` - `"location"` - `address: optional string` The place's address, shown under the name. - `name: optional string` The place's name, shown on the pin. - `Reaction object { emoji, type, channel_message_id, message_id }` An emoji reaction to an earlier message in the chat. message_id is this API's Message.id for the target in both directions: it is what you send, and it is appended to an inbound reaction whenever the target is a message of the same chat. channel_message_id is the channel's opaque identifier and appears on inbound reactions only. - `emoji: string` A single emoji. Send an empty string to remove a previous reaction to the same message. - `type: "reaction"` - `"reaction"` - `channel_message_id: optional string` Inbound only: the channel's opaque identifier for the message being reacted to. Always present on an inbound reaction, beside message_id whenever the target resolved. Match it literally to Message.channel_message_id in the chat transcript; never parse it or compare it with Message.id. - `message_id: optional string` This API's Message.id for the message being reacted to. Outbound: required, and the API resolves it into the channel namespace before sending, so the message must be one this account can see in the chat the send addresses. Inbound: present whenever the target is a message of the same chat, so you can keep only this identifier; absent when the chat does not hold the target. - `InteractiveReply object { id, kind, title, 2 more }` Inbound only — never sendable. The customer's selection from an interactive_list (kind list_reply) or interactive_buttons (kind button_reply) message, carrying the id you assigned to the chosen row or button. - `id: string` The id you assigned to the chosen row or button, exactly as you sent it. - `kind: "list_reply" or "button_reply"` Which interactive message kind was answered. - `"list_reply"` - `"button_reply"` - `title: string` The chosen row's or button's visible title. - `type: "interactive_reply"` - `"interactive_reply"` - `description: optional string` The chosen list row's secondary text, when it had one. - `TemplateReply object { payload, text, type }` Inbound only — never sendable. The customer tapped a quick-reply button on an approved template you sent, or a reply button on a card of an interactive_carousel you sent. payload is the value you set on that button: the template's quick_reply slot payload (or the button's label when you left the slot out), or the carousel card button's id. text is the label the customer saw. A carousel tap carries nothing else that identifies the card, so the id you chose is the card's only identity. For a template tap, the message's reply_to_message_id names the template message that carried the button. Distinct from interactive_reply, which answers an interactive_buttons or interactive_list message. - `payload: string` The quick_reply slot's payload from your send, or the button label when the slot was omitted; for a carousel card, the tapped reply button's id. - `text: string` The tapped button's label, as the customer saw it. - `type: "template_reply"` - `"template_reply"` - `AddressReply object { type, values, saved_address_id }` Inbound only: the structured values submitted in response to an address request. - `type: "address_reply"` - `"address_reply"` - `values: object { address, building_name, city, 8 more }` - `address: optional string` - `building_name: optional string` - `city: optional string` - `floor_number: optional string` - `house_number: optional string` - `landmark_area: optional string` - `name: optional string` - `phone_number: optional string` - `pin_code: optional string` - `state: optional string` - `tower_number: optional string` - `saved_address_id: optional string` Identifier of the selected saved address, when one was selected. - `Order object { catalog_id, items, type, text }` Inbound only — never sendable. An order the customer placed from a product catalog. - `catalog_id: string` The catalog the ordered items belong to. - `items: array of object { currency, price, product_retailer_id, quantity }` The ordered items. - `currency: string` ISO 4217 currency code for price. - `price: number` The per-item price at order time. - `product_retailer_id: string` Your identifier for the product, as registered in the catalog. - `quantity: number` - `type: "order"` - `"order"` - `text: optional string` Free text the customer attached to the order, when any. - `Referral object { type, body, click_id, 7 more }` Inbound only — never sendable. The ad or post context a customer's first message arrived from (for example an ad whose call to action opens a chat). A referral also opens a free-entry-point customer window — see the chat's customer_window. - `type: "referral"` - `"referral"` - `body: optional string` The ad's body text at click time. - `click_id: optional string` The click identifier assigned by the ad platform, for attribution. - `headline: optional string` The ad's headline at click time. - `image_url: optional string` URL of the ad's image creative, when media_kind is image. - `media_kind: optional string` The ad creative's media kind, e.g. image or video. - `source_id: optional string` The ad or post id. - `source_kind: optional string` What the source was, e.g. ad or post. - `source_url: optional string` The URL of the ad or post the customer came from. - `video_url: optional string` URL of the ad's video creative, when media_kind is video. - `System object { body, type, event }` Inbound only — never sendable. A system event in the chat, such as the customer changing their number. New event kinds appear over time; body is always present and human-readable. - `body: string` Human-readable description of the system event. - `type: "system"` - `"system"` - `event: optional string` The system event's kind, when the channel identifies one. New kinds appear over time — treat unknown values as informational. - `Unsupported object { raw, type, kind }` Inbound only — never sendable. A message kind this API does not yet type natively, carried as a typed passthrough: raw holds the channel payload, so a new message kind is never a black box or a silent drop. Native part types for popular kinds are added over time; this part is the compatibility guarantee in the meantime. - `raw: unknown` The channel payload — any JSON value: object, array, string, number, boolean, or null. Deliberately unconstrained, because the whole point of this part is to carry a shape this API does not yet know. For rows written by API version 1.3.0 or later, object member order, number formatting and duplicated members survive storage and read-back. The canonical encoder may compact insignificant whitespace before storage. Rows written before API version 1.3.0 retain normalized JSON only: member order and number formatting may differ, and only the last duplicated member survives. - `type: "unsupported"` - `"unsupported"` - `kind: optional string` The channel's name for the message kind, when it declares one. - `status: string` The message's delivery state as last reported. Inbound messages read `received`: they arrived, and no delivery of ours ran. A message you sent starts `accepted` and moves through `sent`, `delivered` and `read` as the channel reports them, with `failed` as the definitive negative outcome. `unknown` means exactly that: the send is INDETERMINATE and we decline to guess. It is NOT terminal — an indeterminate send is never re-sent, and it resolves to `sent`, `delivered`, `read` or `failed` when the channel's own report arrives — so keep observing rather than treating it as an outcome. States are reported asynchronously on the chat's event sequence, and the set grows additively: treat a value you do not recognise as "no information" rather than failing on it. Retention of this published status follows the chat transcript policy: there is no scheduled pruning, but no fixed minimum availability period is published yet. The present absence of a scheduled age-based sweep is not a promise of indefinite availability. `delivered` is reported by the channel after it accepted the message and can lag by hours, never arrive at all, or be followed by a failure, so do not build timeouts around it arriving promptly. - `channel_message_id: optional string` The channel's opaque identifier for this message, when the channel has assigned one. An inbound reaction's `channel_message_id` matches this field literally; never parse it or compare it with `id`. It is absent while an accepted outbound message has not yet received a channel identifier, and until it is present an inbound reaction to this message carries only `channel_message_id`. - `failure: optional object { code, message }` Why a failed message failed, when we have a reason worth publishing. Present only on `status` `failed`, and not on every one of those: a message can fail for a reason outside the published vocabulary and carry no `failure` at all. Its absence means "no published reason", never "no reason". Most messages the channel refused do carry one: a specific code where one is published, and `channel_refused` for most of the rest; a few kinds of refusal still carry none. `status` stays the thing to branch on. This is additive detail beside it, so an integration written before this field existed still sees a terminal `failed` and behaves exactly as it did. - `code: string` The specific reason. `sender_deregistered` — the number this message was going out from is no longer a registered sending number, and the message never left. This is terminal: it is not a pause and it does not clear, so retrying the same message cannot succeed and that conversation is over. Reach this customer by starting a new one on another of your numbers with a template, exactly as you would any customer whose 24-hour window has closed; `GET /v1/chats` shows which number each conversation uses. You are not billed for a message that failed this way. `quality_hold_expired` — this marketing message remained held by an automatic safety control on its sending line for ten minutes and was not sent. This is terminal: retrying the same message cannot succeed on that conversation. Send marketing from another of your numbers with a template, or contact support about the sending line. You are not billed for a message that failed this way. `target_message_failed` — the message this one quotes or reacts to failed, or its outcome could not be established, before this message went out. This message was therefore never sent, because a quote is never sent without its context. A `message.failed` event reports it. This is terminal: send it again as a new message, without that target or naming one that was sent. You are not billed a channel charge for it, though it still counts toward your platform subscription's message volume. `recipient_country_restricted` — the business behind the sending number is not currently permitted to message customers in this recipient's country, so the message was not delivered. The restriction blocks every message type, including replies inside the customer's 24-hour window. This is terminal for the message: sending it again cannot succeed while the restriction stands. Most countries unlock only when the business has completed business verification and has held an assigned messaging tier of 2,000 or higher for 30 consecutive days. The assigned tier is what counts, not how many messages you send. Brazil and Indonesia also require the business's primary business location to be in that country, at any tier: a business located elsewhere cannot message customers there. Until the business qualifies, sends to that country will keep failing. The channel publishes no list of restricted country pairs and offers no API signal before a send. If the business meets these conditions and the restriction stands, review the messaging policy for the business's category. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `payment_method_required` — the business behind the sending number has no working payment method on its messaging account, so this message was not sent. This is terminal for the message: retrying it cannot succeed until a payment method is added. Add or update the payment method in the messaging account's billing settings, then send again as a new message. Replies inside an open 24-hour customer window are charged too once the sending number's monthly free allowance of them is used up, so they also need a working payment method and can fail this way. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `recipient_phone_number_required` — this customer is known only by a username identifier, not a phone number, and this message can be delivered only to a phone number, so it was not sent. This is terminal for the message: sending it again to this customer cannot succeed. One-time-code templates (copy code, one-tap or zero-tap autofill) are the usual cause; deliver the code another way. Other messages, including templates without a one-time-code button, can still be sent to this customer. When the template is known in advance to carry a one-time-code button, the send is refused at once with the error `recipient_phone_number_required` instead and nothing is accepted. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `business_restricted` — this message was refused because the business behind the sending number is most likely restricted on its messaging account, so it was not sent. This is terminal for the message: sending it again will not succeed while the restriction stands. Review the status of the business's messaging account, and if the business believes it complies with the messaging policies, request a review of the restriction. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `channel_refused` — this message was refused upstream and was not sent, for a reason that has no more specific code here, and it will not be retried automatically. Contact support with this message's `id` to learn the reason and whether sending it again can succeed. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. A more specific code may be published for some of these refusals in a later release; treat a code you do not recognise exactly as you treat this one. - `message: string` Human-readable, written for a person reading it. Do not branch on it. - `from: optional string` The number this message left by, or arrived on, in E.164 (leading `+`). Every message in one conversation carries the same value — a conversation never moves to another number. Absent only if the number is no longer one of yours. - `from_selection: optional object { reason }` Present only when this service chose the sending number for you — that is, when you omitted `from`. A send that named `from` omits this rather than reporting a choice nobody made. - `reason: string` Why this number was used. Exactly one of: - `reused_active_chat` — this customer already had a conversation and it continues on the same number. - `new_best_number` — there was no existing conversation, so the best available number was chosen. Like every other vocabulary here it is a plain string that may grow additively; treat a value you do not recognise as "chosen for you". - `reply_to_message_id: optional string` This API's `id` of the earlier message in this chat that this message replies to. On an inbound message it is the message the customer quoted; on an outbound message it is the `reply_to_message_id` you sent. Look the value up in this chat's transcript to show what was answered; it is the same namespace as `id`, never a channel identifier. Absent when there is no reply context this API can resolve — a message that quotes nothing, or one that quotes a message this API never recorded in this chat. Treat absence as "no reply context available", not as proof the message was not a reply. - `zero_retention: optional true` True when the message is under zero-day retention: its content is not kept, so later reads and idempotent retries return empty `parts`. The original send response still carries the content. Retention applies only within Linq's systems. The WhatsApp channel operator's own processing and retention of message content are governed by its terms and are not affected by this setting. - `true` ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/messages \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" \ -d '{ "parts": [ { "body": "body", "type": "text" } ], "to": "to" }' ``` #### Response ```json { "id": "id", "chat_id": "chat_id", "created_at": "2019-12-27T18:11:19.117Z", "direction": "inbound", "parts": [ { "body": "body", "type": "text", "preview_url": true } ], "status": "status", "channel_message_id": "channel_message_id", "failure": { "code": "code", "message": "message" }, "from": "from", "from_selection": { "reason": "reason" }, "reply_to_message_id": "reply_to_message_id", "zero_retention": true } ``` ## Domain Types ### Accepted Message - `AcceptedMessage object { id, chat_id, created_at, 9 more }` An accepted send: the message, plus how its sending number was chosen. - `id: string` This API's message id. Put this value in an outbound reaction's `message_id`; an inbound reaction to this message carries the same value in its `message_id`, so this is the one identifier you need to keep. Mark-as-read targets the latest unread inbound message in a chat, so it takes the chat id. - `chat_id: string` The chat this message belongs to. - `created_at: string` - `direction: "inbound" or "outbound"` `inbound` (from the customer) or `outbound` (sent by you). - `"inbound"` - `"outbound"` - `parts: array of object { body, type, preview_url } or object { kind, type, availability, 10 more } or object { language, name, type, 4 more } or 17 more` The message content — sendable parts, plus the inbound-only types on inbound messages. Empty only when `zero_retention` is true, or when an idempotent retry returns an ephemeral message whose content retention cleanup has removed. - `Text object { body, type, preview_url }` A plain text message. - `body: string` The message text. URLs render as tappable links. - `type: "text"` - `"text"` - `preview_url: optional boolean` Render a preview card for the first URL in body. Defaults to false. - `Media object { kind, type, availability, 10 more }` A media message — image, video, audio, document, or sticker. The two identifiers are distinct namespaces: inbound media carries the channel's transient media_id; outbound media carries our durable upload_ref from POST /v1/media. - `kind: "image" or "video" or "audio" or 2 more` Which kind of media this is. Captions apply to image, video and document only; filename applies to document only. - `"image"` - `"video"` - `"audio"` - `"document"` - `"sticker"` - `type: "media"` - `"media"` - `availability: optional "available" or "unavailable" or "pending"` Response only, inbound parts only: whether the download answers the bytes. available: the file was captured and is retained. unavailable: it is not downloadable now, and unavailable_reason says why; with timed_out the download answers 409 while capture continues and can later answer 200, otherwise it answers 410, or 404 once the file is no longer known. It describes the file, not the exact HTTP answer of a later download, which can also refuse for capacity or authorization. pending: capture has not finished yet; only reads of the conversation return pending, and a message event never does. A message.received event is recorded once every attachment has been captured or has failed, or ten minutes after the message arrived, whichever comes first; an event part without availability is from a historical event and may still be capturing, so retry its download as the 409 Retry-After directs. A message event keeps the value it was recorded with; reads return the current one. Historical messages received before it was recorded omit it. Never accepted on sends. - `"available"` - `"unavailable"` - `"pending"` - `byte_size: optional number` Response only, inbound parts only: the exact size in bytes of the retained attachment, equal to the download's Content-Length. Present only while the bytes are captured and retained — the same lifetime as a working url, ending 30 days after server receipt — so it can be absent from a message event while capture has not completed, and its absence is not final; once present it never changes. Absent rather than zero. Never accepted on sends. - `caption: optional string` Caption rendered with the media. Image, video and document only — a caption on an audio or sticker part is rejected, never dropped. - `filename: optional string` Display filename. Documents only — a filename on any other kind is rejected, never dropped. - `media_id: optional string` Inbound only: the channel's transient media identifier. It expires after seven days and is never an outbound address; an outbound value is rejected with a pointer to media_id and upload_ref as the remedy. - `mime_type: optional string` Response only, inbound parts only: the media type the channel declared when the message arrived, verbatim. It may carry parameters (for example audio/ogg; codecs=opus) and may differ from the Content-Type the download answers with, which describes the retained bytes. Present on the webhook body and on every later read with the same value. Historical messages received before it was recorded omit this field. Never accepted on sends. - `source_url: optional string` Outbound only: a public https URL of the bytes to send, as an alternative to upload_ref. Supply exactly one of upload_ref or source_url. The address is fetched once, before the send is accepted, and its exact bytes are stored as an ordinary upload in this account and key partition; the accepted message and every later read carry that upload's upload_ref, never the address, and no retry fetches it again. The URL must be absolute https on the default port with no credentials and no fragment, must resolve to a public address (every redirect hop included, at most three), and must answer with the complete bytes and their exact media type within the fetch deadline. The bytes are then held to the same media type and size rules as POST /v1/media for the part's kind; a mismatch is refused, never converted. - `unavailable_reason: optional string` Response only, present only when availability is unavailable. An open string: the values today are timed_out, capture_failed and expired, and new values may be added. timed_out: the file was still being retrieved ten minutes after the message arrived, so its message event was recorded without it; retrieval continues and the file may become downloadable later, which reads of the conversation report. capture_failed: the file could not be retrieved. expired: the file was retrieved and is no longer retained, or is no longer known (the download then answers 410 or 404). Treat an unknown value as capture_failed. Never accepted on sends. - `upload_ref: optional string` Outbound only: our durable handle returned by POST /v1/media. Handles visibly begin upload. and are reusable within the account and key partition that created them. - `url: optional string` Response only: stable attachment download URL requiring the account Bearer key on every request. Pending capture returns 409 with Retry-After; retained bytes expire 30 days after server receipt. Historical unbound messages omit this field. Never accepted on sends. - `voice: optional boolean` Audio only. On a send it is optional: true sends the audio as a voice note; false, or leaving it out, sends it as an ordinary audio file. A voice note needs an upload stored as audio/ogg that holds mono Opus audio, sent by upload_ref or source_url within the existing audio size limit. The bytes are sent as supplied: they are never converted or inspected, so encode them as mono Opus before uploading. The recipient sees a play button only when the voice file is 512 KB or smaller; a larger voice note is still delivered but must be downloaded before it plays. On incoming audio parts it is response-only: whether the channel reported the audio as a voice note, verbatim. true means it was recorded with the messaging client's voice-recording feature; false means it was sent as an audio file. Present on the webhook body and on every later read with the same value. Absent on an incoming part means the channel did not say, never that the audio is not a voice note. Other kinds never carry it, and historical messages received before it was recorded omit it. - `Template object { language, name, type, 4 more }` An approved message template — the one part type sendable outside an open customer service window. name and language identify the approved template; parameters fills its named placeholders. Authentication templates use this same generic part: their published parameter schema names exactly one parameter, `code` — the one-time code you generate, 1–15 characters — and the message shows it in its body and behind its code button. Every sendable template is registered and approved ahead of the send and publishes its own parameter schema — a send referencing an unknown template, a missing or unknown parameter, or a value that breaks the template's rules is rejected with a 422 naming the exact field. - `language: string` The template's language-and-locale code, e.g. en_US. - `name: string` The approved template's name. Lowercase letters, digits and underscores only. - `type: "template"` - `"template"` - `buttons: optional array of object { index, payload, type }` Send-time values for this approved template's own dynamic buttons, in ascending index order: a url button whose destination ends in {{1}} takes the value appended there and is REQUIRED; a quick_reply button takes the payload returned to you when it is tapped and is OPTIONAL — omit it and the button returns its label. Fixed buttons have no slot. The approved template's send_schema lists the (index, type) slots and an x-rule stating which are required; omit buttons entirely for a template with no url slot when the labels are what you want back. - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `cards: optional array of object { card_index, kind, upload_ref, 2 more }` Per-card values for an approved media-card carousel. The approved template's send_schema provides structural bounds and an x-rule listing the exact card order, media kind, named body values, and dynamic button slots enforced by runtime L2 validation. Omit for non-carousel templates. - `card_index: number` - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: string` A durable handle returned by POST /v1/media. It is resolved within this key's account and partition, then consumed into a transient channel media identifier only at delivery. - `buttons: optional array of object { index, payload, type }` - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `parameters: optional unknown` Named values for this card's body placeholders. - `header: optional object { kind, upload_ref }` The uploaded media used for this approved template's media header. Omit unless this template's send_schema requires it. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `parameters: optional unknown` Named values for the template's placeholders. The shape is per-template: each registered template publishes its own parameter schema — hand THAT schema to your model when composing a specific template. Omit for templates with no placeholders. - `InteractiveList object { body, button, sections, 3 more }` An interactive list message: body text plus a button that opens a sectioned list of selectable rows. The customer's selection arrives as an inbound interactive_reply part with kind list_reply, carrying the chosen row's id. - `body: string` The message body. - `button: string` Label of the button that opens the list. - `sections: array of object { rows, title }` The list's sections, each holding selectable rows. At most 10 rows in total across ALL sections combined — not 10 per section. - `rows: array of object { id, title, description }` This section's rows. The 10-row limit is on the TOTAL across all sections, so a second section reduces what this one may hold. - `id: string` Your identifier for the row — echoed back as the interactive_reply's id. - `title: string` The row's visible title. - `description: optional string` Secondary text under the title. - `title: optional string` Section title. Required when the list has more than one section. - `type: "interactive_list"` - `"interactive_list"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `InteractiveButtons object { body, buttons, type, 3 more }` An interactive reply-buttons message: body text plus up to three tappable buttons. The customer's tap arrives as an inbound interactive_reply part with kind button_reply, carrying the tapped button's id. - `body: string` The message body. - `buttons: array of object { id, title }` The tappable buttons — at most three. - `id: string` Your identifier for the button — echoed back as the interactive_reply's id. - `title: string` The button's visible label. - `type: "interactive_buttons"` - `"interactive_buttons"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `InteractiveCtaURL object { body, display_text, type, 4 more }` An interactive call-to-action message: body text plus one button that opens a URL. - `body: string` The message body. - `display_text: string` The button's visible label. - `type: "interactive_cta_url"` - `"interactive_cta_url"` - `url: string` The URL the button opens. Must be absolute, with an http or https scheme. - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref, filename }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `filename: optional string` The file name the customer sees on a document header. Documents only. - `InteractiveCarousel object { body, cards, type }` An interactive carousel: one message whose body sits above 2 to 10 horizontally scrolling cards. Each card shows an uploaded image, or a video from a public link, and either one button that opens a URL or reply buttons. A tap on a card's reply button arrives as an inbound template_reply part whose payload is that button's id; nothing else in the reply identifies the card, so the id you choose is the card's identity. - `body: string` The message text shown above the cards. - `cards: array of object { card_index, header, body, 2 more }` The cards, left to right. - `card_index: number` This card's zero-based position: the first card is 0, the next 1, and so on, in array order. - `header: object { kind, upload_ref, url }` The card's media: an image named by upload_ref, or a video named by the public https url it plays from. Every card carries the same kind. - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: optional string` A durable handle returned by POST /v1/media for an image upload. Image cards only. - `url: optional string` The public https address the card's video plays from. Video cards only. It is sent exactly as written and never fetched by this API, so it must be publicly reachable and serve a playable video; a link that does not play is accepted and then reported as a failed delivery (message.failed with channel_refused). - `body: optional string` Optional text below the card's image or video, with at most two line breaks. - `reply_buttons: optional array of object { id, title }` Buttons the customer taps to reply. Use either url_button or reply_buttons on every card. - `id: string` Your identifier for the button, echoed back as the template_reply's payload. Unique across the whole carousel. - `title: string` The button's visible label. - `url_button: optional object { display_text, url }` One button that opens a URL. Use either url_button or reply_buttons on every card. - `display_text: string` The button's visible label. - `url: string` The absolute https URL the button opens. - `type: "interactive_carousel"` - `"interactive_carousel"` - `LocationRequest object { body, type }` Asks the customer to share a location. The response arrives as a location part. - `body: string` Prompt shown above the send-location button. - `type: "location_request"` - `"location_request"` - `ContactRequest object { body, type }` Asks the customer to share their own contact card with one tap. Useful when you know the customer only by a username identifier and need a phone number. The answer arrives as an ordinary contacts part whose card carries origin contact_request; a card the customer shares by hand carries origin other instead. The answer is not linked to your request as a reply: its message carries no reply_to_message_id, so match it by origin and timing. Sendable inside the customer window. - `body: string` Prompt shown above the share-contact button. - `type: "contact_request"` - `"contact_request"` - `AddressRequest object { body, country, type }` Reserved for asking an eligible customer in India to submit a structured address. Sending this part is not available until business and customer eligibility can be verified at acceptance. Address responses already arrive as address_reply parts. - `body: string` Prompt shown above the address form. - `country: "IN"` ISO country code. Structured address requests are currently available only in India. - `"IN"` - `type: "address_request"` - `"address_request"` - `Contacts object { contacts, type }` One or more contact cards. - `contacts: array of object { name, addresses, birthday, 5 more }` The contact cards to send. The channel permits far more; this API caps a message at five, because a message carrying hundreds of cards is a mistake rather than a use case. - `name: object { formatted_name, first_name, last_name, 3 more }` - `formatted_name: string` The contact's full display name. - `first_name: optional string` - `last_name: optional string` - `middle_name: optional string` - `prefix: optional string` - `suffix: optional string` - `addresses: optional array of object { city, country, country_code, 4 more }` - `city: optional string` - `country: optional string` - `country_code: optional string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `state: optional string` - `street: optional string` - `zip: optional string` - `birthday: optional string` The contact's birthday as YYYY-MM-DD. - `emails: optional array of object { email, kind }` - `email: string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `org: optional object { company, department, title }` - `company: optional string` - `department: optional string` - `title: optional string` - `origin: optional string` Response-only: how the customer came to share this card, as the channel reported it, verbatim. contact_request means they tapped the share button on a contact_request you sent; other means they shared a card themselves. New values may appear, so treat any other value as unrecognised rather than as either of these. Absent when the channel did not say, and on cards received before it was recorded. A send carrying it is rejected with a pointer at the member. - `phones: optional array of object { phone, kind, messaging_id }` - `phone: string` The phone number, ideally in +E.164 form. - `kind: optional string` A label for the number, e.g. CELL, MAIN, WORK, HOME. - `messaging_id: optional string` The contact's messaging-account identifier on this channel, when known — makes the card openable in the messaging app. - `urls: optional array of object { url, kind }` - `url: string` - `kind: optional string` A label for the URL, e.g. WORK, HOME. - `type: "contacts"` - `"contacts"` - `Location object { latitude, longitude, type, 2 more }` A location pin. - `latitude: number` Latitude in decimal degrees. - `longitude: number` Longitude in decimal degrees. - `type: "location"` - `"location"` - `address: optional string` The place's address, shown under the name. - `name: optional string` The place's name, shown on the pin. - `Reaction object { emoji, type, channel_message_id, message_id }` An emoji reaction to an earlier message in the chat. message_id is this API's Message.id for the target in both directions: it is what you send, and it is appended to an inbound reaction whenever the target is a message of the same chat. channel_message_id is the channel's opaque identifier and appears on inbound reactions only. - `emoji: string` A single emoji. Send an empty string to remove a previous reaction to the same message. - `type: "reaction"` - `"reaction"` - `channel_message_id: optional string` Inbound only: the channel's opaque identifier for the message being reacted to. Always present on an inbound reaction, beside message_id whenever the target resolved. Match it literally to Message.channel_message_id in the chat transcript; never parse it or compare it with Message.id. - `message_id: optional string` This API's Message.id for the message being reacted to. Outbound: required, and the API resolves it into the channel namespace before sending, so the message must be one this account can see in the chat the send addresses. Inbound: present whenever the target is a message of the same chat, so you can keep only this identifier; absent when the chat does not hold the target. - `InteractiveReply object { id, kind, title, 2 more }` Inbound only — never sendable. The customer's selection from an interactive_list (kind list_reply) or interactive_buttons (kind button_reply) message, carrying the id you assigned to the chosen row or button. - `id: string` The id you assigned to the chosen row or button, exactly as you sent it. - `kind: "list_reply" or "button_reply"` Which interactive message kind was answered. - `"list_reply"` - `"button_reply"` - `title: string` The chosen row's or button's visible title. - `type: "interactive_reply"` - `"interactive_reply"` - `description: optional string` The chosen list row's secondary text, when it had one. - `TemplateReply object { payload, text, type }` Inbound only — never sendable. The customer tapped a quick-reply button on an approved template you sent, or a reply button on a card of an interactive_carousel you sent. payload is the value you set on that button: the template's quick_reply slot payload (or the button's label when you left the slot out), or the carousel card button's id. text is the label the customer saw. A carousel tap carries nothing else that identifies the card, so the id you chose is the card's only identity. For a template tap, the message's reply_to_message_id names the template message that carried the button. Distinct from interactive_reply, which answers an interactive_buttons or interactive_list message. - `payload: string` The quick_reply slot's payload from your send, or the button label when the slot was omitted; for a carousel card, the tapped reply button's id. - `text: string` The tapped button's label, as the customer saw it. - `type: "template_reply"` - `"template_reply"` - `AddressReply object { type, values, saved_address_id }` Inbound only: the structured values submitted in response to an address request. - `type: "address_reply"` - `"address_reply"` - `values: object { address, building_name, city, 8 more }` - `address: optional string` - `building_name: optional string` - `city: optional string` - `floor_number: optional string` - `house_number: optional string` - `landmark_area: optional string` - `name: optional string` - `phone_number: optional string` - `pin_code: optional string` - `state: optional string` - `tower_number: optional string` - `saved_address_id: optional string` Identifier of the selected saved address, when one was selected. - `Order object { catalog_id, items, type, text }` Inbound only — never sendable. An order the customer placed from a product catalog. - `catalog_id: string` The catalog the ordered items belong to. - `items: array of object { currency, price, product_retailer_id, quantity }` The ordered items. - `currency: string` ISO 4217 currency code for price. - `price: number` The per-item price at order time. - `product_retailer_id: string` Your identifier for the product, as registered in the catalog. - `quantity: number` - `type: "order"` - `"order"` - `text: optional string` Free text the customer attached to the order, when any. - `Referral object { type, body, click_id, 7 more }` Inbound only — never sendable. The ad or post context a customer's first message arrived from (for example an ad whose call to action opens a chat). A referral also opens a free-entry-point customer window — see the chat's customer_window. - `type: "referral"` - `"referral"` - `body: optional string` The ad's body text at click time. - `click_id: optional string` The click identifier assigned by the ad platform, for attribution. - `headline: optional string` The ad's headline at click time. - `image_url: optional string` URL of the ad's image creative, when media_kind is image. - `media_kind: optional string` The ad creative's media kind, e.g. image or video. - `source_id: optional string` The ad or post id. - `source_kind: optional string` What the source was, e.g. ad or post. - `source_url: optional string` The URL of the ad or post the customer came from. - `video_url: optional string` URL of the ad's video creative, when media_kind is video. - `System object { body, type, event }` Inbound only — never sendable. A system event in the chat, such as the customer changing their number. New event kinds appear over time; body is always present and human-readable. - `body: string` Human-readable description of the system event. - `type: "system"` - `"system"` - `event: optional string` The system event's kind, when the channel identifies one. New kinds appear over time — treat unknown values as informational. - `Unsupported object { raw, type, kind }` Inbound only — never sendable. A message kind this API does not yet type natively, carried as a typed passthrough: raw holds the channel payload, so a new message kind is never a black box or a silent drop. Native part types for popular kinds are added over time; this part is the compatibility guarantee in the meantime. - `raw: unknown` The channel payload — any JSON value: object, array, string, number, boolean, or null. Deliberately unconstrained, because the whole point of this part is to carry a shape this API does not yet know. For rows written by API version 1.3.0 or later, object member order, number formatting and duplicated members survive storage and read-back. The canonical encoder may compact insignificant whitespace before storage. Rows written before API version 1.3.0 retain normalized JSON only: member order and number formatting may differ, and only the last duplicated member survives. - `type: "unsupported"` - `"unsupported"` - `kind: optional string` The channel's name for the message kind, when it declares one. - `status: string` The message's delivery state as last reported. Inbound messages read `received`: they arrived, and no delivery of ours ran. A message you sent starts `accepted` and moves through `sent`, `delivered` and `read` as the channel reports them, with `failed` as the definitive negative outcome. `unknown` means exactly that: the send is INDETERMINATE and we decline to guess. It is NOT terminal — an indeterminate send is never re-sent, and it resolves to `sent`, `delivered`, `read` or `failed` when the channel's own report arrives — so keep observing rather than treating it as an outcome. States are reported asynchronously on the chat's event sequence, and the set grows additively: treat a value you do not recognise as "no information" rather than failing on it. Retention of this published status follows the chat transcript policy: there is no scheduled pruning, but no fixed minimum availability period is published yet. The present absence of a scheduled age-based sweep is not a promise of indefinite availability. `delivered` is reported by the channel after it accepted the message and can lag by hours, never arrive at all, or be followed by a failure, so do not build timeouts around it arriving promptly. - `channel_message_id: optional string` The channel's opaque identifier for this message, when the channel has assigned one. An inbound reaction's `channel_message_id` matches this field literally; never parse it or compare it with `id`. It is absent while an accepted outbound message has not yet received a channel identifier, and until it is present an inbound reaction to this message carries only `channel_message_id`. - `failure: optional object { code, message }` Why a failed message failed, when we have a reason worth publishing. Present only on `status` `failed`, and not on every one of those: a message can fail for a reason outside the published vocabulary and carry no `failure` at all. Its absence means "no published reason", never "no reason". Most messages the channel refused do carry one: a specific code where one is published, and `channel_refused` for most of the rest; a few kinds of refusal still carry none. `status` stays the thing to branch on. This is additive detail beside it, so an integration written before this field existed still sees a terminal `failed` and behaves exactly as it did. - `code: string` The specific reason. `sender_deregistered` — the number this message was going out from is no longer a registered sending number, and the message never left. This is terminal: it is not a pause and it does not clear, so retrying the same message cannot succeed and that conversation is over. Reach this customer by starting a new one on another of your numbers with a template, exactly as you would any customer whose 24-hour window has closed; `GET /v1/chats` shows which number each conversation uses. You are not billed for a message that failed this way. `quality_hold_expired` — this marketing message remained held by an automatic safety control on its sending line for ten minutes and was not sent. This is terminal: retrying the same message cannot succeed on that conversation. Send marketing from another of your numbers with a template, or contact support about the sending line. You are not billed for a message that failed this way. `target_message_failed` — the message this one quotes or reacts to failed, or its outcome could not be established, before this message went out. This message was therefore never sent, because a quote is never sent without its context. A `message.failed` event reports it. This is terminal: send it again as a new message, without that target or naming one that was sent. You are not billed a channel charge for it, though it still counts toward your platform subscription's message volume. `recipient_country_restricted` — the business behind the sending number is not currently permitted to message customers in this recipient's country, so the message was not delivered. The restriction blocks every message type, including replies inside the customer's 24-hour window. This is terminal for the message: sending it again cannot succeed while the restriction stands. Most countries unlock only when the business has completed business verification and has held an assigned messaging tier of 2,000 or higher for 30 consecutive days. The assigned tier is what counts, not how many messages you send. Brazil and Indonesia also require the business's primary business location to be in that country, at any tier: a business located elsewhere cannot message customers there. Until the business qualifies, sends to that country will keep failing. The channel publishes no list of restricted country pairs and offers no API signal before a send. If the business meets these conditions and the restriction stands, review the messaging policy for the business's category. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `payment_method_required` — the business behind the sending number has no working payment method on its messaging account, so this message was not sent. This is terminal for the message: retrying it cannot succeed until a payment method is added. Add or update the payment method in the messaging account's billing settings, then send again as a new message. Replies inside an open 24-hour customer window are charged too once the sending number's monthly free allowance of them is used up, so they also need a working payment method and can fail this way. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `recipient_phone_number_required` — this customer is known only by a username identifier, not a phone number, and this message can be delivered only to a phone number, so it was not sent. This is terminal for the message: sending it again to this customer cannot succeed. One-time-code templates (copy code, one-tap or zero-tap autofill) are the usual cause; deliver the code another way. Other messages, including templates without a one-time-code button, can still be sent to this customer. When the template is known in advance to carry a one-time-code button, the send is refused at once with the error `recipient_phone_number_required` instead and nothing is accepted. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `business_restricted` — this message was refused because the business behind the sending number is most likely restricted on its messaging account, so it was not sent. This is terminal for the message: sending it again will not succeed while the restriction stands. Review the status of the business's messaging account, and if the business believes it complies with the messaging policies, request a review of the restriction. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `channel_refused` — this message was refused upstream and was not sent, for a reason that has no more specific code here, and it will not be retried automatically. Contact support with this message's `id` to learn the reason and whether sending it again can succeed. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. A more specific code may be published for some of these refusals in a later release; treat a code you do not recognise exactly as you treat this one. - `message: string` Human-readable, written for a person reading it. Do not branch on it. - `from: optional string` The number this message left by, or arrived on, in E.164 (leading `+`). Every message in one conversation carries the same value — a conversation never moves to another number. Absent only if the number is no longer one of yours. - `from_selection: optional object { reason }` Present only when this service chose the sending number for you — that is, when you omitted `from`. A send that named `from` omits this rather than reporting a choice nobody made. - `reason: string` Why this number was used. Exactly one of: - `reused_active_chat` — this customer already had a conversation and it continues on the same number. - `new_best_number` — there was no existing conversation, so the best available number was chosen. Like every other vocabulary here it is a plain string that may grow additively; treat a value you do not recognise as "chosen for you". - `reply_to_message_id: optional string` This API's `id` of the earlier message in this chat that this message replies to. On an inbound message it is the message the customer quoted; on an outbound message it is the `reply_to_message_id` you sent. Look the value up in this chat's transcript to show what was answered; it is the same namespace as `id`, never a channel identifier. Absent when there is no reply context this API can resolve — a message that quotes nothing, or one that quotes a message this API never recorded in this chat. Treat absence as "no reply context available", not as proof the message was not a reply. - `zero_retention: optional true` True when the message is under zero-day retention: its content is not kept, so later reads and idempotent retries return empty `parts`. The original send response still carries the content. Retention applies only within Linq's systems. The WhatsApp channel operator's own processing and retention of message content are governed by its terms and are not affected by this setting. - `true` ### Message - `Message object { id, chat_id, created_at, 8 more }` One message, in either direction. - `id: string` This API's message id. Put this value in an outbound reaction's `message_id`; an inbound reaction to this message carries the same value in its `message_id`, so this is the one identifier you need to keep. Mark-as-read targets the latest unread inbound message in a chat, so it takes the chat id. - `chat_id: string` The chat this message belongs to. - `created_at: string` - `direction: "inbound" or "outbound"` `inbound` (from the customer) or `outbound` (sent by you). - `"inbound"` - `"outbound"` - `parts: array of object { body, type, preview_url } or object { kind, type, availability, 10 more } or object { language, name, type, 4 more } or 17 more` The message content — sendable parts, plus the inbound-only types on inbound messages. Empty only when `zero_retention` is true, or when an idempotent retry returns an ephemeral message whose content retention cleanup has removed. - `Text object { body, type, preview_url }` A plain text message. - `body: string` The message text. URLs render as tappable links. - `type: "text"` - `"text"` - `preview_url: optional boolean` Render a preview card for the first URL in body. Defaults to false. - `Media object { kind, type, availability, 10 more }` A media message — image, video, audio, document, or sticker. The two identifiers are distinct namespaces: inbound media carries the channel's transient media_id; outbound media carries our durable upload_ref from POST /v1/media. - `kind: "image" or "video" or "audio" or 2 more` Which kind of media this is. Captions apply to image, video and document only; filename applies to document only. - `"image"` - `"video"` - `"audio"` - `"document"` - `"sticker"` - `type: "media"` - `"media"` - `availability: optional "available" or "unavailable" or "pending"` Response only, inbound parts only: whether the download answers the bytes. available: the file was captured and is retained. unavailable: it is not downloadable now, and unavailable_reason says why; with timed_out the download answers 409 while capture continues and can later answer 200, otherwise it answers 410, or 404 once the file is no longer known. It describes the file, not the exact HTTP answer of a later download, which can also refuse for capacity or authorization. pending: capture has not finished yet; only reads of the conversation return pending, and a message event never does. A message.received event is recorded once every attachment has been captured or has failed, or ten minutes after the message arrived, whichever comes first; an event part without availability is from a historical event and may still be capturing, so retry its download as the 409 Retry-After directs. A message event keeps the value it was recorded with; reads return the current one. Historical messages received before it was recorded omit it. Never accepted on sends. - `"available"` - `"unavailable"` - `"pending"` - `byte_size: optional number` Response only, inbound parts only: the exact size in bytes of the retained attachment, equal to the download's Content-Length. Present only while the bytes are captured and retained — the same lifetime as a working url, ending 30 days after server receipt — so it can be absent from a message event while capture has not completed, and its absence is not final; once present it never changes. Absent rather than zero. Never accepted on sends. - `caption: optional string` Caption rendered with the media. Image, video and document only — a caption on an audio or sticker part is rejected, never dropped. - `filename: optional string` Display filename. Documents only — a filename on any other kind is rejected, never dropped. - `media_id: optional string` Inbound only: the channel's transient media identifier. It expires after seven days and is never an outbound address; an outbound value is rejected with a pointer to media_id and upload_ref as the remedy. - `mime_type: optional string` Response only, inbound parts only: the media type the channel declared when the message arrived, verbatim. It may carry parameters (for example audio/ogg; codecs=opus) and may differ from the Content-Type the download answers with, which describes the retained bytes. Present on the webhook body and on every later read with the same value. Historical messages received before it was recorded omit this field. Never accepted on sends. - `source_url: optional string` Outbound only: a public https URL of the bytes to send, as an alternative to upload_ref. Supply exactly one of upload_ref or source_url. The address is fetched once, before the send is accepted, and its exact bytes are stored as an ordinary upload in this account and key partition; the accepted message and every later read carry that upload's upload_ref, never the address, and no retry fetches it again. The URL must be absolute https on the default port with no credentials and no fragment, must resolve to a public address (every redirect hop included, at most three), and must answer with the complete bytes and their exact media type within the fetch deadline. The bytes are then held to the same media type and size rules as POST /v1/media for the part's kind; a mismatch is refused, never converted. - `unavailable_reason: optional string` Response only, present only when availability is unavailable. An open string: the values today are timed_out, capture_failed and expired, and new values may be added. timed_out: the file was still being retrieved ten minutes after the message arrived, so its message event was recorded without it; retrieval continues and the file may become downloadable later, which reads of the conversation report. capture_failed: the file could not be retrieved. expired: the file was retrieved and is no longer retained, or is no longer known (the download then answers 410 or 404). Treat an unknown value as capture_failed. Never accepted on sends. - `upload_ref: optional string` Outbound only: our durable handle returned by POST /v1/media. Handles visibly begin upload. and are reusable within the account and key partition that created them. - `url: optional string` Response only: stable attachment download URL requiring the account Bearer key on every request. Pending capture returns 409 with Retry-After; retained bytes expire 30 days after server receipt. Historical unbound messages omit this field. Never accepted on sends. - `voice: optional boolean` Audio only. On a send it is optional: true sends the audio as a voice note; false, or leaving it out, sends it as an ordinary audio file. A voice note needs an upload stored as audio/ogg that holds mono Opus audio, sent by upload_ref or source_url within the existing audio size limit. The bytes are sent as supplied: they are never converted or inspected, so encode them as mono Opus before uploading. The recipient sees a play button only when the voice file is 512 KB or smaller; a larger voice note is still delivered but must be downloaded before it plays. On incoming audio parts it is response-only: whether the channel reported the audio as a voice note, verbatim. true means it was recorded with the messaging client's voice-recording feature; false means it was sent as an audio file. Present on the webhook body and on every later read with the same value. Absent on an incoming part means the channel did not say, never that the audio is not a voice note. Other kinds never carry it, and historical messages received before it was recorded omit it. - `Template object { language, name, type, 4 more }` An approved message template — the one part type sendable outside an open customer service window. name and language identify the approved template; parameters fills its named placeholders. Authentication templates use this same generic part: their published parameter schema names exactly one parameter, `code` — the one-time code you generate, 1–15 characters — and the message shows it in its body and behind its code button. Every sendable template is registered and approved ahead of the send and publishes its own parameter schema — a send referencing an unknown template, a missing or unknown parameter, or a value that breaks the template's rules is rejected with a 422 naming the exact field. - `language: string` The template's language-and-locale code, e.g. en_US. - `name: string` The approved template's name. Lowercase letters, digits and underscores only. - `type: "template"` - `"template"` - `buttons: optional array of object { index, payload, type }` Send-time values for this approved template's own dynamic buttons, in ascending index order: a url button whose destination ends in {{1}} takes the value appended there and is REQUIRED; a quick_reply button takes the payload returned to you when it is tapped and is OPTIONAL — omit it and the button returns its label. Fixed buttons have no slot. The approved template's send_schema lists the (index, type) slots and an x-rule stating which are required; omit buttons entirely for a template with no url slot when the labels are what you want back. - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `cards: optional array of object { card_index, kind, upload_ref, 2 more }` Per-card values for an approved media-card carousel. The approved template's send_schema provides structural bounds and an x-rule listing the exact card order, media kind, named body values, and dynamic button slots enforced by runtime L2 validation. Omit for non-carousel templates. - `card_index: number` - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: string` A durable handle returned by POST /v1/media. It is resolved within this key's account and partition, then consumed into a transient channel media identifier only at delivery. - `buttons: optional array of object { index, payload, type }` - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `parameters: optional unknown` Named values for this card's body placeholders. - `header: optional object { kind, upload_ref }` The uploaded media used for this approved template's media header. Omit unless this template's send_schema requires it. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `parameters: optional unknown` Named values for the template's placeholders. The shape is per-template: each registered template publishes its own parameter schema — hand THAT schema to your model when composing a specific template. Omit for templates with no placeholders. - `InteractiveList object { body, button, sections, 3 more }` An interactive list message: body text plus a button that opens a sectioned list of selectable rows. The customer's selection arrives as an inbound interactive_reply part with kind list_reply, carrying the chosen row's id. - `body: string` The message body. - `button: string` Label of the button that opens the list. - `sections: array of object { rows, title }` The list's sections, each holding selectable rows. At most 10 rows in total across ALL sections combined — not 10 per section. - `rows: array of object { id, title, description }` This section's rows. The 10-row limit is on the TOTAL across all sections, so a second section reduces what this one may hold. - `id: string` Your identifier for the row — echoed back as the interactive_reply's id. - `title: string` The row's visible title. - `description: optional string` Secondary text under the title. - `title: optional string` Section title. Required when the list has more than one section. - `type: "interactive_list"` - `"interactive_list"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `InteractiveButtons object { body, buttons, type, 3 more }` An interactive reply-buttons message: body text plus up to three tappable buttons. The customer's tap arrives as an inbound interactive_reply part with kind button_reply, carrying the tapped button's id. - `body: string` The message body. - `buttons: array of object { id, title }` The tappable buttons — at most three. - `id: string` Your identifier for the button — echoed back as the interactive_reply's id. - `title: string` The button's visible label. - `type: "interactive_buttons"` - `"interactive_buttons"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `InteractiveCtaURL object { body, display_text, type, 4 more }` An interactive call-to-action message: body text plus one button that opens a URL. - `body: string` The message body. - `display_text: string` The button's visible label. - `type: "interactive_cta_url"` - `"interactive_cta_url"` - `url: string` The URL the button opens. Must be absolute, with an http or https scheme. - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref, filename }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `filename: optional string` The file name the customer sees on a document header. Documents only. - `InteractiveCarousel object { body, cards, type }` An interactive carousel: one message whose body sits above 2 to 10 horizontally scrolling cards. Each card shows an uploaded image, or a video from a public link, and either one button that opens a URL or reply buttons. A tap on a card's reply button arrives as an inbound template_reply part whose payload is that button's id; nothing else in the reply identifies the card, so the id you choose is the card's identity. - `body: string` The message text shown above the cards. - `cards: array of object { card_index, header, body, 2 more }` The cards, left to right. - `card_index: number` This card's zero-based position: the first card is 0, the next 1, and so on, in array order. - `header: object { kind, upload_ref, url }` The card's media: an image named by upload_ref, or a video named by the public https url it plays from. Every card carries the same kind. - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: optional string` A durable handle returned by POST /v1/media for an image upload. Image cards only. - `url: optional string` The public https address the card's video plays from. Video cards only. It is sent exactly as written and never fetched by this API, so it must be publicly reachable and serve a playable video; a link that does not play is accepted and then reported as a failed delivery (message.failed with channel_refused). - `body: optional string` Optional text below the card's image or video, with at most two line breaks. - `reply_buttons: optional array of object { id, title }` Buttons the customer taps to reply. Use either url_button or reply_buttons on every card. - `id: string` Your identifier for the button, echoed back as the template_reply's payload. Unique across the whole carousel. - `title: string` The button's visible label. - `url_button: optional object { display_text, url }` One button that opens a URL. Use either url_button or reply_buttons on every card. - `display_text: string` The button's visible label. - `url: string` The absolute https URL the button opens. - `type: "interactive_carousel"` - `"interactive_carousel"` - `LocationRequest object { body, type }` Asks the customer to share a location. The response arrives as a location part. - `body: string` Prompt shown above the send-location button. - `type: "location_request"` - `"location_request"` - `ContactRequest object { body, type }` Asks the customer to share their own contact card with one tap. Useful when you know the customer only by a username identifier and need a phone number. The answer arrives as an ordinary contacts part whose card carries origin contact_request; a card the customer shares by hand carries origin other instead. The answer is not linked to your request as a reply: its message carries no reply_to_message_id, so match it by origin and timing. Sendable inside the customer window. - `body: string` Prompt shown above the share-contact button. - `type: "contact_request"` - `"contact_request"` - `AddressRequest object { body, country, type }` Reserved for asking an eligible customer in India to submit a structured address. Sending this part is not available until business and customer eligibility can be verified at acceptance. Address responses already arrive as address_reply parts. - `body: string` Prompt shown above the address form. - `country: "IN"` ISO country code. Structured address requests are currently available only in India. - `"IN"` - `type: "address_request"` - `"address_request"` - `Contacts object { contacts, type }` One or more contact cards. - `contacts: array of object { name, addresses, birthday, 5 more }` The contact cards to send. The channel permits far more; this API caps a message at five, because a message carrying hundreds of cards is a mistake rather than a use case. - `name: object { formatted_name, first_name, last_name, 3 more }` - `formatted_name: string` The contact's full display name. - `first_name: optional string` - `last_name: optional string` - `middle_name: optional string` - `prefix: optional string` - `suffix: optional string` - `addresses: optional array of object { city, country, country_code, 4 more }` - `city: optional string` - `country: optional string` - `country_code: optional string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `state: optional string` - `street: optional string` - `zip: optional string` - `birthday: optional string` The contact's birthday as YYYY-MM-DD. - `emails: optional array of object { email, kind }` - `email: string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `org: optional object { company, department, title }` - `company: optional string` - `department: optional string` - `title: optional string` - `origin: optional string` Response-only: how the customer came to share this card, as the channel reported it, verbatim. contact_request means they tapped the share button on a contact_request you sent; other means they shared a card themselves. New values may appear, so treat any other value as unrecognised rather than as either of these. Absent when the channel did not say, and on cards received before it was recorded. A send carrying it is rejected with a pointer at the member. - `phones: optional array of object { phone, kind, messaging_id }` - `phone: string` The phone number, ideally in +E.164 form. - `kind: optional string` A label for the number, e.g. CELL, MAIN, WORK, HOME. - `messaging_id: optional string` The contact's messaging-account identifier on this channel, when known — makes the card openable in the messaging app. - `urls: optional array of object { url, kind }` - `url: string` - `kind: optional string` A label for the URL, e.g. WORK, HOME. - `type: "contacts"` - `"contacts"` - `Location object { latitude, longitude, type, 2 more }` A location pin. - `latitude: number` Latitude in decimal degrees. - `longitude: number` Longitude in decimal degrees. - `type: "location"` - `"location"` - `address: optional string` The place's address, shown under the name. - `name: optional string` The place's name, shown on the pin. - `Reaction object { emoji, type, channel_message_id, message_id }` An emoji reaction to an earlier message in the chat. message_id is this API's Message.id for the target in both directions: it is what you send, and it is appended to an inbound reaction whenever the target is a message of the same chat. channel_message_id is the channel's opaque identifier and appears on inbound reactions only. - `emoji: string` A single emoji. Send an empty string to remove a previous reaction to the same message. - `type: "reaction"` - `"reaction"` - `channel_message_id: optional string` Inbound only: the channel's opaque identifier for the message being reacted to. Always present on an inbound reaction, beside message_id whenever the target resolved. Match it literally to Message.channel_message_id in the chat transcript; never parse it or compare it with Message.id. - `message_id: optional string` This API's Message.id for the message being reacted to. Outbound: required, and the API resolves it into the channel namespace before sending, so the message must be one this account can see in the chat the send addresses. Inbound: present whenever the target is a message of the same chat, so you can keep only this identifier; absent when the chat does not hold the target. - `InteractiveReply object { id, kind, title, 2 more }` Inbound only — never sendable. The customer's selection from an interactive_list (kind list_reply) or interactive_buttons (kind button_reply) message, carrying the id you assigned to the chosen row or button. - `id: string` The id you assigned to the chosen row or button, exactly as you sent it. - `kind: "list_reply" or "button_reply"` Which interactive message kind was answered. - `"list_reply"` - `"button_reply"` - `title: string` The chosen row's or button's visible title. - `type: "interactive_reply"` - `"interactive_reply"` - `description: optional string` The chosen list row's secondary text, when it had one. - `TemplateReply object { payload, text, type }` Inbound only — never sendable. The customer tapped a quick-reply button on an approved template you sent, or a reply button on a card of an interactive_carousel you sent. payload is the value you set on that button: the template's quick_reply slot payload (or the button's label when you left the slot out), or the carousel card button's id. text is the label the customer saw. A carousel tap carries nothing else that identifies the card, so the id you chose is the card's only identity. For a template tap, the message's reply_to_message_id names the template message that carried the button. Distinct from interactive_reply, which answers an interactive_buttons or interactive_list message. - `payload: string` The quick_reply slot's payload from your send, or the button label when the slot was omitted; for a carousel card, the tapped reply button's id. - `text: string` The tapped button's label, as the customer saw it. - `type: "template_reply"` - `"template_reply"` - `AddressReply object { type, values, saved_address_id }` Inbound only: the structured values submitted in response to an address request. - `type: "address_reply"` - `"address_reply"` - `values: object { address, building_name, city, 8 more }` - `address: optional string` - `building_name: optional string` - `city: optional string` - `floor_number: optional string` - `house_number: optional string` - `landmark_area: optional string` - `name: optional string` - `phone_number: optional string` - `pin_code: optional string` - `state: optional string` - `tower_number: optional string` - `saved_address_id: optional string` Identifier of the selected saved address, when one was selected. - `Order object { catalog_id, items, type, text }` Inbound only — never sendable. An order the customer placed from a product catalog. - `catalog_id: string` The catalog the ordered items belong to. - `items: array of object { currency, price, product_retailer_id, quantity }` The ordered items. - `currency: string` ISO 4217 currency code for price. - `price: number` The per-item price at order time. - `product_retailer_id: string` Your identifier for the product, as registered in the catalog. - `quantity: number` - `type: "order"` - `"order"` - `text: optional string` Free text the customer attached to the order, when any. - `Referral object { type, body, click_id, 7 more }` Inbound only — never sendable. The ad or post context a customer's first message arrived from (for example an ad whose call to action opens a chat). A referral also opens a free-entry-point customer window — see the chat's customer_window. - `type: "referral"` - `"referral"` - `body: optional string` The ad's body text at click time. - `click_id: optional string` The click identifier assigned by the ad platform, for attribution. - `headline: optional string` The ad's headline at click time. - `image_url: optional string` URL of the ad's image creative, when media_kind is image. - `media_kind: optional string` The ad creative's media kind, e.g. image or video. - `source_id: optional string` The ad or post id. - `source_kind: optional string` What the source was, e.g. ad or post. - `source_url: optional string` The URL of the ad or post the customer came from. - `video_url: optional string` URL of the ad's video creative, when media_kind is video. - `System object { body, type, event }` Inbound only — never sendable. A system event in the chat, such as the customer changing their number. New event kinds appear over time; body is always present and human-readable. - `body: string` Human-readable description of the system event. - `type: "system"` - `"system"` - `event: optional string` The system event's kind, when the channel identifies one. New kinds appear over time — treat unknown values as informational. - `Unsupported object { raw, type, kind }` Inbound only — never sendable. A message kind this API does not yet type natively, carried as a typed passthrough: raw holds the channel payload, so a new message kind is never a black box or a silent drop. Native part types for popular kinds are added over time; this part is the compatibility guarantee in the meantime. - `raw: unknown` The channel payload — any JSON value: object, array, string, number, boolean, or null. Deliberately unconstrained, because the whole point of this part is to carry a shape this API does not yet know. For rows written by API version 1.3.0 or later, object member order, number formatting and duplicated members survive storage and read-back. The canonical encoder may compact insignificant whitespace before storage. Rows written before API version 1.3.0 retain normalized JSON only: member order and number formatting may differ, and only the last duplicated member survives. - `type: "unsupported"` - `"unsupported"` - `kind: optional string` The channel's name for the message kind, when it declares one. - `status: string` The message's delivery state as last reported. Inbound messages read `received`: they arrived, and no delivery of ours ran. A message you sent starts `accepted` and moves through `sent`, `delivered` and `read` as the channel reports them, with `failed` as the definitive negative outcome. `unknown` means exactly that: the send is INDETERMINATE and we decline to guess. It is NOT terminal — an indeterminate send is never re-sent, and it resolves to `sent`, `delivered`, `read` or `failed` when the channel's own report arrives — so keep observing rather than treating it as an outcome. States are reported asynchronously on the chat's event sequence, and the set grows additively: treat a value you do not recognise as "no information" rather than failing on it. Retention of this published status follows the chat transcript policy: there is no scheduled pruning, but no fixed minimum availability period is published yet. The present absence of a scheduled age-based sweep is not a promise of indefinite availability. `delivered` is reported by the channel after it accepted the message and can lag by hours, never arrive at all, or be followed by a failure, so do not build timeouts around it arriving promptly. - `channel_message_id: optional string` The channel's opaque identifier for this message, when the channel has assigned one. An inbound reaction's `channel_message_id` matches this field literally; never parse it or compare it with `id`. It is absent while an accepted outbound message has not yet received a channel identifier, and until it is present an inbound reaction to this message carries only `channel_message_id`. - `failure: optional object { code, message }` Why a failed message failed, when we have a reason worth publishing. Present only on `status` `failed`, and not on every one of those: a message can fail for a reason outside the published vocabulary and carry no `failure` at all. Its absence means "no published reason", never "no reason". Most messages the channel refused do carry one: a specific code where one is published, and `channel_refused` for most of the rest; a few kinds of refusal still carry none. `status` stays the thing to branch on. This is additive detail beside it, so an integration written before this field existed still sees a terminal `failed` and behaves exactly as it did. - `code: string` The specific reason. `sender_deregistered` — the number this message was going out from is no longer a registered sending number, and the message never left. This is terminal: it is not a pause and it does not clear, so retrying the same message cannot succeed and that conversation is over. Reach this customer by starting a new one on another of your numbers with a template, exactly as you would any customer whose 24-hour window has closed; `GET /v1/chats` shows which number each conversation uses. You are not billed for a message that failed this way. `quality_hold_expired` — this marketing message remained held by an automatic safety control on its sending line for ten minutes and was not sent. This is terminal: retrying the same message cannot succeed on that conversation. Send marketing from another of your numbers with a template, or contact support about the sending line. You are not billed for a message that failed this way. `target_message_failed` — the message this one quotes or reacts to failed, or its outcome could not be established, before this message went out. This message was therefore never sent, because a quote is never sent without its context. A `message.failed` event reports it. This is terminal: send it again as a new message, without that target or naming one that was sent. You are not billed a channel charge for it, though it still counts toward your platform subscription's message volume. `recipient_country_restricted` — the business behind the sending number is not currently permitted to message customers in this recipient's country, so the message was not delivered. The restriction blocks every message type, including replies inside the customer's 24-hour window. This is terminal for the message: sending it again cannot succeed while the restriction stands. Most countries unlock only when the business has completed business verification and has held an assigned messaging tier of 2,000 or higher for 30 consecutive days. The assigned tier is what counts, not how many messages you send. Brazil and Indonesia also require the business's primary business location to be in that country, at any tier: a business located elsewhere cannot message customers there. Until the business qualifies, sends to that country will keep failing. The channel publishes no list of restricted country pairs and offers no API signal before a send. If the business meets these conditions and the restriction stands, review the messaging policy for the business's category. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `payment_method_required` — the business behind the sending number has no working payment method on its messaging account, so this message was not sent. This is terminal for the message: retrying it cannot succeed until a payment method is added. Add or update the payment method in the messaging account's billing settings, then send again as a new message. Replies inside an open 24-hour customer window are charged too once the sending number's monthly free allowance of them is used up, so they also need a working payment method and can fail this way. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `recipient_phone_number_required` — this customer is known only by a username identifier, not a phone number, and this message can be delivered only to a phone number, so it was not sent. This is terminal for the message: sending it again to this customer cannot succeed. One-time-code templates (copy code, one-tap or zero-tap autofill) are the usual cause; deliver the code another way. Other messages, including templates without a one-time-code button, can still be sent to this customer. When the template is known in advance to carry a one-time-code button, the send is refused at once with the error `recipient_phone_number_required` instead and nothing is accepted. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `business_restricted` — this message was refused because the business behind the sending number is most likely restricted on its messaging account, so it was not sent. This is terminal for the message: sending it again will not succeed while the restriction stands. Review the status of the business's messaging account, and if the business believes it complies with the messaging policies, request a review of the restriction. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `channel_refused` — this message was refused upstream and was not sent, for a reason that has no more specific code here, and it will not be retried automatically. Contact support with this message's `id` to learn the reason and whether sending it again can succeed. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. A more specific code may be published for some of these refusals in a later release; treat a code you do not recognise exactly as you treat this one. - `message: string` Human-readable, written for a person reading it. Do not branch on it. - `from: optional string` The number this message left by, or arrived on, in E.164 (leading `+`). Every message in one conversation carries the same value — a conversation never moves to another number. Absent only if the number is no longer one of yours. - `reply_to_message_id: optional string` This API's `id` of the earlier message in this chat that this message replies to. On an inbound message it is the message the customer quoted; on an outbound message it is the `reply_to_message_id` you sent. Look the value up in this chat's transcript to show what was answered; it is the same namespace as `id`, never a channel identifier. Absent when there is no reply context this API can resolve — a message that quotes nothing, or one that quotes a message this API never recorded in this chat. Treat absence as "no reply context available", not as proof the message was not a reply. - `zero_retention: optional true` True when the message is under zero-day retention: its content is not kept, so later reads and idempotent retries return empty `parts`. The original send response still carries the content. Retention applies only within Linq's systems. The WhatsApp channel operator's own processing and retention of message content are governed by its terms and are not affected by this setting. - `true` --- # Send a message URL: https://docs.linqapp.com/channel/whatsapp/api/resources/destination_messages/methods/send/ **post** `/v1/messages` Sends a message. Acceptance is durable and asynchronous: a `202` means the message is journaled and will be delivered in order; delivery states arrive on the chat's event sequence (and your webhooks/streams), never on this call. The chat is created on first send to a new customer. Within one chat, sends are handed to the channel in the order they were accepted, each after the previous one has been answered or has failed. A send paused by a safety stop can be overtaken by later sends the stop does not cover, and a send whose outcome stays unknown stops holding later sends after about 15 minutes. A send that quotes or reacts to an earlier message is the exception: it never overtakes that message, and waits with it under a safety stop while later sends the stop does not cover overtake both. This is the order of handing to the channel, not a promise of the order the customer's device shows. The `202` body's `status` is `accepted` — the message exists and is ours to deliver, and nothing more is claimed by it. Watch `GET /v1/streams/events` for `message.sent`, `message.delivered`, `message.read` and `message.failed` to learn what became of it. The stream does not replay, so connect it first; anything you miss is read back from `GET /v1/chats/{chat}/events`, where the same message also carries its latest `status`. Every gate runs before anything is written, so a refusal means nothing was stored and nothing will be sent — always safe to correct and retry. A request that TIMES OUT is the one case that is not safe to retry without `Idempotency-Key`. Supply one unique key per logical message to make a timed-out acceptance safe to repeat. An operational safety stop or the absence of an active sending number refuses with retryable HTTP 503 (`sending_paused` or `no_sending_number`) and a 4xxx `error.code`; nothing is journaled. A stop on the number a conversation already uses answers the same way, with `sending_paused` — and so does a stop on a number you named with `from`. It is ours to lift, and you are never told to move a customer to another number, or that your request was malformed, over one. `from_ambiguous` joins that class in the rare case where a `from` you supplied matches more than one of your numbers: it names no single conversation, so nothing is chosen for you and an operator resolves it. If the service cannot verify the safety state, it likewise refuses with HTTP 503 `sending_guard_unavailable` (a 3xxx `error.code`, 3009) instead of assuming sending is allowed. These operator-dependent states carry no `Retry-After` because there is no honest recovery time to publish. **Which number the message leaves by.** Omit `from` and this service picks: a customer you have messaged before keeps the number they already see, and a new customer is placed on the best available one. The accepted message reports the number as `from`, and reports how it was chosen in `from_selection`. A conversation NEVER moves to another number. If the number a conversation uses is no longer a registered sending number of yours, the request is refused with HTTP 422 `pinned_line_unsendable` (a 4xxx `error.code`, 4004) and NOTHING changes — no message is sent, no conversation is created, and the next send to that customer resolves the same way. `error.context.pinned_from` names the stuck number and `error.context.available_from` names the one that could serve instead; that number is a separate conversation with its own 24-hour window, so you open it yourself by sending an approved template with `from` set to it. This is deliberate: nothing is ever sent on your behalf that you did not compose, and nothing is billed that you did not request. Spend limits apply to every send, including templates. A projected reservation beyond a daily or monthly cap is refused with HTTP 429 `spend_limit_exceeded` (a 4xxx `error.code`, 4006); `Retry-After` names the exact UTC day/month reset and nothing is journaled. If the rate catalog has no applicable rate, the service fails closed with HTTP 503 `rate_not_configured` (a 3xxx `error.code`, 3020); only operator action can clear it, so contact support rather than retrying. If the catalog lookup, cap, or counter is temporarily unavailable, the retryable refusal is HTTP 503 `entitlement_unavailable` (a 3xxx `error.code`, 3004). Crossing 80% does not change acceptance: the response remains 202 and carries `X-Spend-Warning` once for each cap window crossed by that request. Values are comma-separated `brand_day`, `brand_month`, or `number_day`; the warning is emitted once per window, not on every later send. Every send except a reaction reserves its projected charge at accept, including a reply inside an open customer window: the channel charges those replies once the sending number's monthly free allowance of them is used up, and a reply that turns out to be free has its reservation released when its receipt arrives. A daily ceiling refuses any message carrying a `template` part, including a template sent inside an open window. A message without one (text, media, a reaction or another in-window reply) is still accepted past a daily ceiling, and its charge still counts toward the day and the month. The monthly account ceiling is hard and stops every send at the ceiling, including a reaction. Separately from spend, the channel limits how many DISTINCT customers a new conversation may be started with in a moving 24-hour period. A template send that would exceed it is refused with HTTP 429 `tier_quota_exceeded` (a 4xxx `error.code`, 4008) and nothing is journaled; replies inside an open customer conversation are unaffected and never count against it, and a second template to a customer already counted in the period costs nothing. `Retry-After` on this refusal is a MINIMUM REQUESTED WAIT computed from the period as it stood when the request was refused: retry no earlier than that, and a retry then may still be refused. It is not an expiry — the earliest free place can move later as you send to customers already counted, and can open earlier when messages fail to deliver. **You may not be able to produce this refusal in an integration test**, in sandbox or in live: it is raised only where the channel has reported a limit for the account concerned, so an environment where no limit has been reported will never return it. Handle it from the response code rather than from having seen it. ### Header Parameters - `"Idempotency-Key": optional string` ### Body Parameters - `parts: array of object { body, type, preview_url } or object { kind, type, availability, 10 more } or object { language, name, type, 4 more } or 10 more` The message content — sendable parts only, at least one. **One outbound part per request.** Each request has its own acceptance result and optional idempotency key. Each accepted request maps to one native channel message with its own identifier, delivery outcome and charge evidence. A request carrying more than one part is refused with HTTP 422 (`multiple_parts_not_available`, a 1xxx `error.code`, 1019); the API neither fans it out nor offers an atomic batch. Separate requests are independent, and no cross-request delivery or receipt order is promised. **A `reaction` addresses its target by this API's `Message.id`**, which the service resolves into the channel's own namespace before sending. The target must be a message this account can see in the chat the send addresses: otherwise the send is refused with HTTP 422 `reaction_target_not_found` (2049) or `reaction_target_wrong_chat` (1040). A target that has already failed is refused with `reaction_target_not_ready` (2050). Each is pointered at the part's `message_id`. A target this API has not sent yet is normally accepted: the reaction goes out after it, and later messages in the chat wait behind the pair, except that under a safety stop later sends the stop does not cover overtake both. A not-ready refusal can still happen for a target that has not reached `sent` or has only just reached it, and it is safe to retry once the target reads `sent`. A send naming a target that reads `unknown` may be accepted and fail later with `target_message_failed`, or may be refused as not ready. Do not wait for a target that reads `failed` or `unknown`, because it may never reach `sent`: react to another message. If the target fails, or its outcome cannot be established, before the reaction goes out, the reaction is never sent and ends `failed` with `target_message_failed`. If the channel accepts the target and reports it failed later, a reaction that has gone out stays sent, and one that has not gone out normally fails the same way. A `message.failed` event reports a reaction accepted this way that ends `failed`, including a refusal of its own send. A live reaction the channel accepts ends at status `sent`: no delivered or read receipt is reported for one. It can still end `failed` if the channel refuses it on the wire. Media is sendable after its bytes are uploaded with `POST /v1/media` (the part carries that operation's `upload_ref`) or by naming a public https address in `source_url`, which the service fetches once before accepting the send and stores as an upload of its own; the accepted message carries the resulting `upload_ref`, never the address. Outbound parts never carry inbound `media_id`. Outside an open customer window the array must be exactly one `template` part; a freeform part there is refused with HTTP 422 `outside_customer_window` (a 2xxx `error.code`, 2036) and the remedy in the message. A customer known only by a username identifier can receive every message type except a one-time-code template (a copy-code, one-tap or zero-tap autofill button), which can be delivered only to a phone number. When the template is known to carry such a button, the send is refused with HTTP 422 `recipient_phone_number_required` (a 4xxx `error.code`, 4011), pointered at the part, and nothing is accepted; deliver the code another way. - `Text object { body, type, preview_url }` A plain text message. - `body: string` The message text. URLs render as tappable links. - `type: "text"` - `"text"` - `preview_url: optional boolean` Render a preview card for the first URL in body. Defaults to false. - `Media object { kind, type, availability, 10 more }` A media message — image, video, audio, document, or sticker. The two identifiers are distinct namespaces: inbound media carries the channel's transient media_id; outbound media carries our durable upload_ref from POST /v1/media. - `kind: "image" or "video" or "audio" or 2 more` Which kind of media this is. Captions apply to image, video and document only; filename applies to document only. - `"image"` - `"video"` - `"audio"` - `"document"` - `"sticker"` - `type: "media"` - `"media"` - `availability: optional "available" or "unavailable" or "pending"` Response only, inbound parts only: whether the download answers the bytes. available: the file was captured and is retained. unavailable: it is not downloadable now, and unavailable_reason says why; with timed_out the download answers 409 while capture continues and can later answer 200, otherwise it answers 410, or 404 once the file is no longer known. It describes the file, not the exact HTTP answer of a later download, which can also refuse for capacity or authorization. pending: capture has not finished yet; only reads of the conversation return pending, and a message event never does. A message.received event is recorded once every attachment has been captured or has failed, or ten minutes after the message arrived, whichever comes first; an event part without availability is from a historical event and may still be capturing, so retry its download as the 409 Retry-After directs. A message event keeps the value it was recorded with; reads return the current one. Historical messages received before it was recorded omit it. Never accepted on sends. - `"available"` - `"unavailable"` - `"pending"` - `byte_size: optional number` Response only, inbound parts only: the exact size in bytes of the retained attachment, equal to the download's Content-Length. Present only while the bytes are captured and retained — the same lifetime as a working url, ending 30 days after server receipt — so it can be absent from a message event while capture has not completed, and its absence is not final; once present it never changes. Absent rather than zero. Never accepted on sends. - `caption: optional string` Caption rendered with the media. Image, video and document only — a caption on an audio or sticker part is rejected, never dropped. - `filename: optional string` Display filename. Documents only — a filename on any other kind is rejected, never dropped. - `media_id: optional string` Inbound only: the channel's transient media identifier. It expires after seven days and is never an outbound address; an outbound value is rejected with a pointer to media_id and upload_ref as the remedy. - `mime_type: optional string` Response only, inbound parts only: the media type the channel declared when the message arrived, verbatim. It may carry parameters (for example audio/ogg; codecs=opus) and may differ from the Content-Type the download answers with, which describes the retained bytes. Present on the webhook body and on every later read with the same value. Historical messages received before it was recorded omit this field. Never accepted on sends. - `source_url: optional string` Outbound only: a public https URL of the bytes to send, as an alternative to upload_ref. Supply exactly one of upload_ref or source_url. The address is fetched once, before the send is accepted, and its exact bytes are stored as an ordinary upload in this account and key partition; the accepted message and every later read carry that upload's upload_ref, never the address, and no retry fetches it again. The URL must be absolute https on the default port with no credentials and no fragment, must resolve to a public address (every redirect hop included, at most three), and must answer with the complete bytes and their exact media type within the fetch deadline. The bytes are then held to the same media type and size rules as POST /v1/media for the part's kind; a mismatch is refused, never converted. - `unavailable_reason: optional string` Response only, present only when availability is unavailable. An open string: the values today are timed_out, capture_failed and expired, and new values may be added. timed_out: the file was still being retrieved ten minutes after the message arrived, so its message event was recorded without it; retrieval continues and the file may become downloadable later, which reads of the conversation report. capture_failed: the file could not be retrieved. expired: the file was retrieved and is no longer retained, or is no longer known (the download then answers 410 or 404). Treat an unknown value as capture_failed. Never accepted on sends. - `upload_ref: optional string` Outbound only: our durable handle returned by POST /v1/media. Handles visibly begin upload. and are reusable within the account and key partition that created them. - `url: optional string` Response only: stable attachment download URL requiring the account Bearer key on every request. Pending capture returns 409 with Retry-After; retained bytes expire 30 days after server receipt. Historical unbound messages omit this field. Never accepted on sends. - `voice: optional boolean` Audio only. On a send it is optional: true sends the audio as a voice note; false, or leaving it out, sends it as an ordinary audio file. A voice note needs an upload stored as audio/ogg that holds mono Opus audio, sent by upload_ref or source_url within the existing audio size limit. The bytes are sent as supplied: they are never converted or inspected, so encode them as mono Opus before uploading. The recipient sees a play button only when the voice file is 512 KB or smaller; a larger voice note is still delivered but must be downloaded before it plays. On incoming audio parts it is response-only: whether the channel reported the audio as a voice note, verbatim. true means it was recorded with the messaging client's voice-recording feature; false means it was sent as an audio file. Present on the webhook body and on every later read with the same value. Absent on an incoming part means the channel did not say, never that the audio is not a voice note. Other kinds never carry it, and historical messages received before it was recorded omit it. - `Template object { language, name, type, 4 more }` An approved message template — the one part type sendable outside an open customer service window. name and language identify the approved template; parameters fills its named placeholders. Authentication templates use this same generic part: their published parameter schema names exactly one parameter, `code` — the one-time code you generate, 1–15 characters — and the message shows it in its body and behind its code button. Every sendable template is registered and approved ahead of the send and publishes its own parameter schema — a send referencing an unknown template, a missing or unknown parameter, or a value that breaks the template's rules is rejected with a 422 naming the exact field. - `language: string` The template's language-and-locale code, e.g. en_US. - `name: string` The approved template's name. Lowercase letters, digits and underscores only. - `type: "template"` - `"template"` - `buttons: optional array of object { index, payload, type }` Send-time values for this approved template's own dynamic buttons, in ascending index order: a url button whose destination ends in {{1}} takes the value appended there and is REQUIRED; a quick_reply button takes the payload returned to you when it is tapped and is OPTIONAL — omit it and the button returns its label. Fixed buttons have no slot. The approved template's send_schema lists the (index, type) slots and an x-rule stating which are required; omit buttons entirely for a template with no url slot when the labels are what you want back. - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `cards: optional array of object { card_index, kind, upload_ref, 2 more }` Per-card values for an approved media-card carousel. The approved template's send_schema provides structural bounds and an x-rule listing the exact card order, media kind, named body values, and dynamic button slots enforced by runtime L2 validation. Omit for non-carousel templates. - `card_index: number` - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: string` A durable handle returned by POST /v1/media. It is resolved within this key's account and partition, then consumed into a transient channel media identifier only at delivery. - `buttons: optional array of object { index, payload, type }` - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `parameters: optional unknown` Named values for this card's body placeholders. - `header: optional object { kind, upload_ref }` The uploaded media used for this approved template's media header. Omit unless this template's send_schema requires it. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `parameters: optional unknown` Named values for the template's placeholders. The shape is per-template: each registered template publishes its own parameter schema — hand THAT schema to your model when composing a specific template. Omit for templates with no placeholders. - `InteractiveList object { body, button, sections, 3 more }` An interactive list message: body text plus a button that opens a sectioned list of selectable rows. The customer's selection arrives as an inbound interactive_reply part with kind list_reply, carrying the chosen row's id. - `body: string` The message body. - `button: string` Label of the button that opens the list. - `sections: array of object { rows, title }` The list's sections, each holding selectable rows. At most 10 rows in total across ALL sections combined — not 10 per section. - `rows: array of object { id, title, description }` This section's rows. The 10-row limit is on the TOTAL across all sections, so a second section reduces what this one may hold. - `id: string` Your identifier for the row — echoed back as the interactive_reply's id. - `title: string` The row's visible title. - `description: optional string` Secondary text under the title. - `title: optional string` Section title. Required when the list has more than one section. - `type: "interactive_list"` - `"interactive_list"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `InteractiveButtons object { body, buttons, type, 3 more }` An interactive reply-buttons message: body text plus up to three tappable buttons. The customer's tap arrives as an inbound interactive_reply part with kind button_reply, carrying the tapped button's id. - `body: string` The message body. - `buttons: array of object { id, title }` The tappable buttons — at most three. - `id: string` Your identifier for the button — echoed back as the interactive_reply's id. - `title: string` The button's visible label. - `type: "interactive_buttons"` - `"interactive_buttons"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `InteractiveCtaURL object { body, display_text, type, 4 more }` An interactive call-to-action message: body text plus one button that opens a URL. - `body: string` The message body. - `display_text: string` The button's visible label. - `type: "interactive_cta_url"` - `"interactive_cta_url"` - `url: string` The URL the button opens. Must be absolute, with an http or https scheme. - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref, filename }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `filename: optional string` The file name the customer sees on a document header. Documents only. - `InteractiveCarousel object { body, cards, type }` An interactive carousel: one message whose body sits above 2 to 10 horizontally scrolling cards. Each card shows an uploaded image, or a video from a public link, and either one button that opens a URL or reply buttons. A tap on a card's reply button arrives as an inbound template_reply part whose payload is that button's id; nothing else in the reply identifies the card, so the id you choose is the card's identity. - `body: string` The message text shown above the cards. - `cards: array of object { card_index, header, body, 2 more }` The cards, left to right. - `card_index: number` This card's zero-based position: the first card is 0, the next 1, and so on, in array order. - `header: object { kind, upload_ref, url }` The card's media: an image named by upload_ref, or a video named by the public https url it plays from. Every card carries the same kind. - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: optional string` A durable handle returned by POST /v1/media for an image upload. Image cards only. - `url: optional string` The public https address the card's video plays from. Video cards only. It is sent exactly as written and never fetched by this API, so it must be publicly reachable and serve a playable video; a link that does not play is accepted and then reported as a failed delivery (message.failed with channel_refused). - `body: optional string` Optional text below the card's image or video, with at most two line breaks. - `reply_buttons: optional array of object { id, title }` Buttons the customer taps to reply. Use either url_button or reply_buttons on every card. - `id: string` Your identifier for the button, echoed back as the template_reply's payload. Unique across the whole carousel. - `title: string` The button's visible label. - `url_button: optional object { display_text, url }` One button that opens a URL. Use either url_button or reply_buttons on every card. - `display_text: string` The button's visible label. - `url: string` The absolute https URL the button opens. - `type: "interactive_carousel"` - `"interactive_carousel"` - `LocationRequest object { body, type }` Asks the customer to share a location. The response arrives as a location part. - `body: string` Prompt shown above the send-location button. - `type: "location_request"` - `"location_request"` - `ContactRequest object { body, type }` Asks the customer to share their own contact card with one tap. Useful when you know the customer only by a username identifier and need a phone number. The answer arrives as an ordinary contacts part whose card carries origin contact_request; a card the customer shares by hand carries origin other instead. The answer is not linked to your request as a reply: its message carries no reply_to_message_id, so match it by origin and timing. Sendable inside the customer window. - `body: string` Prompt shown above the share-contact button. - `type: "contact_request"` - `"contact_request"` - `AddressRequest object { body, country, type }` Reserved for asking an eligible customer in India to submit a structured address. Sending this part is not available until business and customer eligibility can be verified at acceptance. Address responses already arrive as address_reply parts. - `body: string` Prompt shown above the address form. - `country: "IN"` ISO country code. Structured address requests are currently available only in India. - `"IN"` - `type: "address_request"` - `"address_request"` - `Contacts object { contacts, type }` One or more contact cards. - `contacts: array of object { name, addresses, birthday, 5 more }` The contact cards to send. The channel permits far more; this API caps a message at five, because a message carrying hundreds of cards is a mistake rather than a use case. - `name: object { formatted_name, first_name, last_name, 3 more }` - `formatted_name: string` The contact's full display name. - `first_name: optional string` - `last_name: optional string` - `middle_name: optional string` - `prefix: optional string` - `suffix: optional string` - `addresses: optional array of object { city, country, country_code, 4 more }` - `city: optional string` - `country: optional string` - `country_code: optional string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `state: optional string` - `street: optional string` - `zip: optional string` - `birthday: optional string` The contact's birthday as YYYY-MM-DD. - `emails: optional array of object { email, kind }` - `email: string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `org: optional object { company, department, title }` - `company: optional string` - `department: optional string` - `title: optional string` - `origin: optional string` Response-only: how the customer came to share this card, as the channel reported it, verbatim. contact_request means they tapped the share button on a contact_request you sent; other means they shared a card themselves. New values may appear, so treat any other value as unrecognised rather than as either of these. Absent when the channel did not say, and on cards received before it was recorded. A send carrying it is rejected with a pointer at the member. - `phones: optional array of object { phone, kind, messaging_id }` - `phone: string` The phone number, ideally in +E.164 form. - `kind: optional string` A label for the number, e.g. CELL, MAIN, WORK, HOME. - `messaging_id: optional string` The contact's messaging-account identifier on this channel, when known — makes the card openable in the messaging app. - `urls: optional array of object { url, kind }` - `url: string` - `kind: optional string` A label for the URL, e.g. WORK, HOME. - `type: "contacts"` - `"contacts"` - `Location object { latitude, longitude, type, 2 more }` A location pin. - `latitude: number` Latitude in decimal degrees. - `longitude: number` Longitude in decimal degrees. - `type: "location"` - `"location"` - `address: optional string` The place's address, shown under the name. - `name: optional string` The place's name, shown on the pin. - `Reaction object { emoji, type, channel_message_id, message_id }` An emoji reaction to an earlier message in the chat. message_id is this API's Message.id for the target in both directions: it is what you send, and it is appended to an inbound reaction whenever the target is a message of the same chat. channel_message_id is the channel's opaque identifier and appears on inbound reactions only. - `emoji: string` A single emoji. Send an empty string to remove a previous reaction to the same message. - `type: "reaction"` - `"reaction"` - `channel_message_id: optional string` Inbound only: the channel's opaque identifier for the message being reacted to. Always present on an inbound reaction, beside message_id whenever the target resolved. Match it literally to Message.channel_message_id in the chat transcript; never parse it or compare it with Message.id. - `message_id: optional string` This API's Message.id for the message being reacted to. Outbound: required, and the API resolves it into the channel namespace before sending, so the message must be one this account can see in the chat the send addresses. Inbound: present whenever the target is a message of the same chat, so you can keep only this identifier; absent when the chat does not hold the target. - `to: string` The customer to message: the exact opaque customer address this API reports as the chat's `customer` field (read with `GET /v1/chats` or `GET /v1/chats/{chat}`), copied verbatim and never parsed, built or reformatted. It is usually the customer's phone number in the channel's digits-only form (country code first, no `+` and no punctuation, such as `15550101234`); a customer who uses a username and has not shared a phone number is identified by a username identifier instead (such as `US.13491208655302741918`). Treat both the same way: copy the value. **The value is matched literally and never normalized**, because the address is the channel's to define, not ours to rewrite. It is the conversation's identity, so two spellings of the same number are two different conversations, each with its own window and its own event sequence. Concretely: the value is compared verbatim to the chat's `customer` field, the customer id exactly as that customer's inbound messages arrived. A newly recorded chat event carries that value as `data.customer`; for an older event, read the chat's `customer` with `GET /v1/chats/{chat}`. A leading `+` makes it a different value — `+12059367930` does not find the conversation delivered as `12059367930` — and such a send is refused with `outside_customer_window` (`2036`) as if that customer had never written. When this account does hold an open window under the value without the `+`, the refusal's `details[0].message` says so and names both values, so the fix is to resend with the delivered value or on `POST /v1/chats/{chat}/messages`, which needs no address at all. - `exclude: optional array of string` Numbers NOT to send from, in E.164 — a filter on a choice this service is making for you. It applies only when `from` is omitted; supplying both is refused. It affects this request alone: nothing is stored, and no operator setting changes. It cannot move a conversation. If it names the number an existing conversation already uses, or removes every number that could have served, the send is refused with `exclude_leaves_no_sender` rather than quietly sent from a number you asked to avoid. - `from: optional string` The number to send FROM, in E.164 (e.g. `+15550001111`). Together with `to` it names the exact conversation: one customer, one of your numbers. **Omit it and this service chooses**, exactly as it always has — a conversation you have already had continues on its own number, and a new customer is placed on the best available one. Omitting the field and sending an empty string are DIFFERENT requests: an empty string is refused rather than treated as "choose for me", because a client that computed nothing did not mean to hand the choice back. Supply it to reply on a specific number — in particular the second conversation a customer starts by messaging another of your numbers, which is its own chat with its own window. The number must be one of your registered sending numbers: `from_not_available` (422, a 1xxx `error.code`, 1013) if it is not one of your numbers at all, and `from_not_sendable` (422, a 4xxx `error.code`, 4003) if it is yours but is no longer registered to send. A number that is only PAUSED is neither of those — it answers retryable HTTP 503 `sending_paused` (a 4xxx `error.code`, 4005), the same as every other paused send, because that one is ours to lift and worth retrying shortly. It is matched on its digits, so `+15550001111` and `1 (555) 000-1111` are the same number — unlike `to`, which is the channel's own address form and is matched literally. Naming a number never moves an existing conversation onto it. It does decide where a BRAND-NEW one lives: if you have never exchanged a message with this customer, the number you name becomes the one they keep, and a later omitted-`from` send to them continues on it. That is the same rule as ever — a customer's number is fixed by the first contact, whoever chose it — and it is why naming a number for a customer you have already messaged changes nothing about their existing conversation. - `reply_to_message_id: optional string` Our opaque `Message.id` for an earlier message in this same chat. When present, this send is displayed as a visual reply to that message. Unknown ids return `reply_target_not_found`; an id from another chat returns `reply_target_wrong_chat`; and a message that has already failed returns `reply_target_not_ready`. Nothing is accepted when any of those refusals is returned. A target this API has not sent yet is normally accepted: this send goes out after it, quoting it, and later messages in the chat wait behind the pair, except that under a safety stop later sends the stop does not cover overtake both. A not-ready refusal can still happen for a target that has not reached `sent` or has only just reached it, and it is safe to retry once the target reads `sent`. A send naming a target that reads `unknown` may be accepted and fail later with `target_message_failed`, or may be refused as not ready. Do not wait for a target that reads `failed` or `unknown`, because it may never reach `sent`: send without `reply_to_message_id` or quote another message. If the target fails, or its outcome cannot be established, before this send goes out, this send is never sent and ends `failed` with `target_message_failed`; it is never sent without the quote and never quotes anything else. If the channel accepts the target and reports it failed later, a send that has gone out stays sent, and one that has not gone out normally fails the same way. A `message.failed` event reports a send accepted this way that ends `failed`, including a refusal of its own send. The accepted message reads back with the same `reply_to_message_id`, and an inbound message that quotes one of yours carries the quoted message's `id` in the same field. - `send_at: optional string` RESERVED — scheduled sends are not yet available. The field is declared so its later arrival is purely additive; until then ANY value here, including a past timestamp, is rejected loudly with HTTP 422 `send_at_not_available` (a 1xxx `error.code`, 1039). Omit the field entirely. ### Returns - `AcceptedMessage object { id, chat_id, created_at, 9 more }` An accepted send: the message, plus how its sending number was chosen. - `id: string` This API's message id. Put this value in an outbound reaction's `message_id`; an inbound reaction to this message carries the same value in its `message_id`, so this is the one identifier you need to keep. Mark-as-read targets the latest unread inbound message in a chat, so it takes the chat id. - `chat_id: string` The chat this message belongs to. - `created_at: string` - `direction: "inbound" or "outbound"` `inbound` (from the customer) or `outbound` (sent by you). - `"inbound"` - `"outbound"` - `parts: array of object { body, type, preview_url } or object { kind, type, availability, 10 more } or object { language, name, type, 4 more } or 17 more` The message content — sendable parts, plus the inbound-only types on inbound messages. Empty only when `zero_retention` is true, or when an idempotent retry returns an ephemeral message whose content retention cleanup has removed. - `Text object { body, type, preview_url }` A plain text message. - `body: string` The message text. URLs render as tappable links. - `type: "text"` - `"text"` - `preview_url: optional boolean` Render a preview card for the first URL in body. Defaults to false. - `Media object { kind, type, availability, 10 more }` A media message — image, video, audio, document, or sticker. The two identifiers are distinct namespaces: inbound media carries the channel's transient media_id; outbound media carries our durable upload_ref from POST /v1/media. - `kind: "image" or "video" or "audio" or 2 more` Which kind of media this is. Captions apply to image, video and document only; filename applies to document only. - `"image"` - `"video"` - `"audio"` - `"document"` - `"sticker"` - `type: "media"` - `"media"` - `availability: optional "available" or "unavailable" or "pending"` Response only, inbound parts only: whether the download answers the bytes. available: the file was captured and is retained. unavailable: it is not downloadable now, and unavailable_reason says why; with timed_out the download answers 409 while capture continues and can later answer 200, otherwise it answers 410, or 404 once the file is no longer known. It describes the file, not the exact HTTP answer of a later download, which can also refuse for capacity or authorization. pending: capture has not finished yet; only reads of the conversation return pending, and a message event never does. A message.received event is recorded once every attachment has been captured or has failed, or ten minutes after the message arrived, whichever comes first; an event part without availability is from a historical event and may still be capturing, so retry its download as the 409 Retry-After directs. A message event keeps the value it was recorded with; reads return the current one. Historical messages received before it was recorded omit it. Never accepted on sends. - `"available"` - `"unavailable"` - `"pending"` - `byte_size: optional number` Response only, inbound parts only: the exact size in bytes of the retained attachment, equal to the download's Content-Length. Present only while the bytes are captured and retained — the same lifetime as a working url, ending 30 days after server receipt — so it can be absent from a message event while capture has not completed, and its absence is not final; once present it never changes. Absent rather than zero. Never accepted on sends. - `caption: optional string` Caption rendered with the media. Image, video and document only — a caption on an audio or sticker part is rejected, never dropped. - `filename: optional string` Display filename. Documents only — a filename on any other kind is rejected, never dropped. - `media_id: optional string` Inbound only: the channel's transient media identifier. It expires after seven days and is never an outbound address; an outbound value is rejected with a pointer to media_id and upload_ref as the remedy. - `mime_type: optional string` Response only, inbound parts only: the media type the channel declared when the message arrived, verbatim. It may carry parameters (for example audio/ogg; codecs=opus) and may differ from the Content-Type the download answers with, which describes the retained bytes. Present on the webhook body and on every later read with the same value. Historical messages received before it was recorded omit this field. Never accepted on sends. - `source_url: optional string` Outbound only: a public https URL of the bytes to send, as an alternative to upload_ref. Supply exactly one of upload_ref or source_url. The address is fetched once, before the send is accepted, and its exact bytes are stored as an ordinary upload in this account and key partition; the accepted message and every later read carry that upload's upload_ref, never the address, and no retry fetches it again. The URL must be absolute https on the default port with no credentials and no fragment, must resolve to a public address (every redirect hop included, at most three), and must answer with the complete bytes and their exact media type within the fetch deadline. The bytes are then held to the same media type and size rules as POST /v1/media for the part's kind; a mismatch is refused, never converted. - `unavailable_reason: optional string` Response only, present only when availability is unavailable. An open string: the values today are timed_out, capture_failed and expired, and new values may be added. timed_out: the file was still being retrieved ten minutes after the message arrived, so its message event was recorded without it; retrieval continues and the file may become downloadable later, which reads of the conversation report. capture_failed: the file could not be retrieved. expired: the file was retrieved and is no longer retained, or is no longer known (the download then answers 410 or 404). Treat an unknown value as capture_failed. Never accepted on sends. - `upload_ref: optional string` Outbound only: our durable handle returned by POST /v1/media. Handles visibly begin upload. and are reusable within the account and key partition that created them. - `url: optional string` Response only: stable attachment download URL requiring the account Bearer key on every request. Pending capture returns 409 with Retry-After; retained bytes expire 30 days after server receipt. Historical unbound messages omit this field. Never accepted on sends. - `voice: optional boolean` Audio only. On a send it is optional: true sends the audio as a voice note; false, or leaving it out, sends it as an ordinary audio file. A voice note needs an upload stored as audio/ogg that holds mono Opus audio, sent by upload_ref or source_url within the existing audio size limit. The bytes are sent as supplied: they are never converted or inspected, so encode them as mono Opus before uploading. The recipient sees a play button only when the voice file is 512 KB or smaller; a larger voice note is still delivered but must be downloaded before it plays. On incoming audio parts it is response-only: whether the channel reported the audio as a voice note, verbatim. true means it was recorded with the messaging client's voice-recording feature; false means it was sent as an audio file. Present on the webhook body and on every later read with the same value. Absent on an incoming part means the channel did not say, never that the audio is not a voice note. Other kinds never carry it, and historical messages received before it was recorded omit it. - `Template object { language, name, type, 4 more }` An approved message template — the one part type sendable outside an open customer service window. name and language identify the approved template; parameters fills its named placeholders. Authentication templates use this same generic part: their published parameter schema names exactly one parameter, `code` — the one-time code you generate, 1–15 characters — and the message shows it in its body and behind its code button. Every sendable template is registered and approved ahead of the send and publishes its own parameter schema — a send referencing an unknown template, a missing or unknown parameter, or a value that breaks the template's rules is rejected with a 422 naming the exact field. - `language: string` The template's language-and-locale code, e.g. en_US. - `name: string` The approved template's name. Lowercase letters, digits and underscores only. - `type: "template"` - `"template"` - `buttons: optional array of object { index, payload, type }` Send-time values for this approved template's own dynamic buttons, in ascending index order: a url button whose destination ends in {{1}} takes the value appended there and is REQUIRED; a quick_reply button takes the payload returned to you when it is tapped and is OPTIONAL — omit it and the button returns its label. Fixed buttons have no slot. The approved template's send_schema lists the (index, type) slots and an x-rule stating which are required; omit buttons entirely for a template with no url slot when the labels are what you want back. - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `cards: optional array of object { card_index, kind, upload_ref, 2 more }` Per-card values for an approved media-card carousel. The approved template's send_schema provides structural bounds and an x-rule listing the exact card order, media kind, named body values, and dynamic button slots enforced by runtime L2 validation. Omit for non-carousel templates. - `card_index: number` - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: string` A durable handle returned by POST /v1/media. It is resolved within this key's account and partition, then consumed into a transient channel media identifier only at delivery. - `buttons: optional array of object { index, payload, type }` - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `parameters: optional unknown` Named values for this card's body placeholders. - `header: optional object { kind, upload_ref }` The uploaded media used for this approved template's media header. Omit unless this template's send_schema requires it. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `parameters: optional unknown` Named values for the template's placeholders. The shape is per-template: each registered template publishes its own parameter schema — hand THAT schema to your model when composing a specific template. Omit for templates with no placeholders. - `InteractiveList object { body, button, sections, 3 more }` An interactive list message: body text plus a button that opens a sectioned list of selectable rows. The customer's selection arrives as an inbound interactive_reply part with kind list_reply, carrying the chosen row's id. - `body: string` The message body. - `button: string` Label of the button that opens the list. - `sections: array of object { rows, title }` The list's sections, each holding selectable rows. At most 10 rows in total across ALL sections combined — not 10 per section. - `rows: array of object { id, title, description }` This section's rows. The 10-row limit is on the TOTAL across all sections, so a second section reduces what this one may hold. - `id: string` Your identifier for the row — echoed back as the interactive_reply's id. - `title: string` The row's visible title. - `description: optional string` Secondary text under the title. - `title: optional string` Section title. Required when the list has more than one section. - `type: "interactive_list"` - `"interactive_list"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `InteractiveButtons object { body, buttons, type, 3 more }` An interactive reply-buttons message: body text plus up to three tappable buttons. The customer's tap arrives as an inbound interactive_reply part with kind button_reply, carrying the tapped button's id. - `body: string` The message body. - `buttons: array of object { id, title }` The tappable buttons — at most three. - `id: string` Your identifier for the button — echoed back as the interactive_reply's id. - `title: string` The button's visible label. - `type: "interactive_buttons"` - `"interactive_buttons"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `InteractiveCtaURL object { body, display_text, type, 4 more }` An interactive call-to-action message: body text plus one button that opens a URL. - `body: string` The message body. - `display_text: string` The button's visible label. - `type: "interactive_cta_url"` - `"interactive_cta_url"` - `url: string` The URL the button opens. Must be absolute, with an http or https scheme. - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref, filename }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `filename: optional string` The file name the customer sees on a document header. Documents only. - `InteractiveCarousel object { body, cards, type }` An interactive carousel: one message whose body sits above 2 to 10 horizontally scrolling cards. Each card shows an uploaded image, or a video from a public link, and either one button that opens a URL or reply buttons. A tap on a card's reply button arrives as an inbound template_reply part whose payload is that button's id; nothing else in the reply identifies the card, so the id you choose is the card's identity. - `body: string` The message text shown above the cards. - `cards: array of object { card_index, header, body, 2 more }` The cards, left to right. - `card_index: number` This card's zero-based position: the first card is 0, the next 1, and so on, in array order. - `header: object { kind, upload_ref, url }` The card's media: an image named by upload_ref, or a video named by the public https url it plays from. Every card carries the same kind. - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: optional string` A durable handle returned by POST /v1/media for an image upload. Image cards only. - `url: optional string` The public https address the card's video plays from. Video cards only. It is sent exactly as written and never fetched by this API, so it must be publicly reachable and serve a playable video; a link that does not play is accepted and then reported as a failed delivery (message.failed with channel_refused). - `body: optional string` Optional text below the card's image or video, with at most two line breaks. - `reply_buttons: optional array of object { id, title }` Buttons the customer taps to reply. Use either url_button or reply_buttons on every card. - `id: string` Your identifier for the button, echoed back as the template_reply's payload. Unique across the whole carousel. - `title: string` The button's visible label. - `url_button: optional object { display_text, url }` One button that opens a URL. Use either url_button or reply_buttons on every card. - `display_text: string` The button's visible label. - `url: string` The absolute https URL the button opens. - `type: "interactive_carousel"` - `"interactive_carousel"` - `LocationRequest object { body, type }` Asks the customer to share a location. The response arrives as a location part. - `body: string` Prompt shown above the send-location button. - `type: "location_request"` - `"location_request"` - `ContactRequest object { body, type }` Asks the customer to share their own contact card with one tap. Useful when you know the customer only by a username identifier and need a phone number. The answer arrives as an ordinary contacts part whose card carries origin contact_request; a card the customer shares by hand carries origin other instead. The answer is not linked to your request as a reply: its message carries no reply_to_message_id, so match it by origin and timing. Sendable inside the customer window. - `body: string` Prompt shown above the share-contact button. - `type: "contact_request"` - `"contact_request"` - `AddressRequest object { body, country, type }` Reserved for asking an eligible customer in India to submit a structured address. Sending this part is not available until business and customer eligibility can be verified at acceptance. Address responses already arrive as address_reply parts. - `body: string` Prompt shown above the address form. - `country: "IN"` ISO country code. Structured address requests are currently available only in India. - `"IN"` - `type: "address_request"` - `"address_request"` - `Contacts object { contacts, type }` One or more contact cards. - `contacts: array of object { name, addresses, birthday, 5 more }` The contact cards to send. The channel permits far more; this API caps a message at five, because a message carrying hundreds of cards is a mistake rather than a use case. - `name: object { formatted_name, first_name, last_name, 3 more }` - `formatted_name: string` The contact's full display name. - `first_name: optional string` - `last_name: optional string` - `middle_name: optional string` - `prefix: optional string` - `suffix: optional string` - `addresses: optional array of object { city, country, country_code, 4 more }` - `city: optional string` - `country: optional string` - `country_code: optional string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `state: optional string` - `street: optional string` - `zip: optional string` - `birthday: optional string` The contact's birthday as YYYY-MM-DD. - `emails: optional array of object { email, kind }` - `email: string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `org: optional object { company, department, title }` - `company: optional string` - `department: optional string` - `title: optional string` - `origin: optional string` Response-only: how the customer came to share this card, as the channel reported it, verbatim. contact_request means they tapped the share button on a contact_request you sent; other means they shared a card themselves. New values may appear, so treat any other value as unrecognised rather than as either of these. Absent when the channel did not say, and on cards received before it was recorded. A send carrying it is rejected with a pointer at the member. - `phones: optional array of object { phone, kind, messaging_id }` - `phone: string` The phone number, ideally in +E.164 form. - `kind: optional string` A label for the number, e.g. CELL, MAIN, WORK, HOME. - `messaging_id: optional string` The contact's messaging-account identifier on this channel, when known — makes the card openable in the messaging app. - `urls: optional array of object { url, kind }` - `url: string` - `kind: optional string` A label for the URL, e.g. WORK, HOME. - `type: "contacts"` - `"contacts"` - `Location object { latitude, longitude, type, 2 more }` A location pin. - `latitude: number` Latitude in decimal degrees. - `longitude: number` Longitude in decimal degrees. - `type: "location"` - `"location"` - `address: optional string` The place's address, shown under the name. - `name: optional string` The place's name, shown on the pin. - `Reaction object { emoji, type, channel_message_id, message_id }` An emoji reaction to an earlier message in the chat. message_id is this API's Message.id for the target in both directions: it is what you send, and it is appended to an inbound reaction whenever the target is a message of the same chat. channel_message_id is the channel's opaque identifier and appears on inbound reactions only. - `emoji: string` A single emoji. Send an empty string to remove a previous reaction to the same message. - `type: "reaction"` - `"reaction"` - `channel_message_id: optional string` Inbound only: the channel's opaque identifier for the message being reacted to. Always present on an inbound reaction, beside message_id whenever the target resolved. Match it literally to Message.channel_message_id in the chat transcript; never parse it or compare it with Message.id. - `message_id: optional string` This API's Message.id for the message being reacted to. Outbound: required, and the API resolves it into the channel namespace before sending, so the message must be one this account can see in the chat the send addresses. Inbound: present whenever the target is a message of the same chat, so you can keep only this identifier; absent when the chat does not hold the target. - `InteractiveReply object { id, kind, title, 2 more }` Inbound only — never sendable. The customer's selection from an interactive_list (kind list_reply) or interactive_buttons (kind button_reply) message, carrying the id you assigned to the chosen row or button. - `id: string` The id you assigned to the chosen row or button, exactly as you sent it. - `kind: "list_reply" or "button_reply"` Which interactive message kind was answered. - `"list_reply"` - `"button_reply"` - `title: string` The chosen row's or button's visible title. - `type: "interactive_reply"` - `"interactive_reply"` - `description: optional string` The chosen list row's secondary text, when it had one. - `TemplateReply object { payload, text, type }` Inbound only — never sendable. The customer tapped a quick-reply button on an approved template you sent, or a reply button on a card of an interactive_carousel you sent. payload is the value you set on that button: the template's quick_reply slot payload (or the button's label when you left the slot out), or the carousel card button's id. text is the label the customer saw. A carousel tap carries nothing else that identifies the card, so the id you chose is the card's only identity. For a template tap, the message's reply_to_message_id names the template message that carried the button. Distinct from interactive_reply, which answers an interactive_buttons or interactive_list message. - `payload: string` The quick_reply slot's payload from your send, or the button label when the slot was omitted; for a carousel card, the tapped reply button's id. - `text: string` The tapped button's label, as the customer saw it. - `type: "template_reply"` - `"template_reply"` - `AddressReply object { type, values, saved_address_id }` Inbound only: the structured values submitted in response to an address request. - `type: "address_reply"` - `"address_reply"` - `values: object { address, building_name, city, 8 more }` - `address: optional string` - `building_name: optional string` - `city: optional string` - `floor_number: optional string` - `house_number: optional string` - `landmark_area: optional string` - `name: optional string` - `phone_number: optional string` - `pin_code: optional string` - `state: optional string` - `tower_number: optional string` - `saved_address_id: optional string` Identifier of the selected saved address, when one was selected. - `Order object { catalog_id, items, type, text }` Inbound only — never sendable. An order the customer placed from a product catalog. - `catalog_id: string` The catalog the ordered items belong to. - `items: array of object { currency, price, product_retailer_id, quantity }` The ordered items. - `currency: string` ISO 4217 currency code for price. - `price: number` The per-item price at order time. - `product_retailer_id: string` Your identifier for the product, as registered in the catalog. - `quantity: number` - `type: "order"` - `"order"` - `text: optional string` Free text the customer attached to the order, when any. - `Referral object { type, body, click_id, 7 more }` Inbound only — never sendable. The ad or post context a customer's first message arrived from (for example an ad whose call to action opens a chat). A referral also opens a free-entry-point customer window — see the chat's customer_window. - `type: "referral"` - `"referral"` - `body: optional string` The ad's body text at click time. - `click_id: optional string` The click identifier assigned by the ad platform, for attribution. - `headline: optional string` The ad's headline at click time. - `image_url: optional string` URL of the ad's image creative, when media_kind is image. - `media_kind: optional string` The ad creative's media kind, e.g. image or video. - `source_id: optional string` The ad or post id. - `source_kind: optional string` What the source was, e.g. ad or post. - `source_url: optional string` The URL of the ad or post the customer came from. - `video_url: optional string` URL of the ad's video creative, when media_kind is video. - `System object { body, type, event }` Inbound only — never sendable. A system event in the chat, such as the customer changing their number. New event kinds appear over time; body is always present and human-readable. - `body: string` Human-readable description of the system event. - `type: "system"` - `"system"` - `event: optional string` The system event's kind, when the channel identifies one. New kinds appear over time — treat unknown values as informational. - `Unsupported object { raw, type, kind }` Inbound only — never sendable. A message kind this API does not yet type natively, carried as a typed passthrough: raw holds the channel payload, so a new message kind is never a black box or a silent drop. Native part types for popular kinds are added over time; this part is the compatibility guarantee in the meantime. - `raw: unknown` The channel payload — any JSON value: object, array, string, number, boolean, or null. Deliberately unconstrained, because the whole point of this part is to carry a shape this API does not yet know. For rows written by API version 1.3.0 or later, object member order, number formatting and duplicated members survive storage and read-back. The canonical encoder may compact insignificant whitespace before storage. Rows written before API version 1.3.0 retain normalized JSON only: member order and number formatting may differ, and only the last duplicated member survives. - `type: "unsupported"` - `"unsupported"` - `kind: optional string` The channel's name for the message kind, when it declares one. - `status: string` The message's delivery state as last reported. Inbound messages read `received`: they arrived, and no delivery of ours ran. A message you sent starts `accepted` and moves through `sent`, `delivered` and `read` as the channel reports them, with `failed` as the definitive negative outcome. `unknown` means exactly that: the send is INDETERMINATE and we decline to guess. It is NOT terminal — an indeterminate send is never re-sent, and it resolves to `sent`, `delivered`, `read` or `failed` when the channel's own report arrives — so keep observing rather than treating it as an outcome. States are reported asynchronously on the chat's event sequence, and the set grows additively: treat a value you do not recognise as "no information" rather than failing on it. Retention of this published status follows the chat transcript policy: there is no scheduled pruning, but no fixed minimum availability period is published yet. The present absence of a scheduled age-based sweep is not a promise of indefinite availability. `delivered` is reported by the channel after it accepted the message and can lag by hours, never arrive at all, or be followed by a failure, so do not build timeouts around it arriving promptly. - `channel_message_id: optional string` The channel's opaque identifier for this message, when the channel has assigned one. An inbound reaction's `channel_message_id` matches this field literally; never parse it or compare it with `id`. It is absent while an accepted outbound message has not yet received a channel identifier, and until it is present an inbound reaction to this message carries only `channel_message_id`. - `failure: optional object { code, message }` Why a failed message failed, when we have a reason worth publishing. Present only on `status` `failed`, and not on every one of those: a message can fail for a reason outside the published vocabulary and carry no `failure` at all. Its absence means "no published reason", never "no reason". Most messages the channel refused do carry one: a specific code where one is published, and `channel_refused` for most of the rest; a few kinds of refusal still carry none. `status` stays the thing to branch on. This is additive detail beside it, so an integration written before this field existed still sees a terminal `failed` and behaves exactly as it did. - `code: string` The specific reason. `sender_deregistered` — the number this message was going out from is no longer a registered sending number, and the message never left. This is terminal: it is not a pause and it does not clear, so retrying the same message cannot succeed and that conversation is over. Reach this customer by starting a new one on another of your numbers with a template, exactly as you would any customer whose 24-hour window has closed; `GET /v1/chats` shows which number each conversation uses. You are not billed for a message that failed this way. `quality_hold_expired` — this marketing message remained held by an automatic safety control on its sending line for ten minutes and was not sent. This is terminal: retrying the same message cannot succeed on that conversation. Send marketing from another of your numbers with a template, or contact support about the sending line. You are not billed for a message that failed this way. `target_message_failed` — the message this one quotes or reacts to failed, or its outcome could not be established, before this message went out. This message was therefore never sent, because a quote is never sent without its context. A `message.failed` event reports it. This is terminal: send it again as a new message, without that target or naming one that was sent. You are not billed a channel charge for it, though it still counts toward your platform subscription's message volume. `recipient_country_restricted` — the business behind the sending number is not currently permitted to message customers in this recipient's country, so the message was not delivered. The restriction blocks every message type, including replies inside the customer's 24-hour window. This is terminal for the message: sending it again cannot succeed while the restriction stands. Most countries unlock only when the business has completed business verification and has held an assigned messaging tier of 2,000 or higher for 30 consecutive days. The assigned tier is what counts, not how many messages you send. Brazil and Indonesia also require the business's primary business location to be in that country, at any tier: a business located elsewhere cannot message customers there. Until the business qualifies, sends to that country will keep failing. The channel publishes no list of restricted country pairs and offers no API signal before a send. If the business meets these conditions and the restriction stands, review the messaging policy for the business's category. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `payment_method_required` — the business behind the sending number has no working payment method on its messaging account, so this message was not sent. This is terminal for the message: retrying it cannot succeed until a payment method is added. Add or update the payment method in the messaging account's billing settings, then send again as a new message. Replies inside an open 24-hour customer window are charged too once the sending number's monthly free allowance of them is used up, so they also need a working payment method and can fail this way. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `recipient_phone_number_required` — this customer is known only by a username identifier, not a phone number, and this message can be delivered only to a phone number, so it was not sent. This is terminal for the message: sending it again to this customer cannot succeed. One-time-code templates (copy code, one-tap or zero-tap autofill) are the usual cause; deliver the code another way. Other messages, including templates without a one-time-code button, can still be sent to this customer. When the template is known in advance to carry a one-time-code button, the send is refused at once with the error `recipient_phone_number_required` instead and nothing is accepted. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `business_restricted` — this message was refused because the business behind the sending number is most likely restricted on its messaging account, so it was not sent. This is terminal for the message: sending it again will not succeed while the restriction stands. Review the status of the business's messaging account, and if the business believes it complies with the messaging policies, request a review of the restriction. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `channel_refused` — this message was refused upstream and was not sent, for a reason that has no more specific code here, and it will not be retried automatically. Contact support with this message's `id` to learn the reason and whether sending it again can succeed. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. A more specific code may be published for some of these refusals in a later release; treat a code you do not recognise exactly as you treat this one. - `message: string` Human-readable, written for a person reading it. Do not branch on it. - `from: optional string` The number this message left by, or arrived on, in E.164 (leading `+`). Every message in one conversation carries the same value — a conversation never moves to another number. Absent only if the number is no longer one of yours. - `from_selection: optional object { reason }` Present only when this service chose the sending number for you — that is, when you omitted `from`. A send that named `from` omits this rather than reporting a choice nobody made. - `reason: string` Why this number was used. Exactly one of: - `reused_active_chat` — this customer already had a conversation and it continues on the same number. - `new_best_number` — there was no existing conversation, so the best available number was chosen. Like every other vocabulary here it is a plain string that may grow additively; treat a value you do not recognise as "chosen for you". - `reply_to_message_id: optional string` This API's `id` of the earlier message in this chat that this message replies to. On an inbound message it is the message the customer quoted; on an outbound message it is the `reply_to_message_id` you sent. Look the value up in this chat's transcript to show what was answered; it is the same namespace as `id`, never a channel identifier. Absent when there is no reply context this API can resolve — a message that quotes nothing, or one that quotes a message this API never recorded in this chat. Treat absence as "no reply context available", not as proof the message was not a reply. - `zero_retention: optional true` True when the message is under zero-day retention: its content is not kept, so later reads and idempotent retries return empty `parts`. The original send response still carries the content. Retention applies only within Linq's systems. The WhatsApp channel operator's own processing and retention of message content are governed by its terms and are not affected by this setting. - `true` ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/messages \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" \ -d '{ "parts": [ { "body": "body", "type": "text" } ], "to": "to" }' ``` #### Response ```json { "id": "id", "chat_id": "chat_id", "created_at": "2019-12-27T18:11:19.117Z", "direction": "inbound", "parts": [ { "body": "body", "type": "text", "preview_url": true } ], "status": "status", "channel_message_id": "channel_message_id", "failure": { "code": "code", "message": "message" }, "from": "from", "from_selection": { "reason": "reason" }, "reply_to_message_id": "reply_to_message_id", "zero_retention": true } ``` --- # Event Log URL: https://docs.linqapp.com/channel/whatsapp/api/resources/event_log/ ## List account events **get** `/v1/event_log` Reads the durable account-wide event sequence in committed order. This bounded JSON collection is the recovery companion to the SSE stream. Its opaque cursor is scoped to this account, key mode and collection; it is not interchangeable with an SSE decimal id or chat cursor. A key that acts in an environment cannot read this log: it is refused with HTTP 403 `environment_stream_unavailable` (a 2xxx `error.code`, 2055) before anything is read, and an environment's events reach you through the webhook endpoints registered under its key. A key that acts in no environment reads the events of numbers in none; events of numbers in an environment are read past, never returned, so a page may hold fewer than `limit` events — or none — while `has_more` is true and `next_cursor` continues. Under zero-day retention, a message snapshot carries empty `parts` and `zero_retention: true`. When ephemeral messages are enabled, expired messages and their related events are omitted. The log reads past those positions just as it reads past environment-filtered events, so its cursor can advance across a retention gap and a page can be short or empty while `has_more` remains true. A `message.received` for a message carrying attachments is recorded, and so takes its log position, once every attachment has been captured or has failed, or ten minutes after the message arrived, whichever comes first. It can therefore follow events for later messages of the same chat: `seq_from` can decrease relative to log order. Never discard an event because its `seq_from` is lower than one already read; deduplicate by the event `id` and order the chat by `seq_from`, or reconcile with `GET /v1/chats/{chat}/events`. ### Query Parameters - `cursor: optional string` - `limit: optional number` ### Returns - `AccountEventPage object { data, has_more, next_cursor }` - `data: array of AccountEvent` - `id: string` - `data: object { category, customer, customer_kind, 6 more }` Extensible event-specific data. - `category: optional string` On `template.updated`: the template's category after the change, as `GET /v1/templates` reports it. Values grow additively. - `customer: optional string` On a chat event: the chat's `customer` value, frozen with the event as an opaque customer address. It is usually a phone number in digits-only form and can be a username identifier; `message.from` is your number, not theirs. Older retained events may omit it; read the chat's `customer` with `GET /v1/chats/{chat}` for those. A read-back of an event whose content retention has removed may also omit it, so keep the value from the original delivery. - `customer_kind: optional string` On a chat event: the form of `customer`, as the chat's `customer_kind` reports it: `phone_number` or `username_identifier`. Values may grow. Absent whenever `customer` is, and for an address of neither form. - `language: optional string` On `template.updated`: the template's language, such as `en_US`. - `message: optional Message` Frozen message snapshot on newly materialized incoming-message events. On read-back surfaces — the transcript, event log, event stream and replays — zero-day messages carry empty `parts` and `zero_retention: true`. Webhook deliveries and the send response carry the content; an idempotent retry of a zero-day send returns empty `parts` and `zero_retention: true`. Scrubbed ephemeral snapshots are omitted with their event. Older retained events may omit the snapshot; use the chat transcript for history. - `id: string` This API's message id. Put this value in an outbound reaction's `message_id`; an inbound reaction to this message carries the same value in its `message_id`, so this is the one identifier you need to keep. Mark-as-read targets the latest unread inbound message in a chat, so it takes the chat id. - `chat_id: string` The chat this message belongs to. - `created_at: string` - `direction: "inbound" or "outbound"` `inbound` (from the customer) or `outbound` (sent by you). - `"inbound"` - `"outbound"` - `parts: array of object { body, type, preview_url } or object { kind, type, availability, 10 more } or object { language, name, type, 4 more } or 17 more` The message content — sendable parts, plus the inbound-only types on inbound messages. Empty only when `zero_retention` is true, or when an idempotent retry returns an ephemeral message whose content retention cleanup has removed. - `Text object { body, type, preview_url }` A plain text message. - `body: string` The message text. URLs render as tappable links. - `type: "text"` - `"text"` - `preview_url: optional boolean` Render a preview card for the first URL in body. Defaults to false. - `Media object { kind, type, availability, 10 more }` A media message — image, video, audio, document, or sticker. The two identifiers are distinct namespaces: inbound media carries the channel's transient media_id; outbound media carries our durable upload_ref from POST /v1/media. - `kind: "image" or "video" or "audio" or 2 more` Which kind of media this is. Captions apply to image, video and document only; filename applies to document only. - `"image"` - `"video"` - `"audio"` - `"document"` - `"sticker"` - `type: "media"` - `"media"` - `availability: optional "available" or "unavailable" or "pending"` Response only, inbound parts only: whether the download answers the bytes. available: the file was captured and is retained. unavailable: it is not downloadable now, and unavailable_reason says why; with timed_out the download answers 409 while capture continues and can later answer 200, otherwise it answers 410, or 404 once the file is no longer known. It describes the file, not the exact HTTP answer of a later download, which can also refuse for capacity or authorization. pending: capture has not finished yet; only reads of the conversation return pending, and a message event never does. A message.received event is recorded once every attachment has been captured or has failed, or ten minutes after the message arrived, whichever comes first; an event part without availability is from a historical event and may still be capturing, so retry its download as the 409 Retry-After directs. A message event keeps the value it was recorded with; reads return the current one. Historical messages received before it was recorded omit it. Never accepted on sends. - `"available"` - `"unavailable"` - `"pending"` - `byte_size: optional number` Response only, inbound parts only: the exact size in bytes of the retained attachment, equal to the download's Content-Length. Present only while the bytes are captured and retained — the same lifetime as a working url, ending 30 days after server receipt — so it can be absent from a message event while capture has not completed, and its absence is not final; once present it never changes. Absent rather than zero. Never accepted on sends. - `caption: optional string` Caption rendered with the media. Image, video and document only — a caption on an audio or sticker part is rejected, never dropped. - `filename: optional string` Display filename. Documents only — a filename on any other kind is rejected, never dropped. - `media_id: optional string` Inbound only: the channel's transient media identifier. It expires after seven days and is never an outbound address; an outbound value is rejected with a pointer to media_id and upload_ref as the remedy. - `mime_type: optional string` Response only, inbound parts only: the media type the channel declared when the message arrived, verbatim. It may carry parameters (for example audio/ogg; codecs=opus) and may differ from the Content-Type the download answers with, which describes the retained bytes. Present on the webhook body and on every later read with the same value. Historical messages received before it was recorded omit this field. Never accepted on sends. - `source_url: optional string` Outbound only: a public https URL of the bytes to send, as an alternative to upload_ref. Supply exactly one of upload_ref or source_url. The address is fetched once, before the send is accepted, and its exact bytes are stored as an ordinary upload in this account and key partition; the accepted message and every later read carry that upload's upload_ref, never the address, and no retry fetches it again. The URL must be absolute https on the default port with no credentials and no fragment, must resolve to a public address (every redirect hop included, at most three), and must answer with the complete bytes and their exact media type within the fetch deadline. The bytes are then held to the same media type and size rules as POST /v1/media for the part's kind; a mismatch is refused, never converted. - `unavailable_reason: optional string` Response only, present only when availability is unavailable. An open string: the values today are timed_out, capture_failed and expired, and new values may be added. timed_out: the file was still being retrieved ten minutes after the message arrived, so its message event was recorded without it; retrieval continues and the file may become downloadable later, which reads of the conversation report. capture_failed: the file could not be retrieved. expired: the file was retrieved and is no longer retained, or is no longer known (the download then answers 410 or 404). Treat an unknown value as capture_failed. Never accepted on sends. - `upload_ref: optional string` Outbound only: our durable handle returned by POST /v1/media. Handles visibly begin upload. and are reusable within the account and key partition that created them. - `url: optional string` Response only: stable attachment download URL requiring the account Bearer key on every request. Pending capture returns 409 with Retry-After; retained bytes expire 30 days after server receipt. Historical unbound messages omit this field. Never accepted on sends. - `voice: optional boolean` Audio only. On a send it is optional: true sends the audio as a voice note; false, or leaving it out, sends it as an ordinary audio file. A voice note needs an upload stored as audio/ogg that holds mono Opus audio, sent by upload_ref or source_url within the existing audio size limit. The bytes are sent as supplied: they are never converted or inspected, so encode them as mono Opus before uploading. The recipient sees a play button only when the voice file is 512 KB or smaller; a larger voice note is still delivered but must be downloaded before it plays. On incoming audio parts it is response-only: whether the channel reported the audio as a voice note, verbatim. true means it was recorded with the messaging client's voice-recording feature; false means it was sent as an audio file. Present on the webhook body and on every later read with the same value. Absent on an incoming part means the channel did not say, never that the audio is not a voice note. Other kinds never carry it, and historical messages received before it was recorded omit it. - `Template object { language, name, type, 4 more }` An approved message template — the one part type sendable outside an open customer service window. name and language identify the approved template; parameters fills its named placeholders. Authentication templates use this same generic part: their published parameter schema names exactly one parameter, `code` — the one-time code you generate, 1–15 characters — and the message shows it in its body and behind its code button. Every sendable template is registered and approved ahead of the send and publishes its own parameter schema — a send referencing an unknown template, a missing or unknown parameter, or a value that breaks the template's rules is rejected with a 422 naming the exact field. - `language: string` The template's language-and-locale code, e.g. en_US. - `name: string` The approved template's name. Lowercase letters, digits and underscores only. - `type: "template"` - `"template"` - `buttons: optional array of object { index, payload, type }` Send-time values for this approved template's own dynamic buttons, in ascending index order: a url button whose destination ends in {{1}} takes the value appended there and is REQUIRED; a quick_reply button takes the payload returned to you when it is tapped and is OPTIONAL — omit it and the button returns its label. Fixed buttons have no slot. The approved template's send_schema lists the (index, type) slots and an x-rule stating which are required; omit buttons entirely for a template with no url slot when the labels are what you want back. - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `cards: optional array of object { card_index, kind, upload_ref, 2 more }` Per-card values for an approved media-card carousel. The approved template's send_schema provides structural bounds and an x-rule listing the exact card order, media kind, named body values, and dynamic button slots enforced by runtime L2 validation. Omit for non-carousel templates. - `card_index: number` - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: string` A durable handle returned by POST /v1/media. It is resolved within this key's account and partition, then consumed into a transient channel media identifier only at delivery. - `buttons: optional array of object { index, payload, type }` - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `parameters: optional unknown` Named values for this card's body placeholders. - `header: optional object { kind, upload_ref }` The uploaded media used for this approved template's media header. Omit unless this template's send_schema requires it. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `parameters: optional unknown` Named values for the template's placeholders. The shape is per-template: each registered template publishes its own parameter schema — hand THAT schema to your model when composing a specific template. Omit for templates with no placeholders. - `InteractiveList object { body, button, sections, 3 more }` An interactive list message: body text plus a button that opens a sectioned list of selectable rows. The customer's selection arrives as an inbound interactive_reply part with kind list_reply, carrying the chosen row's id. - `body: string` The message body. - `button: string` Label of the button that opens the list. - `sections: array of object { rows, title }` The list's sections, each holding selectable rows. At most 10 rows in total across ALL sections combined — not 10 per section. - `rows: array of object { id, title, description }` This section's rows. The 10-row limit is on the TOTAL across all sections, so a second section reduces what this one may hold. - `id: string` Your identifier for the row — echoed back as the interactive_reply's id. - `title: string` The row's visible title. - `description: optional string` Secondary text under the title. - `title: optional string` Section title. Required when the list has more than one section. - `type: "interactive_list"` - `"interactive_list"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `InteractiveButtons object { body, buttons, type, 3 more }` An interactive reply-buttons message: body text plus up to three tappable buttons. The customer's tap arrives as an inbound interactive_reply part with kind button_reply, carrying the tapped button's id. - `body: string` The message body. - `buttons: array of object { id, title }` The tappable buttons — at most three. - `id: string` Your identifier for the button — echoed back as the interactive_reply's id. - `title: string` The button's visible label. - `type: "interactive_buttons"` - `"interactive_buttons"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `InteractiveCtaURL object { body, display_text, type, 4 more }` An interactive call-to-action message: body text plus one button that opens a URL. - `body: string` The message body. - `display_text: string` The button's visible label. - `type: "interactive_cta_url"` - `"interactive_cta_url"` - `url: string` The URL the button opens. Must be absolute, with an http or https scheme. - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref, filename }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `filename: optional string` The file name the customer sees on a document header. Documents only. - `InteractiveCarousel object { body, cards, type }` An interactive carousel: one message whose body sits above 2 to 10 horizontally scrolling cards. Each card shows an uploaded image, or a video from a public link, and either one button that opens a URL or reply buttons. A tap on a card's reply button arrives as an inbound template_reply part whose payload is that button's id; nothing else in the reply identifies the card, so the id you choose is the card's identity. - `body: string` The message text shown above the cards. - `cards: array of object { card_index, header, body, 2 more }` The cards, left to right. - `card_index: number` This card's zero-based position: the first card is 0, the next 1, and so on, in array order. - `header: object { kind, upload_ref, url }` The card's media: an image named by upload_ref, or a video named by the public https url it plays from. Every card carries the same kind. - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: optional string` A durable handle returned by POST /v1/media for an image upload. Image cards only. - `url: optional string` The public https address the card's video plays from. Video cards only. It is sent exactly as written and never fetched by this API, so it must be publicly reachable and serve a playable video; a link that does not play is accepted and then reported as a failed delivery (message.failed with channel_refused). - `body: optional string` Optional text below the card's image or video, with at most two line breaks. - `reply_buttons: optional array of object { id, title }` Buttons the customer taps to reply. Use either url_button or reply_buttons on every card. - `id: string` Your identifier for the button, echoed back as the template_reply's payload. Unique across the whole carousel. - `title: string` The button's visible label. - `url_button: optional object { display_text, url }` One button that opens a URL. Use either url_button or reply_buttons on every card. - `display_text: string` The button's visible label. - `url: string` The absolute https URL the button opens. - `type: "interactive_carousel"` - `"interactive_carousel"` - `LocationRequest object { body, type }` Asks the customer to share a location. The response arrives as a location part. - `body: string` Prompt shown above the send-location button. - `type: "location_request"` - `"location_request"` - `ContactRequest object { body, type }` Asks the customer to share their own contact card with one tap. Useful when you know the customer only by a username identifier and need a phone number. The answer arrives as an ordinary contacts part whose card carries origin contact_request; a card the customer shares by hand carries origin other instead. The answer is not linked to your request as a reply: its message carries no reply_to_message_id, so match it by origin and timing. Sendable inside the customer window. - `body: string` Prompt shown above the share-contact button. - `type: "contact_request"` - `"contact_request"` - `AddressRequest object { body, country, type }` Reserved for asking an eligible customer in India to submit a structured address. Sending this part is not available until business and customer eligibility can be verified at acceptance. Address responses already arrive as address_reply parts. - `body: string` Prompt shown above the address form. - `country: "IN"` ISO country code. Structured address requests are currently available only in India. - `"IN"` - `type: "address_request"` - `"address_request"` - `Contacts object { contacts, type }` One or more contact cards. - `contacts: array of object { name, addresses, birthday, 5 more }` The contact cards to send. The channel permits far more; this API caps a message at five, because a message carrying hundreds of cards is a mistake rather than a use case. - `name: object { formatted_name, first_name, last_name, 3 more }` - `formatted_name: string` The contact's full display name. - `first_name: optional string` - `last_name: optional string` - `middle_name: optional string` - `prefix: optional string` - `suffix: optional string` - `addresses: optional array of object { city, country, country_code, 4 more }` - `city: optional string` - `country: optional string` - `country_code: optional string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `state: optional string` - `street: optional string` - `zip: optional string` - `birthday: optional string` The contact's birthday as YYYY-MM-DD. - `emails: optional array of object { email, kind }` - `email: string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `org: optional object { company, department, title }` - `company: optional string` - `department: optional string` - `title: optional string` - `origin: optional string` Response-only: how the customer came to share this card, as the channel reported it, verbatim. contact_request means they tapped the share button on a contact_request you sent; other means they shared a card themselves. New values may appear, so treat any other value as unrecognised rather than as either of these. Absent when the channel did not say, and on cards received before it was recorded. A send carrying it is rejected with a pointer at the member. - `phones: optional array of object { phone, kind, messaging_id }` - `phone: string` The phone number, ideally in +E.164 form. - `kind: optional string` A label for the number, e.g. CELL, MAIN, WORK, HOME. - `messaging_id: optional string` The contact's messaging-account identifier on this channel, when known — makes the card openable in the messaging app. - `urls: optional array of object { url, kind }` - `url: string` - `kind: optional string` A label for the URL, e.g. WORK, HOME. - `type: "contacts"` - `"contacts"` - `Location object { latitude, longitude, type, 2 more }` A location pin. - `latitude: number` Latitude in decimal degrees. - `longitude: number` Longitude in decimal degrees. - `type: "location"` - `"location"` - `address: optional string` The place's address, shown under the name. - `name: optional string` The place's name, shown on the pin. - `Reaction object { emoji, type, channel_message_id, message_id }` An emoji reaction to an earlier message in the chat. message_id is this API's Message.id for the target in both directions: it is what you send, and it is appended to an inbound reaction whenever the target is a message of the same chat. channel_message_id is the channel's opaque identifier and appears on inbound reactions only. - `emoji: string` A single emoji. Send an empty string to remove a previous reaction to the same message. - `type: "reaction"` - `"reaction"` - `channel_message_id: optional string` Inbound only: the channel's opaque identifier for the message being reacted to. Always present on an inbound reaction, beside message_id whenever the target resolved. Match it literally to Message.channel_message_id in the chat transcript; never parse it or compare it with Message.id. - `message_id: optional string` This API's Message.id for the message being reacted to. Outbound: required, and the API resolves it into the channel namespace before sending, so the message must be one this account can see in the chat the send addresses. Inbound: present whenever the target is a message of the same chat, so you can keep only this identifier; absent when the chat does not hold the target. - `InteractiveReply object { id, kind, title, 2 more }` Inbound only — never sendable. The customer's selection from an interactive_list (kind list_reply) or interactive_buttons (kind button_reply) message, carrying the id you assigned to the chosen row or button. - `id: string` The id you assigned to the chosen row or button, exactly as you sent it. - `kind: "list_reply" or "button_reply"` Which interactive message kind was answered. - `"list_reply"` - `"button_reply"` - `title: string` The chosen row's or button's visible title. - `type: "interactive_reply"` - `"interactive_reply"` - `description: optional string` The chosen list row's secondary text, when it had one. - `TemplateReply object { payload, text, type }` Inbound only — never sendable. The customer tapped a quick-reply button on an approved template you sent, or a reply button on a card of an interactive_carousel you sent. payload is the value you set on that button: the template's quick_reply slot payload (or the button's label when you left the slot out), or the carousel card button's id. text is the label the customer saw. A carousel tap carries nothing else that identifies the card, so the id you chose is the card's only identity. For a template tap, the message's reply_to_message_id names the template message that carried the button. Distinct from interactive_reply, which answers an interactive_buttons or interactive_list message. - `payload: string` The quick_reply slot's payload from your send, or the button label when the slot was omitted; for a carousel card, the tapped reply button's id. - `text: string` The tapped button's label, as the customer saw it. - `type: "template_reply"` - `"template_reply"` - `AddressReply object { type, values, saved_address_id }` Inbound only: the structured values submitted in response to an address request. - `type: "address_reply"` - `"address_reply"` - `values: object { address, building_name, city, 8 more }` - `address: optional string` - `building_name: optional string` - `city: optional string` - `floor_number: optional string` - `house_number: optional string` - `landmark_area: optional string` - `name: optional string` - `phone_number: optional string` - `pin_code: optional string` - `state: optional string` - `tower_number: optional string` - `saved_address_id: optional string` Identifier of the selected saved address, when one was selected. - `Order object { catalog_id, items, type, text }` Inbound only — never sendable. An order the customer placed from a product catalog. - `catalog_id: string` The catalog the ordered items belong to. - `items: array of object { currency, price, product_retailer_id, quantity }` The ordered items. - `currency: string` ISO 4217 currency code for price. - `price: number` The per-item price at order time. - `product_retailer_id: string` Your identifier for the product, as registered in the catalog. - `quantity: number` - `type: "order"` - `"order"` - `text: optional string` Free text the customer attached to the order, when any. - `Referral object { type, body, click_id, 7 more }` Inbound only — never sendable. The ad or post context a customer's first message arrived from (for example an ad whose call to action opens a chat). A referral also opens a free-entry-point customer window — see the chat's customer_window. - `type: "referral"` - `"referral"` - `body: optional string` The ad's body text at click time. - `click_id: optional string` The click identifier assigned by the ad platform, for attribution. - `headline: optional string` The ad's headline at click time. - `image_url: optional string` URL of the ad's image creative, when media_kind is image. - `media_kind: optional string` The ad creative's media kind, e.g. image or video. - `source_id: optional string` The ad or post id. - `source_kind: optional string` What the source was, e.g. ad or post. - `source_url: optional string` The URL of the ad or post the customer came from. - `video_url: optional string` URL of the ad's video creative, when media_kind is video. - `System object { body, type, event }` Inbound only — never sendable. A system event in the chat, such as the customer changing their number. New event kinds appear over time; body is always present and human-readable. - `body: string` Human-readable description of the system event. - `type: "system"` - `"system"` - `event: optional string` The system event's kind, when the channel identifies one. New kinds appear over time — treat unknown values as informational. - `Unsupported object { raw, type, kind }` Inbound only — never sendable. A message kind this API does not yet type natively, carried as a typed passthrough: raw holds the channel payload, so a new message kind is never a black box or a silent drop. Native part types for popular kinds are added over time; this part is the compatibility guarantee in the meantime. - `raw: unknown` The channel payload — any JSON value: object, array, string, number, boolean, or null. Deliberately unconstrained, because the whole point of this part is to carry a shape this API does not yet know. For rows written by API version 1.3.0 or later, object member order, number formatting and duplicated members survive storage and read-back. The canonical encoder may compact insignificant whitespace before storage. Rows written before API version 1.3.0 retain normalized JSON only: member order and number formatting may differ, and only the last duplicated member survives. - `type: "unsupported"` - `"unsupported"` - `kind: optional string` The channel's name for the message kind, when it declares one. - `status: string` The message's delivery state as last reported. Inbound messages read `received`: they arrived, and no delivery of ours ran. A message you sent starts `accepted` and moves through `sent`, `delivered` and `read` as the channel reports them, with `failed` as the definitive negative outcome. `unknown` means exactly that: the send is INDETERMINATE and we decline to guess. It is NOT terminal — an indeterminate send is never re-sent, and it resolves to `sent`, `delivered`, `read` or `failed` when the channel's own report arrives — so keep observing rather than treating it as an outcome. States are reported asynchronously on the chat's event sequence, and the set grows additively: treat a value you do not recognise as "no information" rather than failing on it. Retention of this published status follows the chat transcript policy: there is no scheduled pruning, but no fixed minimum availability period is published yet. The present absence of a scheduled age-based sweep is not a promise of indefinite availability. `delivered` is reported by the channel after it accepted the message and can lag by hours, never arrive at all, or be followed by a failure, so do not build timeouts around it arriving promptly. - `channel_message_id: optional string` The channel's opaque identifier for this message, when the channel has assigned one. An inbound reaction's `channel_message_id` matches this field literally; never parse it or compare it with `id`. It is absent while an accepted outbound message has not yet received a channel identifier, and until it is present an inbound reaction to this message carries only `channel_message_id`. - `failure: optional object { code, message }` Why a failed message failed, when we have a reason worth publishing. Present only on `status` `failed`, and not on every one of those: a message can fail for a reason outside the published vocabulary and carry no `failure` at all. Its absence means "no published reason", never "no reason". Most messages the channel refused do carry one: a specific code where one is published, and `channel_refused` for most of the rest; a few kinds of refusal still carry none. `status` stays the thing to branch on. This is additive detail beside it, so an integration written before this field existed still sees a terminal `failed` and behaves exactly as it did. - `code: string` The specific reason. `sender_deregistered` — the number this message was going out from is no longer a registered sending number, and the message never left. This is terminal: it is not a pause and it does not clear, so retrying the same message cannot succeed and that conversation is over. Reach this customer by starting a new one on another of your numbers with a template, exactly as you would any customer whose 24-hour window has closed; `GET /v1/chats` shows which number each conversation uses. You are not billed for a message that failed this way. `quality_hold_expired` — this marketing message remained held by an automatic safety control on its sending line for ten minutes and was not sent. This is terminal: retrying the same message cannot succeed on that conversation. Send marketing from another of your numbers with a template, or contact support about the sending line. You are not billed for a message that failed this way. `target_message_failed` — the message this one quotes or reacts to failed, or its outcome could not be established, before this message went out. This message was therefore never sent, because a quote is never sent without its context. A `message.failed` event reports it. This is terminal: send it again as a new message, without that target or naming one that was sent. You are not billed a channel charge for it, though it still counts toward your platform subscription's message volume. `recipient_country_restricted` — the business behind the sending number is not currently permitted to message customers in this recipient's country, so the message was not delivered. The restriction blocks every message type, including replies inside the customer's 24-hour window. This is terminal for the message: sending it again cannot succeed while the restriction stands. Most countries unlock only when the business has completed business verification and has held an assigned messaging tier of 2,000 or higher for 30 consecutive days. The assigned tier is what counts, not how many messages you send. Brazil and Indonesia also require the business's primary business location to be in that country, at any tier: a business located elsewhere cannot message customers there. Until the business qualifies, sends to that country will keep failing. The channel publishes no list of restricted country pairs and offers no API signal before a send. If the business meets these conditions and the restriction stands, review the messaging policy for the business's category. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `payment_method_required` — the business behind the sending number has no working payment method on its messaging account, so this message was not sent. This is terminal for the message: retrying it cannot succeed until a payment method is added. Add or update the payment method in the messaging account's billing settings, then send again as a new message. Replies inside an open 24-hour customer window are charged too once the sending number's monthly free allowance of them is used up, so they also need a working payment method and can fail this way. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `recipient_phone_number_required` — this customer is known only by a username identifier, not a phone number, and this message can be delivered only to a phone number, so it was not sent. This is terminal for the message: sending it again to this customer cannot succeed. One-time-code templates (copy code, one-tap or zero-tap autofill) are the usual cause; deliver the code another way. Other messages, including templates without a one-time-code button, can still be sent to this customer. When the template is known in advance to carry a one-time-code button, the send is refused at once with the error `recipient_phone_number_required` instead and nothing is accepted. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `business_restricted` — this message was refused because the business behind the sending number is most likely restricted on its messaging account, so it was not sent. This is terminal for the message: sending it again will not succeed while the restriction stands. Review the status of the business's messaging account, and if the business believes it complies with the messaging policies, request a review of the restriction. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `channel_refused` — this message was refused upstream and was not sent, for a reason that has no more specific code here, and it will not be retried automatically. Contact support with this message's `id` to learn the reason and whether sending it again can succeed. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. A more specific code may be published for some of these refusals in a later release; treat a code you do not recognise exactly as you treat this one. - `message: string` Human-readable, written for a person reading it. Do not branch on it. - `from: optional string` The number this message left by, or arrived on, in E.164 (leading `+`). Every message in one conversation carries the same value — a conversation never moves to another number. Absent only if the number is no longer one of yours. - `reply_to_message_id: optional string` This API's `id` of the earlier message in this chat that this message replies to. On an inbound message it is the message the customer quoted; on an outbound message it is the `reply_to_message_id` you sent. Look the value up in this chat's transcript to show what was answered; it is the same namespace as `id`, never a channel identifier. Absent when there is no reply context this API can resolve — a message that quotes nothing, or one that quotes a message this API never recorded in this chat. Treat absence as "no reply context available", not as proof the message was not a reply. - `zero_retention: optional true` True when the message is under zero-day retention: its content is not kept, so later reads and idempotent retries return empty `parts`. The original send response still carries the content. Retention applies only within Linq's systems. The WhatsApp channel operator's own processing and retention of message content are governed by its terms and are not affected by this setting. - `true` - `name: optional string` On `template.updated`: the template's name. With `language`, it is the pair `GET /v1/templates` and a `template` part address it by. - `previous_category: optional string` On `template.updated`: the category before the change. Absent when the template is newly listed. - `previous_status: optional string` On `template.updated`: the status before the change. Absent when the template is newly listed. - `status: optional string` On `template.updated`: the template's status after the change, as `GET /v1/templates` reports it. Only `approved` may be sent; values grow additively, and anything you do not recognise is not sendable. - `timestamp: string` - `type: string` - `has_more: boolean` True when the log continues past `next_cursor`. Read this, not the length of `data`: a page can be empty while the log continues. - `next_cursor: string` Exclusive opaque cursor for the next page: the position this page read through, which is at or past the last event returned. It is at least the last event's position, and past it when the page reads through events not delivered to this key (numbers in an environment) or events omitted because an ephemeral message expired. It is present on an empty page too when `has_more` is true — pass it back to continue — and null only when nothing lies past the position asked for. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/event_log \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` #### Response ```json { "data": [ { "id": "id", "data": { "category": "category", "customer": "customer", "customer_kind": "customer_kind", "language": "language", "message": { "id": "id", "chat_id": "chat_id", "created_at": "2019-12-27T18:11:19.117Z", "direction": "inbound", "parts": [ { "body": "body", "type": "text", "preview_url": true } ], "status": "status", "channel_message_id": "channel_message_id", "failure": { "code": "code", "message": "message" }, "from": "from", "reply_to_message_id": "reply_to_message_id", "zero_retention": true }, "name": "name", "previous_category": "previous_category", "previous_status": "previous_status", "status": "status" }, "timestamp": "2019-12-27T18:11:19.117Z", "type": "type" } ], "has_more": true, "next_cursor": "next_cursor" } ``` ## Domain Types ### Account Event - `AccountEvent object { id, data, timestamp, type }` One canonical account event envelope. Account sequence is transport metadata and is not a member. - `id: string` - `data: object { category, customer, customer_kind, 6 more }` Extensible event-specific data. - `category: optional string` On `template.updated`: the template's category after the change, as `GET /v1/templates` reports it. Values grow additively. - `customer: optional string` On a chat event: the chat's `customer` value, frozen with the event as an opaque customer address. It is usually a phone number in digits-only form and can be a username identifier; `message.from` is your number, not theirs. Older retained events may omit it; read the chat's `customer` with `GET /v1/chats/{chat}` for those. A read-back of an event whose content retention has removed may also omit it, so keep the value from the original delivery. - `customer_kind: optional string` On a chat event: the form of `customer`, as the chat's `customer_kind` reports it: `phone_number` or `username_identifier`. Values may grow. Absent whenever `customer` is, and for an address of neither form. - `language: optional string` On `template.updated`: the template's language, such as `en_US`. - `message: optional Message` Frozen message snapshot on newly materialized incoming-message events. On read-back surfaces — the transcript, event log, event stream and replays — zero-day messages carry empty `parts` and `zero_retention: true`. Webhook deliveries and the send response carry the content; an idempotent retry of a zero-day send returns empty `parts` and `zero_retention: true`. Scrubbed ephemeral snapshots are omitted with their event. Older retained events may omit the snapshot; use the chat transcript for history. - `id: string` This API's message id. Put this value in an outbound reaction's `message_id`; an inbound reaction to this message carries the same value in its `message_id`, so this is the one identifier you need to keep. Mark-as-read targets the latest unread inbound message in a chat, so it takes the chat id. - `chat_id: string` The chat this message belongs to. - `created_at: string` - `direction: "inbound" or "outbound"` `inbound` (from the customer) or `outbound` (sent by you). - `"inbound"` - `"outbound"` - `parts: array of object { body, type, preview_url } or object { kind, type, availability, 10 more } or object { language, name, type, 4 more } or 17 more` The message content — sendable parts, plus the inbound-only types on inbound messages. Empty only when `zero_retention` is true, or when an idempotent retry returns an ephemeral message whose content retention cleanup has removed. - `Text object { body, type, preview_url }` A plain text message. - `body: string` The message text. URLs render as tappable links. - `type: "text"` - `"text"` - `preview_url: optional boolean` Render a preview card for the first URL in body. Defaults to false. - `Media object { kind, type, availability, 10 more }` A media message — image, video, audio, document, or sticker. The two identifiers are distinct namespaces: inbound media carries the channel's transient media_id; outbound media carries our durable upload_ref from POST /v1/media. - `kind: "image" or "video" or "audio" or 2 more` Which kind of media this is. Captions apply to image, video and document only; filename applies to document only. - `"image"` - `"video"` - `"audio"` - `"document"` - `"sticker"` - `type: "media"` - `"media"` - `availability: optional "available" or "unavailable" or "pending"` Response only, inbound parts only: whether the download answers the bytes. available: the file was captured and is retained. unavailable: it is not downloadable now, and unavailable_reason says why; with timed_out the download answers 409 while capture continues and can later answer 200, otherwise it answers 410, or 404 once the file is no longer known. It describes the file, not the exact HTTP answer of a later download, which can also refuse for capacity or authorization. pending: capture has not finished yet; only reads of the conversation return pending, and a message event never does. A message.received event is recorded once every attachment has been captured or has failed, or ten minutes after the message arrived, whichever comes first; an event part without availability is from a historical event and may still be capturing, so retry its download as the 409 Retry-After directs. A message event keeps the value it was recorded with; reads return the current one. Historical messages received before it was recorded omit it. Never accepted on sends. - `"available"` - `"unavailable"` - `"pending"` - `byte_size: optional number` Response only, inbound parts only: the exact size in bytes of the retained attachment, equal to the download's Content-Length. Present only while the bytes are captured and retained — the same lifetime as a working url, ending 30 days after server receipt — so it can be absent from a message event while capture has not completed, and its absence is not final; once present it never changes. Absent rather than zero. Never accepted on sends. - `caption: optional string` Caption rendered with the media. Image, video and document only — a caption on an audio or sticker part is rejected, never dropped. - `filename: optional string` Display filename. Documents only — a filename on any other kind is rejected, never dropped. - `media_id: optional string` Inbound only: the channel's transient media identifier. It expires after seven days and is never an outbound address; an outbound value is rejected with a pointer to media_id and upload_ref as the remedy. - `mime_type: optional string` Response only, inbound parts only: the media type the channel declared when the message arrived, verbatim. It may carry parameters (for example audio/ogg; codecs=opus) and may differ from the Content-Type the download answers with, which describes the retained bytes. Present on the webhook body and on every later read with the same value. Historical messages received before it was recorded omit this field. Never accepted on sends. - `source_url: optional string` Outbound only: a public https URL of the bytes to send, as an alternative to upload_ref. Supply exactly one of upload_ref or source_url. The address is fetched once, before the send is accepted, and its exact bytes are stored as an ordinary upload in this account and key partition; the accepted message and every later read carry that upload's upload_ref, never the address, and no retry fetches it again. The URL must be absolute https on the default port with no credentials and no fragment, must resolve to a public address (every redirect hop included, at most three), and must answer with the complete bytes and their exact media type within the fetch deadline. The bytes are then held to the same media type and size rules as POST /v1/media for the part's kind; a mismatch is refused, never converted. - `unavailable_reason: optional string` Response only, present only when availability is unavailable. An open string: the values today are timed_out, capture_failed and expired, and new values may be added. timed_out: the file was still being retrieved ten minutes after the message arrived, so its message event was recorded without it; retrieval continues and the file may become downloadable later, which reads of the conversation report. capture_failed: the file could not be retrieved. expired: the file was retrieved and is no longer retained, or is no longer known (the download then answers 410 or 404). Treat an unknown value as capture_failed. Never accepted on sends. - `upload_ref: optional string` Outbound only: our durable handle returned by POST /v1/media. Handles visibly begin upload. and are reusable within the account and key partition that created them. - `url: optional string` Response only: stable attachment download URL requiring the account Bearer key on every request. Pending capture returns 409 with Retry-After; retained bytes expire 30 days after server receipt. Historical unbound messages omit this field. Never accepted on sends. - `voice: optional boolean` Audio only. On a send it is optional: true sends the audio as a voice note; false, or leaving it out, sends it as an ordinary audio file. A voice note needs an upload stored as audio/ogg that holds mono Opus audio, sent by upload_ref or source_url within the existing audio size limit. The bytes are sent as supplied: they are never converted or inspected, so encode them as mono Opus before uploading. The recipient sees a play button only when the voice file is 512 KB or smaller; a larger voice note is still delivered but must be downloaded before it plays. On incoming audio parts it is response-only: whether the channel reported the audio as a voice note, verbatim. true means it was recorded with the messaging client's voice-recording feature; false means it was sent as an audio file. Present on the webhook body and on every later read with the same value. Absent on an incoming part means the channel did not say, never that the audio is not a voice note. Other kinds never carry it, and historical messages received before it was recorded omit it. - `Template object { language, name, type, 4 more }` An approved message template — the one part type sendable outside an open customer service window. name and language identify the approved template; parameters fills its named placeholders. Authentication templates use this same generic part: their published parameter schema names exactly one parameter, `code` — the one-time code you generate, 1–15 characters — and the message shows it in its body and behind its code button. Every sendable template is registered and approved ahead of the send and publishes its own parameter schema — a send referencing an unknown template, a missing or unknown parameter, or a value that breaks the template's rules is rejected with a 422 naming the exact field. - `language: string` The template's language-and-locale code, e.g. en_US. - `name: string` The approved template's name. Lowercase letters, digits and underscores only. - `type: "template"` - `"template"` - `buttons: optional array of object { index, payload, type }` Send-time values for this approved template's own dynamic buttons, in ascending index order: a url button whose destination ends in {{1}} takes the value appended there and is REQUIRED; a quick_reply button takes the payload returned to you when it is tapped and is OPTIONAL — omit it and the button returns its label. Fixed buttons have no slot. The approved template's send_schema lists the (index, type) slots and an x-rule stating which are required; omit buttons entirely for a template with no url slot when the labels are what you want back. - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `cards: optional array of object { card_index, kind, upload_ref, 2 more }` Per-card values for an approved media-card carousel. The approved template's send_schema provides structural bounds and an x-rule listing the exact card order, media kind, named body values, and dynamic button slots enforced by runtime L2 validation. Omit for non-carousel templates. - `card_index: number` - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: string` A durable handle returned by POST /v1/media. It is resolved within this key's account and partition, then consumed into a transient channel media identifier only at delivery. - `buttons: optional array of object { index, payload, type }` - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `parameters: optional unknown` Named values for this card's body placeholders. - `header: optional object { kind, upload_ref }` The uploaded media used for this approved template's media header. Omit unless this template's send_schema requires it. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `parameters: optional unknown` Named values for the template's placeholders. The shape is per-template: each registered template publishes its own parameter schema — hand THAT schema to your model when composing a specific template. Omit for templates with no placeholders. - `InteractiveList object { body, button, sections, 3 more }` An interactive list message: body text plus a button that opens a sectioned list of selectable rows. The customer's selection arrives as an inbound interactive_reply part with kind list_reply, carrying the chosen row's id. - `body: string` The message body. - `button: string` Label of the button that opens the list. - `sections: array of object { rows, title }` The list's sections, each holding selectable rows. At most 10 rows in total across ALL sections combined — not 10 per section. - `rows: array of object { id, title, description }` This section's rows. The 10-row limit is on the TOTAL across all sections, so a second section reduces what this one may hold. - `id: string` Your identifier for the row — echoed back as the interactive_reply's id. - `title: string` The row's visible title. - `description: optional string` Secondary text under the title. - `title: optional string` Section title. Required when the list has more than one section. - `type: "interactive_list"` - `"interactive_list"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `InteractiveButtons object { body, buttons, type, 3 more }` An interactive reply-buttons message: body text plus up to three tappable buttons. The customer's tap arrives as an inbound interactive_reply part with kind button_reply, carrying the tapped button's id. - `body: string` The message body. - `buttons: array of object { id, title }` The tappable buttons — at most three. - `id: string` Your identifier for the button — echoed back as the interactive_reply's id. - `title: string` The button's visible label. - `type: "interactive_buttons"` - `"interactive_buttons"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `InteractiveCtaURL object { body, display_text, type, 4 more }` An interactive call-to-action message: body text plus one button that opens a URL. - `body: string` The message body. - `display_text: string` The button's visible label. - `type: "interactive_cta_url"` - `"interactive_cta_url"` - `url: string` The URL the button opens. Must be absolute, with an http or https scheme. - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref, filename }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `filename: optional string` The file name the customer sees on a document header. Documents only. - `InteractiveCarousel object { body, cards, type }` An interactive carousel: one message whose body sits above 2 to 10 horizontally scrolling cards. Each card shows an uploaded image, or a video from a public link, and either one button that opens a URL or reply buttons. A tap on a card's reply button arrives as an inbound template_reply part whose payload is that button's id; nothing else in the reply identifies the card, so the id you choose is the card's identity. - `body: string` The message text shown above the cards. - `cards: array of object { card_index, header, body, 2 more }` The cards, left to right. - `card_index: number` This card's zero-based position: the first card is 0, the next 1, and so on, in array order. - `header: object { kind, upload_ref, url }` The card's media: an image named by upload_ref, or a video named by the public https url it plays from. Every card carries the same kind. - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: optional string` A durable handle returned by POST /v1/media for an image upload. Image cards only. - `url: optional string` The public https address the card's video plays from. Video cards only. It is sent exactly as written and never fetched by this API, so it must be publicly reachable and serve a playable video; a link that does not play is accepted and then reported as a failed delivery (message.failed with channel_refused). - `body: optional string` Optional text below the card's image or video, with at most two line breaks. - `reply_buttons: optional array of object { id, title }` Buttons the customer taps to reply. Use either url_button or reply_buttons on every card. - `id: string` Your identifier for the button, echoed back as the template_reply's payload. Unique across the whole carousel. - `title: string` The button's visible label. - `url_button: optional object { display_text, url }` One button that opens a URL. Use either url_button or reply_buttons on every card. - `display_text: string` The button's visible label. - `url: string` The absolute https URL the button opens. - `type: "interactive_carousel"` - `"interactive_carousel"` - `LocationRequest object { body, type }` Asks the customer to share a location. The response arrives as a location part. - `body: string` Prompt shown above the send-location button. - `type: "location_request"` - `"location_request"` - `ContactRequest object { body, type }` Asks the customer to share their own contact card with one tap. Useful when you know the customer only by a username identifier and need a phone number. The answer arrives as an ordinary contacts part whose card carries origin contact_request; a card the customer shares by hand carries origin other instead. The answer is not linked to your request as a reply: its message carries no reply_to_message_id, so match it by origin and timing. Sendable inside the customer window. - `body: string` Prompt shown above the share-contact button. - `type: "contact_request"` - `"contact_request"` - `AddressRequest object { body, country, type }` Reserved for asking an eligible customer in India to submit a structured address. Sending this part is not available until business and customer eligibility can be verified at acceptance. Address responses already arrive as address_reply parts. - `body: string` Prompt shown above the address form. - `country: "IN"` ISO country code. Structured address requests are currently available only in India. - `"IN"` - `type: "address_request"` - `"address_request"` - `Contacts object { contacts, type }` One or more contact cards. - `contacts: array of object { name, addresses, birthday, 5 more }` The contact cards to send. The channel permits far more; this API caps a message at five, because a message carrying hundreds of cards is a mistake rather than a use case. - `name: object { formatted_name, first_name, last_name, 3 more }` - `formatted_name: string` The contact's full display name. - `first_name: optional string` - `last_name: optional string` - `middle_name: optional string` - `prefix: optional string` - `suffix: optional string` - `addresses: optional array of object { city, country, country_code, 4 more }` - `city: optional string` - `country: optional string` - `country_code: optional string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `state: optional string` - `street: optional string` - `zip: optional string` - `birthday: optional string` The contact's birthday as YYYY-MM-DD. - `emails: optional array of object { email, kind }` - `email: string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `org: optional object { company, department, title }` - `company: optional string` - `department: optional string` - `title: optional string` - `origin: optional string` Response-only: how the customer came to share this card, as the channel reported it, verbatim. contact_request means they tapped the share button on a contact_request you sent; other means they shared a card themselves. New values may appear, so treat any other value as unrecognised rather than as either of these. Absent when the channel did not say, and on cards received before it was recorded. A send carrying it is rejected with a pointer at the member. - `phones: optional array of object { phone, kind, messaging_id }` - `phone: string` The phone number, ideally in +E.164 form. - `kind: optional string` A label for the number, e.g. CELL, MAIN, WORK, HOME. - `messaging_id: optional string` The contact's messaging-account identifier on this channel, when known — makes the card openable in the messaging app. - `urls: optional array of object { url, kind }` - `url: string` - `kind: optional string` A label for the URL, e.g. WORK, HOME. - `type: "contacts"` - `"contacts"` - `Location object { latitude, longitude, type, 2 more }` A location pin. - `latitude: number` Latitude in decimal degrees. - `longitude: number` Longitude in decimal degrees. - `type: "location"` - `"location"` - `address: optional string` The place's address, shown under the name. - `name: optional string` The place's name, shown on the pin. - `Reaction object { emoji, type, channel_message_id, message_id }` An emoji reaction to an earlier message in the chat. message_id is this API's Message.id for the target in both directions: it is what you send, and it is appended to an inbound reaction whenever the target is a message of the same chat. channel_message_id is the channel's opaque identifier and appears on inbound reactions only. - `emoji: string` A single emoji. Send an empty string to remove a previous reaction to the same message. - `type: "reaction"` - `"reaction"` - `channel_message_id: optional string` Inbound only: the channel's opaque identifier for the message being reacted to. Always present on an inbound reaction, beside message_id whenever the target resolved. Match it literally to Message.channel_message_id in the chat transcript; never parse it or compare it with Message.id. - `message_id: optional string` This API's Message.id for the message being reacted to. Outbound: required, and the API resolves it into the channel namespace before sending, so the message must be one this account can see in the chat the send addresses. Inbound: present whenever the target is a message of the same chat, so you can keep only this identifier; absent when the chat does not hold the target. - `InteractiveReply object { id, kind, title, 2 more }` Inbound only — never sendable. The customer's selection from an interactive_list (kind list_reply) or interactive_buttons (kind button_reply) message, carrying the id you assigned to the chosen row or button. - `id: string` The id you assigned to the chosen row or button, exactly as you sent it. - `kind: "list_reply" or "button_reply"` Which interactive message kind was answered. - `"list_reply"` - `"button_reply"` - `title: string` The chosen row's or button's visible title. - `type: "interactive_reply"` - `"interactive_reply"` - `description: optional string` The chosen list row's secondary text, when it had one. - `TemplateReply object { payload, text, type }` Inbound only — never sendable. The customer tapped a quick-reply button on an approved template you sent, or a reply button on a card of an interactive_carousel you sent. payload is the value you set on that button: the template's quick_reply slot payload (or the button's label when you left the slot out), or the carousel card button's id. text is the label the customer saw. A carousel tap carries nothing else that identifies the card, so the id you chose is the card's only identity. For a template tap, the message's reply_to_message_id names the template message that carried the button. Distinct from interactive_reply, which answers an interactive_buttons or interactive_list message. - `payload: string` The quick_reply slot's payload from your send, or the button label when the slot was omitted; for a carousel card, the tapped reply button's id. - `text: string` The tapped button's label, as the customer saw it. - `type: "template_reply"` - `"template_reply"` - `AddressReply object { type, values, saved_address_id }` Inbound only: the structured values submitted in response to an address request. - `type: "address_reply"` - `"address_reply"` - `values: object { address, building_name, city, 8 more }` - `address: optional string` - `building_name: optional string` - `city: optional string` - `floor_number: optional string` - `house_number: optional string` - `landmark_area: optional string` - `name: optional string` - `phone_number: optional string` - `pin_code: optional string` - `state: optional string` - `tower_number: optional string` - `saved_address_id: optional string` Identifier of the selected saved address, when one was selected. - `Order object { catalog_id, items, type, text }` Inbound only — never sendable. An order the customer placed from a product catalog. - `catalog_id: string` The catalog the ordered items belong to. - `items: array of object { currency, price, product_retailer_id, quantity }` The ordered items. - `currency: string` ISO 4217 currency code for price. - `price: number` The per-item price at order time. - `product_retailer_id: string` Your identifier for the product, as registered in the catalog. - `quantity: number` - `type: "order"` - `"order"` - `text: optional string` Free text the customer attached to the order, when any. - `Referral object { type, body, click_id, 7 more }` Inbound only — never sendable. The ad or post context a customer's first message arrived from (for example an ad whose call to action opens a chat). A referral also opens a free-entry-point customer window — see the chat's customer_window. - `type: "referral"` - `"referral"` - `body: optional string` The ad's body text at click time. - `click_id: optional string` The click identifier assigned by the ad platform, for attribution. - `headline: optional string` The ad's headline at click time. - `image_url: optional string` URL of the ad's image creative, when media_kind is image. - `media_kind: optional string` The ad creative's media kind, e.g. image or video. - `source_id: optional string` The ad or post id. - `source_kind: optional string` What the source was, e.g. ad or post. - `source_url: optional string` The URL of the ad or post the customer came from. - `video_url: optional string` URL of the ad's video creative, when media_kind is video. - `System object { body, type, event }` Inbound only — never sendable. A system event in the chat, such as the customer changing their number. New event kinds appear over time; body is always present and human-readable. - `body: string` Human-readable description of the system event. - `type: "system"` - `"system"` - `event: optional string` The system event's kind, when the channel identifies one. New kinds appear over time — treat unknown values as informational. - `Unsupported object { raw, type, kind }` Inbound only — never sendable. A message kind this API does not yet type natively, carried as a typed passthrough: raw holds the channel payload, so a new message kind is never a black box or a silent drop. Native part types for popular kinds are added over time; this part is the compatibility guarantee in the meantime. - `raw: unknown` The channel payload — any JSON value: object, array, string, number, boolean, or null. Deliberately unconstrained, because the whole point of this part is to carry a shape this API does not yet know. For rows written by API version 1.3.0 or later, object member order, number formatting and duplicated members survive storage and read-back. The canonical encoder may compact insignificant whitespace before storage. Rows written before API version 1.3.0 retain normalized JSON only: member order and number formatting may differ, and only the last duplicated member survives. - `type: "unsupported"` - `"unsupported"` - `kind: optional string` The channel's name for the message kind, when it declares one. - `status: string` The message's delivery state as last reported. Inbound messages read `received`: they arrived, and no delivery of ours ran. A message you sent starts `accepted` and moves through `sent`, `delivered` and `read` as the channel reports them, with `failed` as the definitive negative outcome. `unknown` means exactly that: the send is INDETERMINATE and we decline to guess. It is NOT terminal — an indeterminate send is never re-sent, and it resolves to `sent`, `delivered`, `read` or `failed` when the channel's own report arrives — so keep observing rather than treating it as an outcome. States are reported asynchronously on the chat's event sequence, and the set grows additively: treat a value you do not recognise as "no information" rather than failing on it. Retention of this published status follows the chat transcript policy: there is no scheduled pruning, but no fixed minimum availability period is published yet. The present absence of a scheduled age-based sweep is not a promise of indefinite availability. `delivered` is reported by the channel after it accepted the message and can lag by hours, never arrive at all, or be followed by a failure, so do not build timeouts around it arriving promptly. - `channel_message_id: optional string` The channel's opaque identifier for this message, when the channel has assigned one. An inbound reaction's `channel_message_id` matches this field literally; never parse it or compare it with `id`. It is absent while an accepted outbound message has not yet received a channel identifier, and until it is present an inbound reaction to this message carries only `channel_message_id`. - `failure: optional object { code, message }` Why a failed message failed, when we have a reason worth publishing. Present only on `status` `failed`, and not on every one of those: a message can fail for a reason outside the published vocabulary and carry no `failure` at all. Its absence means "no published reason", never "no reason". Most messages the channel refused do carry one: a specific code where one is published, and `channel_refused` for most of the rest; a few kinds of refusal still carry none. `status` stays the thing to branch on. This is additive detail beside it, so an integration written before this field existed still sees a terminal `failed` and behaves exactly as it did. - `code: string` The specific reason. `sender_deregistered` — the number this message was going out from is no longer a registered sending number, and the message never left. This is terminal: it is not a pause and it does not clear, so retrying the same message cannot succeed and that conversation is over. Reach this customer by starting a new one on another of your numbers with a template, exactly as you would any customer whose 24-hour window has closed; `GET /v1/chats` shows which number each conversation uses. You are not billed for a message that failed this way. `quality_hold_expired` — this marketing message remained held by an automatic safety control on its sending line for ten minutes and was not sent. This is terminal: retrying the same message cannot succeed on that conversation. Send marketing from another of your numbers with a template, or contact support about the sending line. You are not billed for a message that failed this way. `target_message_failed` — the message this one quotes or reacts to failed, or its outcome could not be established, before this message went out. This message was therefore never sent, because a quote is never sent without its context. A `message.failed` event reports it. This is terminal: send it again as a new message, without that target or naming one that was sent. You are not billed a channel charge for it, though it still counts toward your platform subscription's message volume. `recipient_country_restricted` — the business behind the sending number is not currently permitted to message customers in this recipient's country, so the message was not delivered. The restriction blocks every message type, including replies inside the customer's 24-hour window. This is terminal for the message: sending it again cannot succeed while the restriction stands. Most countries unlock only when the business has completed business verification and has held an assigned messaging tier of 2,000 or higher for 30 consecutive days. The assigned tier is what counts, not how many messages you send. Brazil and Indonesia also require the business's primary business location to be in that country, at any tier: a business located elsewhere cannot message customers there. Until the business qualifies, sends to that country will keep failing. The channel publishes no list of restricted country pairs and offers no API signal before a send. If the business meets these conditions and the restriction stands, review the messaging policy for the business's category. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `payment_method_required` — the business behind the sending number has no working payment method on its messaging account, so this message was not sent. This is terminal for the message: retrying it cannot succeed until a payment method is added. Add or update the payment method in the messaging account's billing settings, then send again as a new message. Replies inside an open 24-hour customer window are charged too once the sending number's monthly free allowance of them is used up, so they also need a working payment method and can fail this way. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `recipient_phone_number_required` — this customer is known only by a username identifier, not a phone number, and this message can be delivered only to a phone number, so it was not sent. This is terminal for the message: sending it again to this customer cannot succeed. One-time-code templates (copy code, one-tap or zero-tap autofill) are the usual cause; deliver the code another way. Other messages, including templates without a one-time-code button, can still be sent to this customer. When the template is known in advance to carry a one-time-code button, the send is refused at once with the error `recipient_phone_number_required` instead and nothing is accepted. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `business_restricted` — this message was refused because the business behind the sending number is most likely restricted on its messaging account, so it was not sent. This is terminal for the message: sending it again will not succeed while the restriction stands. Review the status of the business's messaging account, and if the business believes it complies with the messaging policies, request a review of the restriction. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `channel_refused` — this message was refused upstream and was not sent, for a reason that has no more specific code here, and it will not be retried automatically. Contact support with this message's `id` to learn the reason and whether sending it again can succeed. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. A more specific code may be published for some of these refusals in a later release; treat a code you do not recognise exactly as you treat this one. - `message: string` Human-readable, written for a person reading it. Do not branch on it. - `from: optional string` The number this message left by, or arrived on, in E.164 (leading `+`). Every message in one conversation carries the same value — a conversation never moves to another number. Absent only if the number is no longer one of yours. - `reply_to_message_id: optional string` This API's `id` of the earlier message in this chat that this message replies to. On an inbound message it is the message the customer quoted; on an outbound message it is the `reply_to_message_id` you sent. Look the value up in this chat's transcript to show what was answered; it is the same namespace as `id`, never a channel identifier. Absent when there is no reply context this API can resolve — a message that quotes nothing, or one that quotes a message this API never recorded in this chat. Treat absence as "no reply context available", not as proof the message was not a reply. - `zero_retention: optional true` True when the message is under zero-day retention: its content is not kept, so later reads and idempotent retries return empty `parts`. The original send response still carries the content. Retention applies only within Linq's systems. The WhatsApp channel operator's own processing and retention of message content are governed by its terms and are not affected by this setting. - `true` - `name: optional string` On `template.updated`: the template's name. With `language`, it is the pair `GET /v1/templates` and a `template` part address it by. - `previous_category: optional string` On `template.updated`: the category before the change. Absent when the template is newly listed. - `previous_status: optional string` On `template.updated`: the status before the change. Absent when the template is newly listed. - `status: optional string` On `template.updated`: the template's status after the change, as `GET /v1/templates` reports it. Only `approved` may be sent; values grow additively, and anything you do not recognise is not sendable. - `timestamp: string` - `type: string` ### Account Event Page - `AccountEventPage object { data, has_more, next_cursor }` - `data: array of AccountEvent` - `id: string` - `data: object { category, customer, customer_kind, 6 more }` Extensible event-specific data. - `category: optional string` On `template.updated`: the template's category after the change, as `GET /v1/templates` reports it. Values grow additively. - `customer: optional string` On a chat event: the chat's `customer` value, frozen with the event as an opaque customer address. It is usually a phone number in digits-only form and can be a username identifier; `message.from` is your number, not theirs. Older retained events may omit it; read the chat's `customer` with `GET /v1/chats/{chat}` for those. A read-back of an event whose content retention has removed may also omit it, so keep the value from the original delivery. - `customer_kind: optional string` On a chat event: the form of `customer`, as the chat's `customer_kind` reports it: `phone_number` or `username_identifier`. Values may grow. Absent whenever `customer` is, and for an address of neither form. - `language: optional string` On `template.updated`: the template's language, such as `en_US`. - `message: optional Message` Frozen message snapshot on newly materialized incoming-message events. On read-back surfaces — the transcript, event log, event stream and replays — zero-day messages carry empty `parts` and `zero_retention: true`. Webhook deliveries and the send response carry the content; an idempotent retry of a zero-day send returns empty `parts` and `zero_retention: true`. Scrubbed ephemeral snapshots are omitted with their event. Older retained events may omit the snapshot; use the chat transcript for history. - `id: string` This API's message id. Put this value in an outbound reaction's `message_id`; an inbound reaction to this message carries the same value in its `message_id`, so this is the one identifier you need to keep. Mark-as-read targets the latest unread inbound message in a chat, so it takes the chat id. - `chat_id: string` The chat this message belongs to. - `created_at: string` - `direction: "inbound" or "outbound"` `inbound` (from the customer) or `outbound` (sent by you). - `"inbound"` - `"outbound"` - `parts: array of object { body, type, preview_url } or object { kind, type, availability, 10 more } or object { language, name, type, 4 more } or 17 more` The message content — sendable parts, plus the inbound-only types on inbound messages. Empty only when `zero_retention` is true, or when an idempotent retry returns an ephemeral message whose content retention cleanup has removed. - `Text object { body, type, preview_url }` A plain text message. - `body: string` The message text. URLs render as tappable links. - `type: "text"` - `"text"` - `preview_url: optional boolean` Render a preview card for the first URL in body. Defaults to false. - `Media object { kind, type, availability, 10 more }` A media message — image, video, audio, document, or sticker. The two identifiers are distinct namespaces: inbound media carries the channel's transient media_id; outbound media carries our durable upload_ref from POST /v1/media. - `kind: "image" or "video" or "audio" or 2 more` Which kind of media this is. Captions apply to image, video and document only; filename applies to document only. - `"image"` - `"video"` - `"audio"` - `"document"` - `"sticker"` - `type: "media"` - `"media"` - `availability: optional "available" or "unavailable" or "pending"` Response only, inbound parts only: whether the download answers the bytes. available: the file was captured and is retained. unavailable: it is not downloadable now, and unavailable_reason says why; with timed_out the download answers 409 while capture continues and can later answer 200, otherwise it answers 410, or 404 once the file is no longer known. It describes the file, not the exact HTTP answer of a later download, which can also refuse for capacity or authorization. pending: capture has not finished yet; only reads of the conversation return pending, and a message event never does. A message.received event is recorded once every attachment has been captured or has failed, or ten minutes after the message arrived, whichever comes first; an event part without availability is from a historical event and may still be capturing, so retry its download as the 409 Retry-After directs. A message event keeps the value it was recorded with; reads return the current one. Historical messages received before it was recorded omit it. Never accepted on sends. - `"available"` - `"unavailable"` - `"pending"` - `byte_size: optional number` Response only, inbound parts only: the exact size in bytes of the retained attachment, equal to the download's Content-Length. Present only while the bytes are captured and retained — the same lifetime as a working url, ending 30 days after server receipt — so it can be absent from a message event while capture has not completed, and its absence is not final; once present it never changes. Absent rather than zero. Never accepted on sends. - `caption: optional string` Caption rendered with the media. Image, video and document only — a caption on an audio or sticker part is rejected, never dropped. - `filename: optional string` Display filename. Documents only — a filename on any other kind is rejected, never dropped. - `media_id: optional string` Inbound only: the channel's transient media identifier. It expires after seven days and is never an outbound address; an outbound value is rejected with a pointer to media_id and upload_ref as the remedy. - `mime_type: optional string` Response only, inbound parts only: the media type the channel declared when the message arrived, verbatim. It may carry parameters (for example audio/ogg; codecs=opus) and may differ from the Content-Type the download answers with, which describes the retained bytes. Present on the webhook body and on every later read with the same value. Historical messages received before it was recorded omit this field. Never accepted on sends. - `source_url: optional string` Outbound only: a public https URL of the bytes to send, as an alternative to upload_ref. Supply exactly one of upload_ref or source_url. The address is fetched once, before the send is accepted, and its exact bytes are stored as an ordinary upload in this account and key partition; the accepted message and every later read carry that upload's upload_ref, never the address, and no retry fetches it again. The URL must be absolute https on the default port with no credentials and no fragment, must resolve to a public address (every redirect hop included, at most three), and must answer with the complete bytes and their exact media type within the fetch deadline. The bytes are then held to the same media type and size rules as POST /v1/media for the part's kind; a mismatch is refused, never converted. - `unavailable_reason: optional string` Response only, present only when availability is unavailable. An open string: the values today are timed_out, capture_failed and expired, and new values may be added. timed_out: the file was still being retrieved ten minutes after the message arrived, so its message event was recorded without it; retrieval continues and the file may become downloadable later, which reads of the conversation report. capture_failed: the file could not be retrieved. expired: the file was retrieved and is no longer retained, or is no longer known (the download then answers 410 or 404). Treat an unknown value as capture_failed. Never accepted on sends. - `upload_ref: optional string` Outbound only: our durable handle returned by POST /v1/media. Handles visibly begin upload. and are reusable within the account and key partition that created them. - `url: optional string` Response only: stable attachment download URL requiring the account Bearer key on every request. Pending capture returns 409 with Retry-After; retained bytes expire 30 days after server receipt. Historical unbound messages omit this field. Never accepted on sends. - `voice: optional boolean` Audio only. On a send it is optional: true sends the audio as a voice note; false, or leaving it out, sends it as an ordinary audio file. A voice note needs an upload stored as audio/ogg that holds mono Opus audio, sent by upload_ref or source_url within the existing audio size limit. The bytes are sent as supplied: they are never converted or inspected, so encode them as mono Opus before uploading. The recipient sees a play button only when the voice file is 512 KB or smaller; a larger voice note is still delivered but must be downloaded before it plays. On incoming audio parts it is response-only: whether the channel reported the audio as a voice note, verbatim. true means it was recorded with the messaging client's voice-recording feature; false means it was sent as an audio file. Present on the webhook body and on every later read with the same value. Absent on an incoming part means the channel did not say, never that the audio is not a voice note. Other kinds never carry it, and historical messages received before it was recorded omit it. - `Template object { language, name, type, 4 more }` An approved message template — the one part type sendable outside an open customer service window. name and language identify the approved template; parameters fills its named placeholders. Authentication templates use this same generic part: their published parameter schema names exactly one parameter, `code` — the one-time code you generate, 1–15 characters — and the message shows it in its body and behind its code button. Every sendable template is registered and approved ahead of the send and publishes its own parameter schema — a send referencing an unknown template, a missing or unknown parameter, or a value that breaks the template's rules is rejected with a 422 naming the exact field. - `language: string` The template's language-and-locale code, e.g. en_US. - `name: string` The approved template's name. Lowercase letters, digits and underscores only. - `type: "template"` - `"template"` - `buttons: optional array of object { index, payload, type }` Send-time values for this approved template's own dynamic buttons, in ascending index order: a url button whose destination ends in {{1}} takes the value appended there and is REQUIRED; a quick_reply button takes the payload returned to you when it is tapped and is OPTIONAL — omit it and the button returns its label. Fixed buttons have no slot. The approved template's send_schema lists the (index, type) slots and an x-rule stating which are required; omit buttons entirely for a template with no url slot when the labels are what you want back. - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `cards: optional array of object { card_index, kind, upload_ref, 2 more }` Per-card values for an approved media-card carousel. The approved template's send_schema provides structural bounds and an x-rule listing the exact card order, media kind, named body values, and dynamic button slots enforced by runtime L2 validation. Omit for non-carousel templates. - `card_index: number` - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: string` A durable handle returned by POST /v1/media. It is resolved within this key's account and partition, then consumed into a transient channel media identifier only at delivery. - `buttons: optional array of object { index, payload, type }` - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `parameters: optional unknown` Named values for this card's body placeholders. - `header: optional object { kind, upload_ref }` The uploaded media used for this approved template's media header. Omit unless this template's send_schema requires it. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `parameters: optional unknown` Named values for the template's placeholders. The shape is per-template: each registered template publishes its own parameter schema — hand THAT schema to your model when composing a specific template. Omit for templates with no placeholders. - `InteractiveList object { body, button, sections, 3 more }` An interactive list message: body text plus a button that opens a sectioned list of selectable rows. The customer's selection arrives as an inbound interactive_reply part with kind list_reply, carrying the chosen row's id. - `body: string` The message body. - `button: string` Label of the button that opens the list. - `sections: array of object { rows, title }` The list's sections, each holding selectable rows. At most 10 rows in total across ALL sections combined — not 10 per section. - `rows: array of object { id, title, description }` This section's rows. The 10-row limit is on the TOTAL across all sections, so a second section reduces what this one may hold. - `id: string` Your identifier for the row — echoed back as the interactive_reply's id. - `title: string` The row's visible title. - `description: optional string` Secondary text under the title. - `title: optional string` Section title. Required when the list has more than one section. - `type: "interactive_list"` - `"interactive_list"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `InteractiveButtons object { body, buttons, type, 3 more }` An interactive reply-buttons message: body text plus up to three tappable buttons. The customer's tap arrives as an inbound interactive_reply part with kind button_reply, carrying the tapped button's id. - `body: string` The message body. - `buttons: array of object { id, title }` The tappable buttons — at most three. - `id: string` Your identifier for the button — echoed back as the interactive_reply's id. - `title: string` The button's visible label. - `type: "interactive_buttons"` - `"interactive_buttons"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `InteractiveCtaURL object { body, display_text, type, 4 more }` An interactive call-to-action message: body text plus one button that opens a URL. - `body: string` The message body. - `display_text: string` The button's visible label. - `type: "interactive_cta_url"` - `"interactive_cta_url"` - `url: string` The URL the button opens. Must be absolute, with an http or https scheme. - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref, filename }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `filename: optional string` The file name the customer sees on a document header. Documents only. - `InteractiveCarousel object { body, cards, type }` An interactive carousel: one message whose body sits above 2 to 10 horizontally scrolling cards. Each card shows an uploaded image, or a video from a public link, and either one button that opens a URL or reply buttons. A tap on a card's reply button arrives as an inbound template_reply part whose payload is that button's id; nothing else in the reply identifies the card, so the id you choose is the card's identity. - `body: string` The message text shown above the cards. - `cards: array of object { card_index, header, body, 2 more }` The cards, left to right. - `card_index: number` This card's zero-based position: the first card is 0, the next 1, and so on, in array order. - `header: object { kind, upload_ref, url }` The card's media: an image named by upload_ref, or a video named by the public https url it plays from. Every card carries the same kind. - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: optional string` A durable handle returned by POST /v1/media for an image upload. Image cards only. - `url: optional string` The public https address the card's video plays from. Video cards only. It is sent exactly as written and never fetched by this API, so it must be publicly reachable and serve a playable video; a link that does not play is accepted and then reported as a failed delivery (message.failed with channel_refused). - `body: optional string` Optional text below the card's image or video, with at most two line breaks. - `reply_buttons: optional array of object { id, title }` Buttons the customer taps to reply. Use either url_button or reply_buttons on every card. - `id: string` Your identifier for the button, echoed back as the template_reply's payload. Unique across the whole carousel. - `title: string` The button's visible label. - `url_button: optional object { display_text, url }` One button that opens a URL. Use either url_button or reply_buttons on every card. - `display_text: string` The button's visible label. - `url: string` The absolute https URL the button opens. - `type: "interactive_carousel"` - `"interactive_carousel"` - `LocationRequest object { body, type }` Asks the customer to share a location. The response arrives as a location part. - `body: string` Prompt shown above the send-location button. - `type: "location_request"` - `"location_request"` - `ContactRequest object { body, type }` Asks the customer to share their own contact card with one tap. Useful when you know the customer only by a username identifier and need a phone number. The answer arrives as an ordinary contacts part whose card carries origin contact_request; a card the customer shares by hand carries origin other instead. The answer is not linked to your request as a reply: its message carries no reply_to_message_id, so match it by origin and timing. Sendable inside the customer window. - `body: string` Prompt shown above the share-contact button. - `type: "contact_request"` - `"contact_request"` - `AddressRequest object { body, country, type }` Reserved for asking an eligible customer in India to submit a structured address. Sending this part is not available until business and customer eligibility can be verified at acceptance. Address responses already arrive as address_reply parts. - `body: string` Prompt shown above the address form. - `country: "IN"` ISO country code. Structured address requests are currently available only in India. - `"IN"` - `type: "address_request"` - `"address_request"` - `Contacts object { contacts, type }` One or more contact cards. - `contacts: array of object { name, addresses, birthday, 5 more }` The contact cards to send. The channel permits far more; this API caps a message at five, because a message carrying hundreds of cards is a mistake rather than a use case. - `name: object { formatted_name, first_name, last_name, 3 more }` - `formatted_name: string` The contact's full display name. - `first_name: optional string` - `last_name: optional string` - `middle_name: optional string` - `prefix: optional string` - `suffix: optional string` - `addresses: optional array of object { city, country, country_code, 4 more }` - `city: optional string` - `country: optional string` - `country_code: optional string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `state: optional string` - `street: optional string` - `zip: optional string` - `birthday: optional string` The contact's birthday as YYYY-MM-DD. - `emails: optional array of object { email, kind }` - `email: string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `org: optional object { company, department, title }` - `company: optional string` - `department: optional string` - `title: optional string` - `origin: optional string` Response-only: how the customer came to share this card, as the channel reported it, verbatim. contact_request means they tapped the share button on a contact_request you sent; other means they shared a card themselves. New values may appear, so treat any other value as unrecognised rather than as either of these. Absent when the channel did not say, and on cards received before it was recorded. A send carrying it is rejected with a pointer at the member. - `phones: optional array of object { phone, kind, messaging_id }` - `phone: string` The phone number, ideally in +E.164 form. - `kind: optional string` A label for the number, e.g. CELL, MAIN, WORK, HOME. - `messaging_id: optional string` The contact's messaging-account identifier on this channel, when known — makes the card openable in the messaging app. - `urls: optional array of object { url, kind }` - `url: string` - `kind: optional string` A label for the URL, e.g. WORK, HOME. - `type: "contacts"` - `"contacts"` - `Location object { latitude, longitude, type, 2 more }` A location pin. - `latitude: number` Latitude in decimal degrees. - `longitude: number` Longitude in decimal degrees. - `type: "location"` - `"location"` - `address: optional string` The place's address, shown under the name. - `name: optional string` The place's name, shown on the pin. - `Reaction object { emoji, type, channel_message_id, message_id }` An emoji reaction to an earlier message in the chat. message_id is this API's Message.id for the target in both directions: it is what you send, and it is appended to an inbound reaction whenever the target is a message of the same chat. channel_message_id is the channel's opaque identifier and appears on inbound reactions only. - `emoji: string` A single emoji. Send an empty string to remove a previous reaction to the same message. - `type: "reaction"` - `"reaction"` - `channel_message_id: optional string` Inbound only: the channel's opaque identifier for the message being reacted to. Always present on an inbound reaction, beside message_id whenever the target resolved. Match it literally to Message.channel_message_id in the chat transcript; never parse it or compare it with Message.id. - `message_id: optional string` This API's Message.id for the message being reacted to. Outbound: required, and the API resolves it into the channel namespace before sending, so the message must be one this account can see in the chat the send addresses. Inbound: present whenever the target is a message of the same chat, so you can keep only this identifier; absent when the chat does not hold the target. - `InteractiveReply object { id, kind, title, 2 more }` Inbound only — never sendable. The customer's selection from an interactive_list (kind list_reply) or interactive_buttons (kind button_reply) message, carrying the id you assigned to the chosen row or button. - `id: string` The id you assigned to the chosen row or button, exactly as you sent it. - `kind: "list_reply" or "button_reply"` Which interactive message kind was answered. - `"list_reply"` - `"button_reply"` - `title: string` The chosen row's or button's visible title. - `type: "interactive_reply"` - `"interactive_reply"` - `description: optional string` The chosen list row's secondary text, when it had one. - `TemplateReply object { payload, text, type }` Inbound only — never sendable. The customer tapped a quick-reply button on an approved template you sent, or a reply button on a card of an interactive_carousel you sent. payload is the value you set on that button: the template's quick_reply slot payload (or the button's label when you left the slot out), or the carousel card button's id. text is the label the customer saw. A carousel tap carries nothing else that identifies the card, so the id you chose is the card's only identity. For a template tap, the message's reply_to_message_id names the template message that carried the button. Distinct from interactive_reply, which answers an interactive_buttons or interactive_list message. - `payload: string` The quick_reply slot's payload from your send, or the button label when the slot was omitted; for a carousel card, the tapped reply button's id. - `text: string` The tapped button's label, as the customer saw it. - `type: "template_reply"` - `"template_reply"` - `AddressReply object { type, values, saved_address_id }` Inbound only: the structured values submitted in response to an address request. - `type: "address_reply"` - `"address_reply"` - `values: object { address, building_name, city, 8 more }` - `address: optional string` - `building_name: optional string` - `city: optional string` - `floor_number: optional string` - `house_number: optional string` - `landmark_area: optional string` - `name: optional string` - `phone_number: optional string` - `pin_code: optional string` - `state: optional string` - `tower_number: optional string` - `saved_address_id: optional string` Identifier of the selected saved address, when one was selected. - `Order object { catalog_id, items, type, text }` Inbound only — never sendable. An order the customer placed from a product catalog. - `catalog_id: string` The catalog the ordered items belong to. - `items: array of object { currency, price, product_retailer_id, quantity }` The ordered items. - `currency: string` ISO 4217 currency code for price. - `price: number` The per-item price at order time. - `product_retailer_id: string` Your identifier for the product, as registered in the catalog. - `quantity: number` - `type: "order"` - `"order"` - `text: optional string` Free text the customer attached to the order, when any. - `Referral object { type, body, click_id, 7 more }` Inbound only — never sendable. The ad or post context a customer's first message arrived from (for example an ad whose call to action opens a chat). A referral also opens a free-entry-point customer window — see the chat's customer_window. - `type: "referral"` - `"referral"` - `body: optional string` The ad's body text at click time. - `click_id: optional string` The click identifier assigned by the ad platform, for attribution. - `headline: optional string` The ad's headline at click time. - `image_url: optional string` URL of the ad's image creative, when media_kind is image. - `media_kind: optional string` The ad creative's media kind, e.g. image or video. - `source_id: optional string` The ad or post id. - `source_kind: optional string` What the source was, e.g. ad or post. - `source_url: optional string` The URL of the ad or post the customer came from. - `video_url: optional string` URL of the ad's video creative, when media_kind is video. - `System object { body, type, event }` Inbound only — never sendable. A system event in the chat, such as the customer changing their number. New event kinds appear over time; body is always present and human-readable. - `body: string` Human-readable description of the system event. - `type: "system"` - `"system"` - `event: optional string` The system event's kind, when the channel identifies one. New kinds appear over time — treat unknown values as informational. - `Unsupported object { raw, type, kind }` Inbound only — never sendable. A message kind this API does not yet type natively, carried as a typed passthrough: raw holds the channel payload, so a new message kind is never a black box or a silent drop. Native part types for popular kinds are added over time; this part is the compatibility guarantee in the meantime. - `raw: unknown` The channel payload — any JSON value: object, array, string, number, boolean, or null. Deliberately unconstrained, because the whole point of this part is to carry a shape this API does not yet know. For rows written by API version 1.3.0 or later, object member order, number formatting and duplicated members survive storage and read-back. The canonical encoder may compact insignificant whitespace before storage. Rows written before API version 1.3.0 retain normalized JSON only: member order and number formatting may differ, and only the last duplicated member survives. - `type: "unsupported"` - `"unsupported"` - `kind: optional string` The channel's name for the message kind, when it declares one. - `status: string` The message's delivery state as last reported. Inbound messages read `received`: they arrived, and no delivery of ours ran. A message you sent starts `accepted` and moves through `sent`, `delivered` and `read` as the channel reports them, with `failed` as the definitive negative outcome. `unknown` means exactly that: the send is INDETERMINATE and we decline to guess. It is NOT terminal — an indeterminate send is never re-sent, and it resolves to `sent`, `delivered`, `read` or `failed` when the channel's own report arrives — so keep observing rather than treating it as an outcome. States are reported asynchronously on the chat's event sequence, and the set grows additively: treat a value you do not recognise as "no information" rather than failing on it. Retention of this published status follows the chat transcript policy: there is no scheduled pruning, but no fixed minimum availability period is published yet. The present absence of a scheduled age-based sweep is not a promise of indefinite availability. `delivered` is reported by the channel after it accepted the message and can lag by hours, never arrive at all, or be followed by a failure, so do not build timeouts around it arriving promptly. - `channel_message_id: optional string` The channel's opaque identifier for this message, when the channel has assigned one. An inbound reaction's `channel_message_id` matches this field literally; never parse it or compare it with `id`. It is absent while an accepted outbound message has not yet received a channel identifier, and until it is present an inbound reaction to this message carries only `channel_message_id`. - `failure: optional object { code, message }` Why a failed message failed, when we have a reason worth publishing. Present only on `status` `failed`, and not on every one of those: a message can fail for a reason outside the published vocabulary and carry no `failure` at all. Its absence means "no published reason", never "no reason". Most messages the channel refused do carry one: a specific code where one is published, and `channel_refused` for most of the rest; a few kinds of refusal still carry none. `status` stays the thing to branch on. This is additive detail beside it, so an integration written before this field existed still sees a terminal `failed` and behaves exactly as it did. - `code: string` The specific reason. `sender_deregistered` — the number this message was going out from is no longer a registered sending number, and the message never left. This is terminal: it is not a pause and it does not clear, so retrying the same message cannot succeed and that conversation is over. Reach this customer by starting a new one on another of your numbers with a template, exactly as you would any customer whose 24-hour window has closed; `GET /v1/chats` shows which number each conversation uses. You are not billed for a message that failed this way. `quality_hold_expired` — this marketing message remained held by an automatic safety control on its sending line for ten minutes and was not sent. This is terminal: retrying the same message cannot succeed on that conversation. Send marketing from another of your numbers with a template, or contact support about the sending line. You are not billed for a message that failed this way. `target_message_failed` — the message this one quotes or reacts to failed, or its outcome could not be established, before this message went out. This message was therefore never sent, because a quote is never sent without its context. A `message.failed` event reports it. This is terminal: send it again as a new message, without that target or naming one that was sent. You are not billed a channel charge for it, though it still counts toward your platform subscription's message volume. `recipient_country_restricted` — the business behind the sending number is not currently permitted to message customers in this recipient's country, so the message was not delivered. The restriction blocks every message type, including replies inside the customer's 24-hour window. This is terminal for the message: sending it again cannot succeed while the restriction stands. Most countries unlock only when the business has completed business verification and has held an assigned messaging tier of 2,000 or higher for 30 consecutive days. The assigned tier is what counts, not how many messages you send. Brazil and Indonesia also require the business's primary business location to be in that country, at any tier: a business located elsewhere cannot message customers there. Until the business qualifies, sends to that country will keep failing. The channel publishes no list of restricted country pairs and offers no API signal before a send. If the business meets these conditions and the restriction stands, review the messaging policy for the business's category. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `payment_method_required` — the business behind the sending number has no working payment method on its messaging account, so this message was not sent. This is terminal for the message: retrying it cannot succeed until a payment method is added. Add or update the payment method in the messaging account's billing settings, then send again as a new message. Replies inside an open 24-hour customer window are charged too once the sending number's monthly free allowance of them is used up, so they also need a working payment method and can fail this way. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `recipient_phone_number_required` — this customer is known only by a username identifier, not a phone number, and this message can be delivered only to a phone number, so it was not sent. This is terminal for the message: sending it again to this customer cannot succeed. One-time-code templates (copy code, one-tap or zero-tap autofill) are the usual cause; deliver the code another way. Other messages, including templates without a one-time-code button, can still be sent to this customer. When the template is known in advance to carry a one-time-code button, the send is refused at once with the error `recipient_phone_number_required` instead and nothing is accepted. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `business_restricted` — this message was refused because the business behind the sending number is most likely restricted on its messaging account, so it was not sent. This is terminal for the message: sending it again will not succeed while the restriction stands. Review the status of the business's messaging account, and if the business believes it complies with the messaging policies, request a review of the restriction. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `channel_refused` — this message was refused upstream and was not sent, for a reason that has no more specific code here, and it will not be retried automatically. Contact support with this message's `id` to learn the reason and whether sending it again can succeed. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. A more specific code may be published for some of these refusals in a later release; treat a code you do not recognise exactly as you treat this one. - `message: string` Human-readable, written for a person reading it. Do not branch on it. - `from: optional string` The number this message left by, or arrived on, in E.164 (leading `+`). Every message in one conversation carries the same value — a conversation never moves to another number. Absent only if the number is no longer one of yours. - `reply_to_message_id: optional string` This API's `id` of the earlier message in this chat that this message replies to. On an inbound message it is the message the customer quoted; on an outbound message it is the `reply_to_message_id` you sent. Look the value up in this chat's transcript to show what was answered; it is the same namespace as `id`, never a channel identifier. Absent when there is no reply context this API can resolve — a message that quotes nothing, or one that quotes a message this API never recorded in this chat. Treat absence as "no reply context available", not as proof the message was not a reply. - `zero_retention: optional true` True when the message is under zero-day retention: its content is not kept, so later reads and idempotent retries return empty `parts`. The original send response still carries the content. Retention applies only within Linq's systems. The WhatsApp channel operator's own processing and retention of message content are governed by its terms and are not affected by this setting. - `true` - `name: optional string` On `template.updated`: the template's name. With `language`, it is the pair `GET /v1/templates` and a `template` part address it by. - `previous_category: optional string` On `template.updated`: the category before the change. Absent when the template is newly listed. - `previous_status: optional string` On `template.updated`: the status before the change. Absent when the template is newly listed. - `status: optional string` On `template.updated`: the template's status after the change, as `GET /v1/templates` reports it. Only `approved` may be sent; values grow additively, and anything you do not recognise is not sendable. - `timestamp: string` - `type: string` - `has_more: boolean` True when the log continues past `next_cursor`. Read this, not the length of `data`: a page can be empty while the log continues. - `next_cursor: string` Exclusive opaque cursor for the next page: the position this page read through, which is at or past the last event returned. It is at least the last event's position, and past it when the page reads through events not delivered to this key (numbers in an environment) or events omitted because an ephemeral message expired. It is present on an empty page too when `has_more` is true — pass it back to continue — and null only when nothing lies past the position asked for. --- # List account events URL: https://docs.linqapp.com/channel/whatsapp/api/resources/event_log/methods/list/ **get** `/v1/event_log` Reads the durable account-wide event sequence in committed order. This bounded JSON collection is the recovery companion to the SSE stream. Its opaque cursor is scoped to this account, key mode and collection; it is not interchangeable with an SSE decimal id or chat cursor. A key that acts in an environment cannot read this log: it is refused with HTTP 403 `environment_stream_unavailable` (a 2xxx `error.code`, 2055) before anything is read, and an environment's events reach you through the webhook endpoints registered under its key. A key that acts in no environment reads the events of numbers in none; events of numbers in an environment are read past, never returned, so a page may hold fewer than `limit` events — or none — while `has_more` is true and `next_cursor` continues. Under zero-day retention, a message snapshot carries empty `parts` and `zero_retention: true`. When ephemeral messages are enabled, expired messages and their related events are omitted. The log reads past those positions just as it reads past environment-filtered events, so its cursor can advance across a retention gap and a page can be short or empty while `has_more` remains true. A `message.received` for a message carrying attachments is recorded, and so takes its log position, once every attachment has been captured or has failed, or ten minutes after the message arrived, whichever comes first. It can therefore follow events for later messages of the same chat: `seq_from` can decrease relative to log order. Never discard an event because its `seq_from` is lower than one already read; deduplicate by the event `id` and order the chat by `seq_from`, or reconcile with `GET /v1/chats/{chat}/events`. ### Query Parameters - `cursor: optional string` - `limit: optional number` ### Returns - `AccountEventPage object { data, has_more, next_cursor }` - `data: array of AccountEvent` - `id: string` - `data: object { category, customer, customer_kind, 6 more }` Extensible event-specific data. - `category: optional string` On `template.updated`: the template's category after the change, as `GET /v1/templates` reports it. Values grow additively. - `customer: optional string` On a chat event: the chat's `customer` value, frozen with the event as an opaque customer address. It is usually a phone number in digits-only form and can be a username identifier; `message.from` is your number, not theirs. Older retained events may omit it; read the chat's `customer` with `GET /v1/chats/{chat}` for those. A read-back of an event whose content retention has removed may also omit it, so keep the value from the original delivery. - `customer_kind: optional string` On a chat event: the form of `customer`, as the chat's `customer_kind` reports it: `phone_number` or `username_identifier`. Values may grow. Absent whenever `customer` is, and for an address of neither form. - `language: optional string` On `template.updated`: the template's language, such as `en_US`. - `message: optional Message` Frozen message snapshot on newly materialized incoming-message events. On read-back surfaces — the transcript, event log, event stream and replays — zero-day messages carry empty `parts` and `zero_retention: true`. Webhook deliveries and the send response carry the content; an idempotent retry of a zero-day send returns empty `parts` and `zero_retention: true`. Scrubbed ephemeral snapshots are omitted with their event. Older retained events may omit the snapshot; use the chat transcript for history. - `id: string` This API's message id. Put this value in an outbound reaction's `message_id`; an inbound reaction to this message carries the same value in its `message_id`, so this is the one identifier you need to keep. Mark-as-read targets the latest unread inbound message in a chat, so it takes the chat id. - `chat_id: string` The chat this message belongs to. - `created_at: string` - `direction: "inbound" or "outbound"` `inbound` (from the customer) or `outbound` (sent by you). - `"inbound"` - `"outbound"` - `parts: array of object { body, type, preview_url } or object { kind, type, availability, 10 more } or object { language, name, type, 4 more } or 17 more` The message content — sendable parts, plus the inbound-only types on inbound messages. Empty only when `zero_retention` is true, or when an idempotent retry returns an ephemeral message whose content retention cleanup has removed. - `Text object { body, type, preview_url }` A plain text message. - `body: string` The message text. URLs render as tappable links. - `type: "text"` - `"text"` - `preview_url: optional boolean` Render a preview card for the first URL in body. Defaults to false. - `Media object { kind, type, availability, 10 more }` A media message — image, video, audio, document, or sticker. The two identifiers are distinct namespaces: inbound media carries the channel's transient media_id; outbound media carries our durable upload_ref from POST /v1/media. - `kind: "image" or "video" or "audio" or 2 more` Which kind of media this is. Captions apply to image, video and document only; filename applies to document only. - `"image"` - `"video"` - `"audio"` - `"document"` - `"sticker"` - `type: "media"` - `"media"` - `availability: optional "available" or "unavailable" or "pending"` Response only, inbound parts only: whether the download answers the bytes. available: the file was captured and is retained. unavailable: it is not downloadable now, and unavailable_reason says why; with timed_out the download answers 409 while capture continues and can later answer 200, otherwise it answers 410, or 404 once the file is no longer known. It describes the file, not the exact HTTP answer of a later download, which can also refuse for capacity or authorization. pending: capture has not finished yet; only reads of the conversation return pending, and a message event never does. A message.received event is recorded once every attachment has been captured or has failed, or ten minutes after the message arrived, whichever comes first; an event part without availability is from a historical event and may still be capturing, so retry its download as the 409 Retry-After directs. A message event keeps the value it was recorded with; reads return the current one. Historical messages received before it was recorded omit it. Never accepted on sends. - `"available"` - `"unavailable"` - `"pending"` - `byte_size: optional number` Response only, inbound parts only: the exact size in bytes of the retained attachment, equal to the download's Content-Length. Present only while the bytes are captured and retained — the same lifetime as a working url, ending 30 days after server receipt — so it can be absent from a message event while capture has not completed, and its absence is not final; once present it never changes. Absent rather than zero. Never accepted on sends. - `caption: optional string` Caption rendered with the media. Image, video and document only — a caption on an audio or sticker part is rejected, never dropped. - `filename: optional string` Display filename. Documents only — a filename on any other kind is rejected, never dropped. - `media_id: optional string` Inbound only: the channel's transient media identifier. It expires after seven days and is never an outbound address; an outbound value is rejected with a pointer to media_id and upload_ref as the remedy. - `mime_type: optional string` Response only, inbound parts only: the media type the channel declared when the message arrived, verbatim. It may carry parameters (for example audio/ogg; codecs=opus) and may differ from the Content-Type the download answers with, which describes the retained bytes. Present on the webhook body and on every later read with the same value. Historical messages received before it was recorded omit this field. Never accepted on sends. - `source_url: optional string` Outbound only: a public https URL of the bytes to send, as an alternative to upload_ref. Supply exactly one of upload_ref or source_url. The address is fetched once, before the send is accepted, and its exact bytes are stored as an ordinary upload in this account and key partition; the accepted message and every later read carry that upload's upload_ref, never the address, and no retry fetches it again. The URL must be absolute https on the default port with no credentials and no fragment, must resolve to a public address (every redirect hop included, at most three), and must answer with the complete bytes and their exact media type within the fetch deadline. The bytes are then held to the same media type and size rules as POST /v1/media for the part's kind; a mismatch is refused, never converted. - `unavailable_reason: optional string` Response only, present only when availability is unavailable. An open string: the values today are timed_out, capture_failed and expired, and new values may be added. timed_out: the file was still being retrieved ten minutes after the message arrived, so its message event was recorded without it; retrieval continues and the file may become downloadable later, which reads of the conversation report. capture_failed: the file could not be retrieved. expired: the file was retrieved and is no longer retained, or is no longer known (the download then answers 410 or 404). Treat an unknown value as capture_failed. Never accepted on sends. - `upload_ref: optional string` Outbound only: our durable handle returned by POST /v1/media. Handles visibly begin upload. and are reusable within the account and key partition that created them. - `url: optional string` Response only: stable attachment download URL requiring the account Bearer key on every request. Pending capture returns 409 with Retry-After; retained bytes expire 30 days after server receipt. Historical unbound messages omit this field. Never accepted on sends. - `voice: optional boolean` Audio only. On a send it is optional: true sends the audio as a voice note; false, or leaving it out, sends it as an ordinary audio file. A voice note needs an upload stored as audio/ogg that holds mono Opus audio, sent by upload_ref or source_url within the existing audio size limit. The bytes are sent as supplied: they are never converted or inspected, so encode them as mono Opus before uploading. The recipient sees a play button only when the voice file is 512 KB or smaller; a larger voice note is still delivered but must be downloaded before it plays. On incoming audio parts it is response-only: whether the channel reported the audio as a voice note, verbatim. true means it was recorded with the messaging client's voice-recording feature; false means it was sent as an audio file. Present on the webhook body and on every later read with the same value. Absent on an incoming part means the channel did not say, never that the audio is not a voice note. Other kinds never carry it, and historical messages received before it was recorded omit it. - `Template object { language, name, type, 4 more }` An approved message template — the one part type sendable outside an open customer service window. name and language identify the approved template; parameters fills its named placeholders. Authentication templates use this same generic part: their published parameter schema names exactly one parameter, `code` — the one-time code you generate, 1–15 characters — and the message shows it in its body and behind its code button. Every sendable template is registered and approved ahead of the send and publishes its own parameter schema — a send referencing an unknown template, a missing or unknown parameter, or a value that breaks the template's rules is rejected with a 422 naming the exact field. - `language: string` The template's language-and-locale code, e.g. en_US. - `name: string` The approved template's name. Lowercase letters, digits and underscores only. - `type: "template"` - `"template"` - `buttons: optional array of object { index, payload, type }` Send-time values for this approved template's own dynamic buttons, in ascending index order: a url button whose destination ends in {{1}} takes the value appended there and is REQUIRED; a quick_reply button takes the payload returned to you when it is tapped and is OPTIONAL — omit it and the button returns its label. Fixed buttons have no slot. The approved template's send_schema lists the (index, type) slots and an x-rule stating which are required; omit buttons entirely for a template with no url slot when the labels are what you want back. - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `cards: optional array of object { card_index, kind, upload_ref, 2 more }` Per-card values for an approved media-card carousel. The approved template's send_schema provides structural bounds and an x-rule listing the exact card order, media kind, named body values, and dynamic button slots enforced by runtime L2 validation. Omit for non-carousel templates. - `card_index: number` - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: string` A durable handle returned by POST /v1/media. It is resolved within this key's account and partition, then consumed into a transient channel media identifier only at delivery. - `buttons: optional array of object { index, payload, type }` - `index: number` - `payload: string` - `type: "quick_reply" or "url"` - `"quick_reply"` - `"url"` - `parameters: optional unknown` Named values for this card's body placeholders. - `header: optional object { kind, upload_ref }` The uploaded media used for this approved template's media header. Omit unless this template's send_schema requires it. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `parameters: optional unknown` Named values for the template's placeholders. The shape is per-template: each registered template publishes its own parameter schema — hand THAT schema to your model when composing a specific template. Omit for templates with no placeholders. - `InteractiveList object { body, button, sections, 3 more }` An interactive list message: body text plus a button that opens a sectioned list of selectable rows. The customer's selection arrives as an inbound interactive_reply part with kind list_reply, carrying the chosen row's id. - `body: string` The message body. - `button: string` Label of the button that opens the list. - `sections: array of object { rows, title }` The list's sections, each holding selectable rows. At most 10 rows in total across ALL sections combined — not 10 per section. - `rows: array of object { id, title, description }` This section's rows. The 10-row limit is on the TOTAL across all sections, so a second section reduces what this one may hold. - `id: string` Your identifier for the row — echoed back as the interactive_reply's id. - `title: string` The row's visible title. - `description: optional string` Secondary text under the title. - `title: optional string` Section title. Required when the list has more than one section. - `type: "interactive_list"` - `"interactive_list"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `InteractiveButtons object { body, buttons, type, 3 more }` An interactive reply-buttons message: body text plus up to three tappable buttons. The customer's tap arrives as an inbound interactive_reply part with kind button_reply, carrying the tapped button's id. - `body: string` The message body. - `buttons: array of object { id, title }` The tappable buttons — at most three. - `id: string` Your identifier for the button — echoed back as the interactive_reply's id. - `title: string` The button's visible label. - `type: "interactive_buttons"` - `"interactive_buttons"` - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `InteractiveCtaURL object { body, display_text, type, 4 more }` An interactive call-to-action message: body text plus one button that opens a URL. - `body: string` The message body. - `display_text: string` The button's visible label. - `type: "interactive_cta_url"` - `"interactive_cta_url"` - `url: string` The URL the button opens. Must be absolute, with an http or https scheme. - `footer: optional string` Footer text below the body. - `header: optional string` Header text above the body. - `media_header: optional object { kind, upload_ref, filename }` Uploaded image, video, or document above the body. Use either header or media_header, never both. - `kind: "image" or "video" or "document"` - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by POST /v1/media. - `filename: optional string` The file name the customer sees on a document header. Documents only. - `InteractiveCarousel object { body, cards, type }` An interactive carousel: one message whose body sits above 2 to 10 horizontally scrolling cards. Each card shows an uploaded image, or a video from a public link, and either one button that opens a URL or reply buttons. A tap on a card's reply button arrives as an inbound template_reply part whose payload is that button's id; nothing else in the reply identifies the card, so the id you choose is the card's identity. - `body: string` The message text shown above the cards. - `cards: array of object { card_index, header, body, 2 more }` The cards, left to right. - `card_index: number` This card's zero-based position: the first card is 0, the next 1, and so on, in array order. - `header: object { kind, upload_ref, url }` The card's media: an image named by upload_ref, or a video named by the public https url it plays from. Every card carries the same kind. - `kind: "image" or "video"` - `"image"` - `"video"` - `upload_ref: optional string` A durable handle returned by POST /v1/media for an image upload. Image cards only. - `url: optional string` The public https address the card's video plays from. Video cards only. It is sent exactly as written and never fetched by this API, so it must be publicly reachable and serve a playable video; a link that does not play is accepted and then reported as a failed delivery (message.failed with channel_refused). - `body: optional string` Optional text below the card's image or video, with at most two line breaks. - `reply_buttons: optional array of object { id, title }` Buttons the customer taps to reply. Use either url_button or reply_buttons on every card. - `id: string` Your identifier for the button, echoed back as the template_reply's payload. Unique across the whole carousel. - `title: string` The button's visible label. - `url_button: optional object { display_text, url }` One button that opens a URL. Use either url_button or reply_buttons on every card. - `display_text: string` The button's visible label. - `url: string` The absolute https URL the button opens. - `type: "interactive_carousel"` - `"interactive_carousel"` - `LocationRequest object { body, type }` Asks the customer to share a location. The response arrives as a location part. - `body: string` Prompt shown above the send-location button. - `type: "location_request"` - `"location_request"` - `ContactRequest object { body, type }` Asks the customer to share their own contact card with one tap. Useful when you know the customer only by a username identifier and need a phone number. The answer arrives as an ordinary contacts part whose card carries origin contact_request; a card the customer shares by hand carries origin other instead. The answer is not linked to your request as a reply: its message carries no reply_to_message_id, so match it by origin and timing. Sendable inside the customer window. - `body: string` Prompt shown above the share-contact button. - `type: "contact_request"` - `"contact_request"` - `AddressRequest object { body, country, type }` Reserved for asking an eligible customer in India to submit a structured address. Sending this part is not available until business and customer eligibility can be verified at acceptance. Address responses already arrive as address_reply parts. - `body: string` Prompt shown above the address form. - `country: "IN"` ISO country code. Structured address requests are currently available only in India. - `"IN"` - `type: "address_request"` - `"address_request"` - `Contacts object { contacts, type }` One or more contact cards. - `contacts: array of object { name, addresses, birthday, 5 more }` The contact cards to send. The channel permits far more; this API caps a message at five, because a message carrying hundreds of cards is a mistake rather than a use case. - `name: object { formatted_name, first_name, last_name, 3 more }` - `formatted_name: string` The contact's full display name. - `first_name: optional string` - `last_name: optional string` - `middle_name: optional string` - `prefix: optional string` - `suffix: optional string` - `addresses: optional array of object { city, country, country_code, 4 more }` - `city: optional string` - `country: optional string` - `country_code: optional string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `state: optional string` - `street: optional string` - `zip: optional string` - `birthday: optional string` The contact's birthday as YYYY-MM-DD. - `emails: optional array of object { email, kind }` - `email: string` - `kind: optional string` A label for the address, e.g. WORK, HOME. - `org: optional object { company, department, title }` - `company: optional string` - `department: optional string` - `title: optional string` - `origin: optional string` Response-only: how the customer came to share this card, as the channel reported it, verbatim. contact_request means they tapped the share button on a contact_request you sent; other means they shared a card themselves. New values may appear, so treat any other value as unrecognised rather than as either of these. Absent when the channel did not say, and on cards received before it was recorded. A send carrying it is rejected with a pointer at the member. - `phones: optional array of object { phone, kind, messaging_id }` - `phone: string` The phone number, ideally in +E.164 form. - `kind: optional string` A label for the number, e.g. CELL, MAIN, WORK, HOME. - `messaging_id: optional string` The contact's messaging-account identifier on this channel, when known — makes the card openable in the messaging app. - `urls: optional array of object { url, kind }` - `url: string` - `kind: optional string` A label for the URL, e.g. WORK, HOME. - `type: "contacts"` - `"contacts"` - `Location object { latitude, longitude, type, 2 more }` A location pin. - `latitude: number` Latitude in decimal degrees. - `longitude: number` Longitude in decimal degrees. - `type: "location"` - `"location"` - `address: optional string` The place's address, shown under the name. - `name: optional string` The place's name, shown on the pin. - `Reaction object { emoji, type, channel_message_id, message_id }` An emoji reaction to an earlier message in the chat. message_id is this API's Message.id for the target in both directions: it is what you send, and it is appended to an inbound reaction whenever the target is a message of the same chat. channel_message_id is the channel's opaque identifier and appears on inbound reactions only. - `emoji: string` A single emoji. Send an empty string to remove a previous reaction to the same message. - `type: "reaction"` - `"reaction"` - `channel_message_id: optional string` Inbound only: the channel's opaque identifier for the message being reacted to. Always present on an inbound reaction, beside message_id whenever the target resolved. Match it literally to Message.channel_message_id in the chat transcript; never parse it or compare it with Message.id. - `message_id: optional string` This API's Message.id for the message being reacted to. Outbound: required, and the API resolves it into the channel namespace before sending, so the message must be one this account can see in the chat the send addresses. Inbound: present whenever the target is a message of the same chat, so you can keep only this identifier; absent when the chat does not hold the target. - `InteractiveReply object { id, kind, title, 2 more }` Inbound only — never sendable. The customer's selection from an interactive_list (kind list_reply) or interactive_buttons (kind button_reply) message, carrying the id you assigned to the chosen row or button. - `id: string` The id you assigned to the chosen row or button, exactly as you sent it. - `kind: "list_reply" or "button_reply"` Which interactive message kind was answered. - `"list_reply"` - `"button_reply"` - `title: string` The chosen row's or button's visible title. - `type: "interactive_reply"` - `"interactive_reply"` - `description: optional string` The chosen list row's secondary text, when it had one. - `TemplateReply object { payload, text, type }` Inbound only — never sendable. The customer tapped a quick-reply button on an approved template you sent, or a reply button on a card of an interactive_carousel you sent. payload is the value you set on that button: the template's quick_reply slot payload (or the button's label when you left the slot out), or the carousel card button's id. text is the label the customer saw. A carousel tap carries nothing else that identifies the card, so the id you chose is the card's only identity. For a template tap, the message's reply_to_message_id names the template message that carried the button. Distinct from interactive_reply, which answers an interactive_buttons or interactive_list message. - `payload: string` The quick_reply slot's payload from your send, or the button label when the slot was omitted; for a carousel card, the tapped reply button's id. - `text: string` The tapped button's label, as the customer saw it. - `type: "template_reply"` - `"template_reply"` - `AddressReply object { type, values, saved_address_id }` Inbound only: the structured values submitted in response to an address request. - `type: "address_reply"` - `"address_reply"` - `values: object { address, building_name, city, 8 more }` - `address: optional string` - `building_name: optional string` - `city: optional string` - `floor_number: optional string` - `house_number: optional string` - `landmark_area: optional string` - `name: optional string` - `phone_number: optional string` - `pin_code: optional string` - `state: optional string` - `tower_number: optional string` - `saved_address_id: optional string` Identifier of the selected saved address, when one was selected. - `Order object { catalog_id, items, type, text }` Inbound only — never sendable. An order the customer placed from a product catalog. - `catalog_id: string` The catalog the ordered items belong to. - `items: array of object { currency, price, product_retailer_id, quantity }` The ordered items. - `currency: string` ISO 4217 currency code for price. - `price: number` The per-item price at order time. - `product_retailer_id: string` Your identifier for the product, as registered in the catalog. - `quantity: number` - `type: "order"` - `"order"` - `text: optional string` Free text the customer attached to the order, when any. - `Referral object { type, body, click_id, 7 more }` Inbound only — never sendable. The ad or post context a customer's first message arrived from (for example an ad whose call to action opens a chat). A referral also opens a free-entry-point customer window — see the chat's customer_window. - `type: "referral"` - `"referral"` - `body: optional string` The ad's body text at click time. - `click_id: optional string` The click identifier assigned by the ad platform, for attribution. - `headline: optional string` The ad's headline at click time. - `image_url: optional string` URL of the ad's image creative, when media_kind is image. - `media_kind: optional string` The ad creative's media kind, e.g. image or video. - `source_id: optional string` The ad or post id. - `source_kind: optional string` What the source was, e.g. ad or post. - `source_url: optional string` The URL of the ad or post the customer came from. - `video_url: optional string` URL of the ad's video creative, when media_kind is video. - `System object { body, type, event }` Inbound only — never sendable. A system event in the chat, such as the customer changing their number. New event kinds appear over time; body is always present and human-readable. - `body: string` Human-readable description of the system event. - `type: "system"` - `"system"` - `event: optional string` The system event's kind, when the channel identifies one. New kinds appear over time — treat unknown values as informational. - `Unsupported object { raw, type, kind }` Inbound only — never sendable. A message kind this API does not yet type natively, carried as a typed passthrough: raw holds the channel payload, so a new message kind is never a black box or a silent drop. Native part types for popular kinds are added over time; this part is the compatibility guarantee in the meantime. - `raw: unknown` The channel payload — any JSON value: object, array, string, number, boolean, or null. Deliberately unconstrained, because the whole point of this part is to carry a shape this API does not yet know. For rows written by API version 1.3.0 or later, object member order, number formatting and duplicated members survive storage and read-back. The canonical encoder may compact insignificant whitespace before storage. Rows written before API version 1.3.0 retain normalized JSON only: member order and number formatting may differ, and only the last duplicated member survives. - `type: "unsupported"` - `"unsupported"` - `kind: optional string` The channel's name for the message kind, when it declares one. - `status: string` The message's delivery state as last reported. Inbound messages read `received`: they arrived, and no delivery of ours ran. A message you sent starts `accepted` and moves through `sent`, `delivered` and `read` as the channel reports them, with `failed` as the definitive negative outcome. `unknown` means exactly that: the send is INDETERMINATE and we decline to guess. It is NOT terminal — an indeterminate send is never re-sent, and it resolves to `sent`, `delivered`, `read` or `failed` when the channel's own report arrives — so keep observing rather than treating it as an outcome. States are reported asynchronously on the chat's event sequence, and the set grows additively: treat a value you do not recognise as "no information" rather than failing on it. Retention of this published status follows the chat transcript policy: there is no scheduled pruning, but no fixed minimum availability period is published yet. The present absence of a scheduled age-based sweep is not a promise of indefinite availability. `delivered` is reported by the channel after it accepted the message and can lag by hours, never arrive at all, or be followed by a failure, so do not build timeouts around it arriving promptly. - `channel_message_id: optional string` The channel's opaque identifier for this message, when the channel has assigned one. An inbound reaction's `channel_message_id` matches this field literally; never parse it or compare it with `id`. It is absent while an accepted outbound message has not yet received a channel identifier, and until it is present an inbound reaction to this message carries only `channel_message_id`. - `failure: optional object { code, message }` Why a failed message failed, when we have a reason worth publishing. Present only on `status` `failed`, and not on every one of those: a message can fail for a reason outside the published vocabulary and carry no `failure` at all. Its absence means "no published reason", never "no reason". Most messages the channel refused do carry one: a specific code where one is published, and `channel_refused` for most of the rest; a few kinds of refusal still carry none. `status` stays the thing to branch on. This is additive detail beside it, so an integration written before this field existed still sees a terminal `failed` and behaves exactly as it did. - `code: string` The specific reason. `sender_deregistered` — the number this message was going out from is no longer a registered sending number, and the message never left. This is terminal: it is not a pause and it does not clear, so retrying the same message cannot succeed and that conversation is over. Reach this customer by starting a new one on another of your numbers with a template, exactly as you would any customer whose 24-hour window has closed; `GET /v1/chats` shows which number each conversation uses. You are not billed for a message that failed this way. `quality_hold_expired` — this marketing message remained held by an automatic safety control on its sending line for ten minutes and was not sent. This is terminal: retrying the same message cannot succeed on that conversation. Send marketing from another of your numbers with a template, or contact support about the sending line. You are not billed for a message that failed this way. `target_message_failed` — the message this one quotes or reacts to failed, or its outcome could not be established, before this message went out. This message was therefore never sent, because a quote is never sent without its context. A `message.failed` event reports it. This is terminal: send it again as a new message, without that target or naming one that was sent. You are not billed a channel charge for it, though it still counts toward your platform subscription's message volume. `recipient_country_restricted` — the business behind the sending number is not currently permitted to message customers in this recipient's country, so the message was not delivered. The restriction blocks every message type, including replies inside the customer's 24-hour window. This is terminal for the message: sending it again cannot succeed while the restriction stands. Most countries unlock only when the business has completed business verification and has held an assigned messaging tier of 2,000 or higher for 30 consecutive days. The assigned tier is what counts, not how many messages you send. Brazil and Indonesia also require the business's primary business location to be in that country, at any tier: a business located elsewhere cannot message customers there. Until the business qualifies, sends to that country will keep failing. The channel publishes no list of restricted country pairs and offers no API signal before a send. If the business meets these conditions and the restriction stands, review the messaging policy for the business's category. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `payment_method_required` — the business behind the sending number has no working payment method on its messaging account, so this message was not sent. This is terminal for the message: retrying it cannot succeed until a payment method is added. Add or update the payment method in the messaging account's billing settings, then send again as a new message. Replies inside an open 24-hour customer window are charged too once the sending number's monthly free allowance of them is used up, so they also need a working payment method and can fail this way. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `recipient_phone_number_required` — this customer is known only by a username identifier, not a phone number, and this message can be delivered only to a phone number, so it was not sent. This is terminal for the message: sending it again to this customer cannot succeed. One-time-code templates (copy code, one-tap or zero-tap autofill) are the usual cause; deliver the code another way. Other messages, including templates without a one-time-code button, can still be sent to this customer. When the template is known in advance to carry a one-time-code button, the send is refused at once with the error `recipient_phone_number_required` instead and nothing is accepted. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `business_restricted` — this message was refused because the business behind the sending number is most likely restricted on its messaging account, so it was not sent. This is terminal for the message: sending it again will not succeed while the restriction stands. Review the status of the business's messaging account, and if the business believes it complies with the messaging policies, request a review of the restriction. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. `channel_refused` — this message was refused upstream and was not sent, for a reason that has no more specific code here, and it will not be retried automatically. Contact support with this message's `id` to learn the reason and whether sending it again can succeed. It can arrive either as an immediate `failed` or after the message was first reported `sent`; both mean the same thing. You are not billed for a message that failed this way. A more specific code may be published for some of these refusals in a later release; treat a code you do not recognise exactly as you treat this one. - `message: string` Human-readable, written for a person reading it. Do not branch on it. - `from: optional string` The number this message left by, or arrived on, in E.164 (leading `+`). Every message in one conversation carries the same value — a conversation never moves to another number. Absent only if the number is no longer one of yours. - `reply_to_message_id: optional string` This API's `id` of the earlier message in this chat that this message replies to. On an inbound message it is the message the customer quoted; on an outbound message it is the `reply_to_message_id` you sent. Look the value up in this chat's transcript to show what was answered; it is the same namespace as `id`, never a channel identifier. Absent when there is no reply context this API can resolve — a message that quotes nothing, or one that quotes a message this API never recorded in this chat. Treat absence as "no reply context available", not as proof the message was not a reply. - `zero_retention: optional true` True when the message is under zero-day retention: its content is not kept, so later reads and idempotent retries return empty `parts`. The original send response still carries the content. Retention applies only within Linq's systems. The WhatsApp channel operator's own processing and retention of message content are governed by its terms and are not affected by this setting. - `true` - `name: optional string` On `template.updated`: the template's name. With `language`, it is the pair `GET /v1/templates` and a `template` part address it by. - `previous_category: optional string` On `template.updated`: the category before the change. Absent when the template is newly listed. - `previous_status: optional string` On `template.updated`: the status before the change. Absent when the template is newly listed. - `status: optional string` On `template.updated`: the template's status after the change, as `GET /v1/templates` reports it. Only `approved` may be sent; values grow additively, and anything you do not recognise is not sendable. - `timestamp: string` - `type: string` - `has_more: boolean` True when the log continues past `next_cursor`. Read this, not the length of `data`: a page can be empty while the log continues. - `next_cursor: string` Exclusive opaque cursor for the next page: the position this page read through, which is at or past the last event returned. It is at least the last event's position, and past it when the page reads through events not delivered to this key (numbers in an environment) or events omitted because an ephemeral message expired. It is present on an empty page too when `has_more` is true — pass it back to continue — and null only when nothing lies past the position asked for. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/event_log \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` #### Response ```json { "data": [ { "id": "id", "data": { "category": "category", "customer": "customer", "customer_kind": "customer_kind", "language": "language", "message": { "id": "id", "chat_id": "chat_id", "created_at": "2019-12-27T18:11:19.117Z", "direction": "inbound", "parts": [ { "body": "body", "type": "text", "preview_url": true } ], "status": "status", "channel_message_id": "channel_message_id", "failure": { "code": "code", "message": "message" }, "from": "from", "reply_to_message_id": "reply_to_message_id", "zero_retention": true }, "name": "name", "previous_category": "previous_category", "previous_status": "previous_status", "status": "status" }, "timestamp": "2019-12-27T18:11:19.117Z", "type": "type" } ], "has_more": true, "next_cursor": "next_cursor" } ``` --- # Media URL: https://docs.linqapp.com/channel/whatsapp/api/resources/media/ ## Upload media **post** `/v1/media` Uploads media bytes and returns the durable `upload_ref` used by an outbound `media` part. Send the raw bytes as the request body and their exact media type in `Content-Type`; the body is never JSON-normalized. `media_id` is a different namespace: it is the channel's transient, inbound-only identifier and expires after seven days. It is never an outbound address. Handles returned here visibly begin `upload.` and are reusable within this key's account and key partition. Outbound uploads have no fixed expiry and are not routinely pruned, but this is not a permanence promise: account deletion or offboarding may remove them. Reusing a handle does not create or refresh an expiry clock. Inbound media bytes are not readable through this route and are deleted 30 days after server receipt. Size ceilings are applied by kind: image 5,000,000 bytes; audio and video 16,000,000; document 100,000,000; static sticker 100,000 and animated sticker 500,000. A larger body is refused, never truncated. Images accept JPEG or PNG; video accepts MP4 or 3GPP; audio accepts AAC, AMR, MPEG, MP4 or Ogg; stickers accept WebP; documents accept `text/plain`, `application/pdf`, the legacy Word/Excel/PowerPoint media types, and the three Open XML Word/Excel/PowerPoint media types. The media type must match the kind; an invented vendor suffix is not accepted. ### Query Parameters - `kind: "image" or "video" or "audio" or 2 more` The kind this upload will be sent as. - `"image"` - `"video"` - `"audio"` - `"document"` - `"sticker"` ### Returns - `Upload object { byte_size, kind, mime_type, 2 more }` A durable upload that can be reused by outbound media parts. It has no fixed expiry. - `byte_size: number` Exact byte count stored. - `kind: "image" or "video" or "audio" or 2 more` The media kind chosen at upload. A send using this handle must use the same kind. - `"image"` - `"video"` - `"audio"` - `"document"` - `"sticker"` - `mime_type: string` The normalized media type stored with the bytes. - `sha256: string` Lowercase hexadecimal SHA-256 over the exact stored bytes. - `upload_ref: string` Our reusable handle. It always begins `upload.` and is supplied as a media part's `upload_ref`. It has no fixed expiry or scheduled pruning, but is not permanent and may be removed by account deletion or offboarding. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/media \ -H 'Content-Type: */*' \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" \ -d '{}' ``` #### Response ```json { "byte_size": 0, "kind": "image", "mime_type": "mime_type", "sha256": "sha256", "upload_ref": "upload_ref" } ``` ## Domain Types ### Upload - `Upload object { byte_size, kind, mime_type, 2 more }` A durable upload that can be reused by outbound media parts. It has no fixed expiry. - `byte_size: number` Exact byte count stored. - `kind: "image" or "video" or "audio" or 2 more` The media kind chosen at upload. A send using this handle must use the same kind. - `"image"` - `"video"` - `"audio"` - `"document"` - `"sticker"` - `mime_type: string` The normalized media type stored with the bytes. - `sha256: string` Lowercase hexadecimal SHA-256 over the exact stored bytes. - `upload_ref: string` Our reusable handle. It always begins `upload.` and is supplied as a media part's `upload_ref`. It has no fixed expiry or scheduled pruning, but is not permanent and may be removed by account deletion or offboarding. --- # Upload media URL: https://docs.linqapp.com/channel/whatsapp/api/resources/media/methods/upload/ **post** `/v1/media` Uploads media bytes and returns the durable `upload_ref` used by an outbound `media` part. Send the raw bytes as the request body and their exact media type in `Content-Type`; the body is never JSON-normalized. `media_id` is a different namespace: it is the channel's transient, inbound-only identifier and expires after seven days. It is never an outbound address. Handles returned here visibly begin `upload.` and are reusable within this key's account and key partition. Outbound uploads have no fixed expiry and are not routinely pruned, but this is not a permanence promise: account deletion or offboarding may remove them. Reusing a handle does not create or refresh an expiry clock. Inbound media bytes are not readable through this route and are deleted 30 days after server receipt. Size ceilings are applied by kind: image 5,000,000 bytes; audio and video 16,000,000; document 100,000,000; static sticker 100,000 and animated sticker 500,000. A larger body is refused, never truncated. Images accept JPEG or PNG; video accepts MP4 or 3GPP; audio accepts AAC, AMR, MPEG, MP4 or Ogg; stickers accept WebP; documents accept `text/plain`, `application/pdf`, the legacy Word/Excel/PowerPoint media types, and the three Open XML Word/Excel/PowerPoint media types. The media type must match the kind; an invented vendor suffix is not accepted. ### Query Parameters - `kind: "image" or "video" or "audio" or 2 more` The kind this upload will be sent as. - `"image"` - `"video"` - `"audio"` - `"document"` - `"sticker"` ### Returns - `Upload object { byte_size, kind, mime_type, 2 more }` A durable upload that can be reused by outbound media parts. It has no fixed expiry. - `byte_size: number` Exact byte count stored. - `kind: "image" or "video" or "audio" or 2 more` The media kind chosen at upload. A send using this handle must use the same kind. - `"image"` - `"video"` - `"audio"` - `"document"` - `"sticker"` - `mime_type: string` The normalized media type stored with the bytes. - `sha256: string` Lowercase hexadecimal SHA-256 over the exact stored bytes. - `upload_ref: string` Our reusable handle. It always begins `upload.` and is supplied as a media part's `upload_ref`. It has no fixed expiry or scheduled pruning, but is not permanent and may be removed by account deletion or offboarding. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/media \ -H 'Content-Type: */*' \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" \ -d '{}' ``` #### Response ```json { "byte_size": 0, "kind": "image", "mime_type": "mime_type", "sha256": "sha256", "upload_ref": "upload_ref" } ``` --- # Phone Numbers URL: https://docs.linqapp.com/channel/whatsapp/api/resources/phone_numbers/ ## List phone numbers **get** `/v1/phone_numbers` **The placed quality band is provisional.** It is this service's current reading of the channel's `quality` token published beside it, and may change when the channel vocabulary is settled under V-19. Lists the currently registered sending numbers behind this brand's chats with their live channel health — quality rating, messaging tier, and display-name status. Numbers still moving through registration and numbers already released are not part of this sending inventory. ### Returns - `PhoneNumberList object { data }` The sending numbers visible to this key's brand. - `data: array of PhoneNumber` - `id: string` The number's id — chats pin to it via `phone_number_id`. - `channel_account_id: string` The channel account this number is registered under. Opaque; compare literally and never parse it. - `messaging_tier: string` The channel's messaging-tier token for this number, e.g. `TIER_1K`. Values are relayed as reported and may grow. - `name_status: string` The display-name review state for this number, as reported by the channel. - `phone_number: string` The number itself, in display form. - `quality: string` The channel's quality rating for this number, e.g. `green`, `yellow`, `red`. Values are relayed as reported and may grow. - `quality_band: optional "green" or "yellow" or "red"` This service's placed band for the current `quality` token. Absent when the token is empty or this build cannot place it. - `"green"` - `"yellow"` - `"red"` ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/phone_numbers \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` #### Response ```json { "data": [ { "id": "id", "channel_account_id": "channel_account_id", "messaging_tier": "messaging_tier", "name_status": "name_status", "phone_number": "phone_number", "quality": "quality", "quality_band": "green" } ] } ``` ## Domain Types ### Phone Number - `PhoneNumber object { id, channel_account_id, messaging_tier, 4 more }` One sending number and its live channel health. - `id: string` The number's id — chats pin to it via `phone_number_id`. - `channel_account_id: string` The channel account this number is registered under. Opaque; compare literally and never parse it. - `messaging_tier: string` The channel's messaging-tier token for this number, e.g. `TIER_1K`. Values are relayed as reported and may grow. - `name_status: string` The display-name review state for this number, as reported by the channel. - `phone_number: string` The number itself, in display form. - `quality: string` The channel's quality rating for this number, e.g. `green`, `yellow`, `red`. Values are relayed as reported and may grow. - `quality_band: optional "green" or "yellow" or "red"` This service's placed band for the current `quality` token. Absent when the token is empty or this build cannot place it. - `"green"` - `"yellow"` - `"red"` ### Phone Number List - `PhoneNumberList object { data }` The sending numbers visible to this key's brand. - `data: array of PhoneNumber` - `id: string` The number's id — chats pin to it via `phone_number_id`. - `channel_account_id: string` The channel account this number is registered under. Opaque; compare literally and never parse it. - `messaging_tier: string` The channel's messaging-tier token for this number, e.g. `TIER_1K`. Values are relayed as reported and may grow. - `name_status: string` The display-name review state for this number, as reported by the channel. - `phone_number: string` The number itself, in display form. - `quality: string` The channel's quality rating for this number, e.g. `green`, `yellow`, `red`. Values are relayed as reported and may grow. - `quality_band: optional "green" or "yellow" or "red"` This service's placed band for the current `quality` token. Absent when the token is empty or this build cannot place it. - `"green"` - `"yellow"` - `"red"` --- # List phone numbers URL: https://docs.linqapp.com/channel/whatsapp/api/resources/phone_numbers/methods/list/ **get** `/v1/phone_numbers` **The placed quality band is provisional.** It is this service's current reading of the channel's `quality` token published beside it, and may change when the channel vocabulary is settled under V-19. Lists the currently registered sending numbers behind this brand's chats with their live channel health — quality rating, messaging tier, and display-name status. Numbers still moving through registration and numbers already released are not part of this sending inventory. ### Returns - `PhoneNumberList object { data }` The sending numbers visible to this key's brand. - `data: array of PhoneNumber` - `id: string` The number's id — chats pin to it via `phone_number_id`. - `channel_account_id: string` The channel account this number is registered under. Opaque; compare literally and never parse it. - `messaging_tier: string` The channel's messaging-tier token for this number, e.g. `TIER_1K`. Values are relayed as reported and may grow. - `name_status: string` The display-name review state for this number, as reported by the channel. - `phone_number: string` The number itself, in display form. - `quality: string` The channel's quality rating for this number, e.g. `green`, `yellow`, `red`. Values are relayed as reported and may grow. - `quality_band: optional "green" or "yellow" or "red"` This service's placed band for the current `quality` token. Absent when the token is empty or this build cannot place it. - `"green"` - `"yellow"` - `"red"` ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/phone_numbers \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` #### Response ```json { "data": [ { "id": "id", "channel_account_id": "channel_account_id", "messaging_tier": "messaging_tier", "name_status": "name_status", "phone_number": "phone_number", "quality": "quality", "quality_band": "green" } ] } ``` --- # Streams URL: https://docs.linqapp.com/channel/whatsapp/api/resources/streams/ ## Stream events (SSE) **get** `/v1/streams/events` Streams the brand's events as server-sent events, one `data:` frame per event, `id:` carrying the event's cursor. Reconnect with `Last-Event-ID` (or the `cursor` query parameter) to resume after the last position you processed. On read-back surfaces — the transcript, event log, event stream and replays — zero-day messages carry empty `parts` and `zero_retention: true`. Webhook deliveries and the send response carry the content; an idempotent retry of a zero-day send returns empty `parts` and `zero_retention: true`. When ephemeral messages are enabled, expired messages and their related events are omitted, so the stream's `id:` values can have retention gaps. **A frame.** `id:` is the resume cursor and nothing else; `event:` is the event's kind; `data:` is one JSON object `{"id","type","timestamp","data":{...}}` — `id` there is the event's own stable identity (the same value a webhook of it carries, so both sinks deduplicate against one key), and the inner `data` addresses what moved: `chat_id` plus the `seq_from`/`seq_to` range of that chat's event sequence. Read message content and history from `GET /v1/chats/{chat}/events` using that range. Newly recorded chat events also carry `data.customer` and `data.customer_kind`, the chat's values. Kinds today are `message.received`, `message.sent`, `message.delivered`, `message.read`, `message.failed`, `chat.read`, `chat.window.opened` and `template.updated`; the set grows additively, so skip a kind you do not handle rather than failing on it, and expect new members inside `data` too. **Account events.** `template.updated` is about your account, not a chat: its `data` carries no `chat_id` or range. It names the template by `name` and `language` and gives its `category` and `status` after the change, with `previous_category` and `previous_status` before it; both previous members are absent when the template is newly listed (for example one created outside this API). It is sent when a template's `status` or `category` changes, and not for other changes; read `GET /v1/templates` for the rest. It usually follows the change within seconds; a recategorisation, or a change whose notice did not reach us, is found by a periodic re-read and can arrive up to about fifteen minutes later. An `approved` template's `send_schema` can be published after its event, so treat the read as authoritative. An approved template whose variables cannot be addressed by name is reported as `paused`, so its first event reads `pending` to `paused` rather than to `approved`. Your own create is normally not announced, but it MAY be followed by one event with `previous_status: "draft"` when the review answer arrives before the submission is recorded; rely on neither. After a reconnect of your account, each template is announced once more with no previous members. Account events are not delivered to endpoints scoped with `phone_number_ids`, or to webhook endpoints registered with a key that acts in an environment. **One message can produce several events.** An inbound message produces `message.received` and, when it opens the customer window, `chat.window.opened`. Your reply then produces `message.sent` and may later produce `message.delivered`. Do not treat every event as a reason to reply; choose the event kinds that are actual triggers for your integration. The window event can arrive first: a message carrying attachments is recorded once they resolve, so its `chat.window.opened` (the next `seq`) may precede its `message.received`. **Events with attachments.** A `message.received` for a message carrying attachments is recorded, and so takes its log position, once every attachment has been captured or has failed, or ten minutes after the message arrived, whichever comes first. It can therefore appear after events for later messages of the same chat: `seq_from` can decrease relative to arrival. Never discard an event because its `seq_from` is lower than one already received; deduplicate by the event `id`, and order the chat by `seq_from`. For live processing, buffer briefly or reconcile with `GET /v1/chats/{chat}/events`. **Connecting.** Without a cursor the stream starts at the present moment — it does NOT replay history. During ordinary operation, use the account event log to recover missed account events and `GET /v1/chats/{chat}/events` to read chat content. Account-event history has no published minimum retention period yet. The server sends a `retry:` hint on connect and a `: keepalive` comment while idle; neither is an event. There is no scheduled account-event pruning today. If history is no longer available, a cursor older than its retained beginning is refused with HTTP 410 `cursor_expired` (a 2xxx `error.code`, 2032) rather than answered with silence. A cursor beyond the latest committed event is refused with HTTP 422 `invalid_paging` (a 1xxx `error.code`, 1016), while a cursor exactly at the latest event is the ordinary caught-up position. An empty cursor is refused too: omit it to start at the present position. **Cursors are scoped to the brand and the partition selected by the key.** Each partition has its own dense sequence from 1, while that partition is deliberately absent from the wire. If you reconnect at cursor 42 with a key for the other partition, the server answers 200 and resumes at that partition's event 42; `cursor_expired` cannot signal the swap. Keep a separate cursor for each key you use. **A key that acts in an environment cannot open this stream.** It is refused with HTTP 403 `environment_stream_unavailable` (a 2xxx `error.code`, 2055) before anything is read; an environment's events reach you through the webhook endpoints registered under its key. A key that acts in no environment — every key issued before environments existed — streams the events of numbers in none. Events of numbers in an environment share this stream's cursor sequence but are not delivered on it, so the `id:` values you see may skip; resume from the last `id:` you processed, and nothing you are shown is lost. **Webhooks.** The same events are delivered as signed webhooks (Standard Webhooks: `webhook-id`, `webhook-timestamp`, `webhook-signature`, verifiable with any off-the-shelf library). Register a destination for them under `/v1/webhook_endpoints`. ### Query Parameters - `cursor: optional string` Resume cursor — the last event id you processed. Empty and beyond-latest values are refused. The header form wins when both are set. ### Header Parameters - `"Last-Event-ID": optional string` ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/streams/events \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` ## Domain Types ### Stream Events Response - `StreamEventsResponse = string` --- # Stream events (SSE) URL: https://docs.linqapp.com/channel/whatsapp/api/resources/streams/methods/events/ **get** `/v1/streams/events` Streams the brand's events as server-sent events, one `data:` frame per event, `id:` carrying the event's cursor. Reconnect with `Last-Event-ID` (or the `cursor` query parameter) to resume after the last position you processed. On read-back surfaces — the transcript, event log, event stream and replays — zero-day messages carry empty `parts` and `zero_retention: true`. Webhook deliveries and the send response carry the content; an idempotent retry of a zero-day send returns empty `parts` and `zero_retention: true`. When ephemeral messages are enabled, expired messages and their related events are omitted, so the stream's `id:` values can have retention gaps. **A frame.** `id:` is the resume cursor and nothing else; `event:` is the event's kind; `data:` is one JSON object `{"id","type","timestamp","data":{...}}` — `id` there is the event's own stable identity (the same value a webhook of it carries, so both sinks deduplicate against one key), and the inner `data` addresses what moved: `chat_id` plus the `seq_from`/`seq_to` range of that chat's event sequence. Read message content and history from `GET /v1/chats/{chat}/events` using that range. Newly recorded chat events also carry `data.customer` and `data.customer_kind`, the chat's values. Kinds today are `message.received`, `message.sent`, `message.delivered`, `message.read`, `message.failed`, `chat.read`, `chat.window.opened` and `template.updated`; the set grows additively, so skip a kind you do not handle rather than failing on it, and expect new members inside `data` too. **Account events.** `template.updated` is about your account, not a chat: its `data` carries no `chat_id` or range. It names the template by `name` and `language` and gives its `category` and `status` after the change, with `previous_category` and `previous_status` before it; both previous members are absent when the template is newly listed (for example one created outside this API). It is sent when a template's `status` or `category` changes, and not for other changes; read `GET /v1/templates` for the rest. It usually follows the change within seconds; a recategorisation, or a change whose notice did not reach us, is found by a periodic re-read and can arrive up to about fifteen minutes later. An `approved` template's `send_schema` can be published after its event, so treat the read as authoritative. An approved template whose variables cannot be addressed by name is reported as `paused`, so its first event reads `pending` to `paused` rather than to `approved`. Your own create is normally not announced, but it MAY be followed by one event with `previous_status: "draft"` when the review answer arrives before the submission is recorded; rely on neither. After a reconnect of your account, each template is announced once more with no previous members. Account events are not delivered to endpoints scoped with `phone_number_ids`, or to webhook endpoints registered with a key that acts in an environment. **One message can produce several events.** An inbound message produces `message.received` and, when it opens the customer window, `chat.window.opened`. Your reply then produces `message.sent` and may later produce `message.delivered`. Do not treat every event as a reason to reply; choose the event kinds that are actual triggers for your integration. The window event can arrive first: a message carrying attachments is recorded once they resolve, so its `chat.window.opened` (the next `seq`) may precede its `message.received`. **Events with attachments.** A `message.received` for a message carrying attachments is recorded, and so takes its log position, once every attachment has been captured or has failed, or ten minutes after the message arrived, whichever comes first. It can therefore appear after events for later messages of the same chat: `seq_from` can decrease relative to arrival. Never discard an event because its `seq_from` is lower than one already received; deduplicate by the event `id`, and order the chat by `seq_from`. For live processing, buffer briefly or reconcile with `GET /v1/chats/{chat}/events`. **Connecting.** Without a cursor the stream starts at the present moment — it does NOT replay history. During ordinary operation, use the account event log to recover missed account events and `GET /v1/chats/{chat}/events` to read chat content. Account-event history has no published minimum retention period yet. The server sends a `retry:` hint on connect and a `: keepalive` comment while idle; neither is an event. There is no scheduled account-event pruning today. If history is no longer available, a cursor older than its retained beginning is refused with HTTP 410 `cursor_expired` (a 2xxx `error.code`, 2032) rather than answered with silence. A cursor beyond the latest committed event is refused with HTTP 422 `invalid_paging` (a 1xxx `error.code`, 1016), while a cursor exactly at the latest event is the ordinary caught-up position. An empty cursor is refused too: omit it to start at the present position. **Cursors are scoped to the brand and the partition selected by the key.** Each partition has its own dense sequence from 1, while that partition is deliberately absent from the wire. If you reconnect at cursor 42 with a key for the other partition, the server answers 200 and resumes at that partition's event 42; `cursor_expired` cannot signal the swap. Keep a separate cursor for each key you use. **A key that acts in an environment cannot open this stream.** It is refused with HTTP 403 `environment_stream_unavailable` (a 2xxx `error.code`, 2055) before anything is read; an environment's events reach you through the webhook endpoints registered under its key. A key that acts in no environment — every key issued before environments existed — streams the events of numbers in none. Events of numbers in an environment share this stream's cursor sequence but are not delivered on it, so the `id:` values you see may skip; resume from the last `id:` you processed, and nothing you are shown is lost. **Webhooks.** The same events are delivered as signed webhooks (Standard Webhooks: `webhook-id`, `webhook-timestamp`, `webhook-signature`, verifiable with any off-the-shelf library). Register a destination for them under `/v1/webhook_endpoints`. ### Query Parameters - `cursor: optional string` Resume cursor — the last event id you processed. Empty and beyond-latest values are refused. The header form wins when both are set. ### Header Parameters - `"Last-Event-ID": optional string` ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/streams/events \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` --- # Templates URL: https://docs.linqapp.com/channel/whatsapp/api/resources/templates/ ## Register a template **post** `/v1/templates` Registers a template and submits it for review, synchronously. The call returns once the channel has accepted the submission, so a name or a body it refuses is a `422` you read immediately rather than a silence you discover later. What comes back is almost always `status: "pending"`. Review time varies: templates have been approved in minutes and, in other cases, over several days. A `template.updated` event on the event stream and your webhooks reports each change of `status` or `category`, so you need not poll; `GET /v1/templates` stays the authority to reconcile against. **Nothing is sendable until it is `approved`**. After approval the `send_schema` is published on the registry's next read-back, up to about fifteen minutes later; until then a send is refused with `template_not_sendable` pointing at the template. The `category` on the approved template is the one review assigned and can differ from the one you submitted; read it back, since it determines pricing and whether marketing delivery rules apply. Status is never ours to assert. An approved template can be paused later for quality and approved again afterwards, and this API reports what the channel currently says rather than what it said at submission. A refusal decided before any submission attempt records nothing, and its message says so: the name remains reusable. Once a submission is attempted, its evidence remains visible as `status: "draft"` with the derived parameter schema even if the attempt is refused or its answer is lost. A definitive refusal leaves the name reusable after correction; an unknown outcome permanently fences the name and must not be retried. This ordering prevents an accepted template from becoming invisible here. A name that is already registered beyond draft answers `409` — submitted names are permanent. An account with no messaging channel answers retryable HTTP 503 `no_channel_account` with a 3xxx `error.code`, not a validation error. It carries no `Retry-After` because setup has no honest completion time to publish. An invalid channel credential likewise answers HTTP 503 `template_channel_unavailable` with a 3xxx `error.code`, not 422 `template_refused`: rotating that credential is this service's repair, not a change to the template. It carries no `Retry-After` because rotation is an operator action rather than a clock boundary. Media-header preparation is bounded and resumable. While the same request is actively preparing, HTTP 503 `template_submission_in_progress` (a 3xxx `error.code`, 3021) asks you to retry the unchanged body. Exhausted preparation answers HTTP 503 `template_asset_unavailable` (a 3xxx `error.code`, 3011). Once the template-create call may have reached the channel but its answer is unknown, HTTP 409 `template_outcome_indeterminate` (a 2xxx `error.code`, 2039) is permanent: do not resubmit that name; registry reconciliation must establish the outcome. HTTP 201 is returned only after the channel accepted the template submission. ### Body Parameters - `category: string` `utility`, `marketing` or `authentication`. The channel may RECATEGORISE on review — copy that reads as marketing is treated as marketing whatever was requested — and the assigned category is what the send is priced at. Read `category` back off the response and off `GET /v1/templates`. An `authentication` template renders a fixed one-time-code layout and cannot carry a `carousel`; the pair is refused with a fault at `/carousel` before anything is recorded. - `language: string` The locale this variant is written in, such as `en_US`. One template name may have several language variants, each registered separately. The `x-template-languages` list documents upstream-supported values as of its verification date; this service accepts any well-formed code so a newly supported locale is not refused here. - `name: string` Lowercase letters, digits and underscores. Permanent once submitted: a name cannot be reused for different copy. - `authentication: optional object { otp_type, add_security_recommendation, autofill_text, 6 more }` Selects the fixed-copy authentication specialization. Valid only when `category` is `authentication`; omit to retain ordinary body authoring. - `otp_type: "copy_code" or "one_tap" or "zero_tap"` `copy_code` works on every client. `one_tap` and `zero_tap` are Android app integrations and require both app identity fields. - `"copy_code"` - `"one_tap"` - `"zero_tap"` - `add_security_recommendation: optional boolean` Include the channel's localized security recommendation. - `autofill_text: optional string` Localized Android one-tap button label, maximum 25 characters. - `code_expiration_minutes: optional number` Show the localized code-expiry footer. Whole minutes from 1 through 90. - `copy_code_text: optional string` Localized fallback copy-button label, maximum 25 characters. - `message_send_ttl_seconds: optional number` Stop attempting delivery after this many seconds. Authentication templates accept 30 through 900. - `package_name: optional string` Android application package name. Required for `one_tap` and `zero_tap`; omit for `copy_code`. - `signature_hash: optional string` Android app signing-key hash. Required for `one_tap` and `zero_tap`; omit for `copy_code`. - `zero_tap_terms_accepted: optional boolean` Must be true for `zero_tap`; omit for the other subtypes. - `body: optional object { text, examples }` The ordinary authoring body. Required unless `authentication` is supplied; specialized authentication templates omit it because their localized body is fixed. - `text: string` The message copy. Use `{{name}}` for each variable — lowercase letters, digits and underscores, the same names a `template` part supplies values for. Numbered placeholders such as `{{1}}` are refused: this API addresses template variables by name. At most 32 distinct placeholders may appear; a larger set is refused at this field. - `examples: optional unknown` One example value per variable, keyed by variable name. **Required for every variable the copy uses** — the channel refuses a template whose variables carry no examples, and reviewers read the examples to decide. Omit it entirely when the copy has no variables. Each value is 1–1024 characters, may not be whitespace-only, and may not contain a line break, a tab, or four consecutive spaces, because a parameter value carries the same published rules at send time. - `buttons: optional array of object { text, example, type, url }` Buttons for an ordinary template: `url` buttons (fixed, or ending in the send-time variable `{{1}}`) and `quick_reply` buttons. Up to 10 in total, at most two `url`, and the quick replies adjacent to one another. Labels and fixed destinations are baked into the reviewed template; a dynamic destination and every quick reply become slots the approved template's `send_schema` requires on `buttons[]`. - `text: string` Visible label, maximum 25 characters. - `example: optional string` Required exactly when `url` ends in `{{1}}`: a sample VALUE for that variable, reviewed with the template. Refused on a fixed destination and on a `quick_reply` button. - `type: optional "url" or "quick_reply"` `url` (the default when omitted) or `quick_reply`. - `"url"` - `"quick_reply"` - `url: optional string` For a `url` button: the HTTPS destination, at most 2000 characters. It may end in exactly `{{1}}` — `https://example.com/jobs/{{1}}` — and nothing else in it may vary; the value is appended at send, verbatim, so percent-encode it yourself. Refused on a `quick_reply` button. - `carousel: optional object { cards }` Optional media-card carousel definition. All 2–10 cards must use the same media kind, body presence, and ordered button-type sequence. A carousel template is the `body` plus its cards: it cannot be combined with `footer`, `media_header` or `buttons`. Valid only when `category` is `marketing` or `utility`: an authentication template renders a fixed one-time-code layout with no card slot, so the pair is refused with a fault at `/carousel` before anything is recorded rather than created without its cards. - `cards: array of object { media, body, buttons }` - `media: object { asset_handle, kind }` - `asset_handle: string` The asset handle returned by the channel's template-authoring upload flow. This is neither this API's upload_ref nor an inbound media_id. - `kind: "image" or "video"` - `"image"` - `"video"` - `body: optional object { text, examples }` The body copy of a template, with `{{variable}}` placeholders for the parts that change per send. - `text: string` The message copy. Use `{{name}}` for each variable — lowercase letters, digits and underscores, the same names a `template` part supplies values for. Numbered placeholders such as `{{1}}` are refused: this API addresses template variables by name. At most 32 distinct placeholders may appear; a larger set is refused at this field. - `examples: optional unknown` One example value per variable, keyed by variable name. **Required for every variable the copy uses** — the channel refuses a template whose variables carry no examples, and reviewers read the examples to decide. Omit it entirely when the copy has no variables. Each value is 1–1024 characters, may not be whitespace-only, and may not contain a line break, a tab, or four consecutive spaces, because a parameter value carries the same published rules at send time. - `buttons: optional array of object { text, type, phone_number, url }` - `text: string` - `type: "quick_reply" or "phone_number" or "url"` - `"quick_reply"` - `"phone_number"` - `"url"` - `phone_number: optional string` - `url: optional string` - `footer: optional string` An optional footer line for an ordinary template. Takes no variables. It cannot be combined with `carousel`: a carousel bubble is the body plus its cards and has no footer, so the pair is refused with a fault at `/footer` before anything is recorded and the name remains reusable. - `media_header: optional object { kind, upload_ref }` Optional image, video, or document header for an ordinary template. The referenced bytes are uploaded for template review as part of this submission. It cannot be combined with `authentication` or `carousel`. - `kind: "image" or "video" or "document"` The media shape reviewed with this template. - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by `POST /v1/media` for this account and key mode. Template authoring accepts JPEG, PNG, MP4, and PDF up to 5 MiB for every kind. This is this API's conservative authoring limit. The `upload_ref` follows the media route's documented retention posture and is not permanent. ### Returns - `Template object { category, created_at, language, 9 more }` One registered message template in any status, with the parameters it takes. A template is identified by its `name` and `language` together — that is the pair a `template` part names, and the pair this API addresses it by. There is no separate template id. - `category: string` `utility`, `marketing` or `authentication` — the category review ASSIGNED, which can differ from the one submitted — read it back after approval, since it determines pricing and whether marketing delivery rules apply. Values grow additively. - `created_at: string` - `language: string` The locale this variant is written in, such as `en_US`. - `name: string` Lowercase letters, digits and underscores. Permanent once submitted. - `parameters: unknown` The variables this template takes, as a JSON Schema (2020-12) object — ready to hand to a model verbatim as a tool schema. Every property is a string and every one is required: the channel substitutes all of them. Each property publishes `minLength`, `maxLength` and `pattern` alongside its example, so a model sees the same value rules the send path enforces: values are 1–1024 characters, not whitespace-only, and contain no line break, tab or run of four spaces. An `authentication` template takes exactly one parameter, `code`: the one-time code the message delivers, 1–15 characters. You generate the code; it is shown in the message body and is what the code button copies or fills in. A longer value is refused, never shortened. The `{{1}}` in such a template's `content.body` is where that code appears. An empty `properties` object means the template takes no variables. `null` means something different and specific: this template's variables cannot be addressed by name over this API (they are positional, or they live in a part of the template this API does not read yet). A `template` part naming such a template cannot supply its variables. - `quality: string` The channel's quality signal for this template, when it has one. `null` until it does. Free text; treat an unknown value as no signal. - `rejected_reason: string` Why the template was refused or held, when the channel said. Free text for a human; the wording is not stable and must not be branched on. `null` when there is nothing to say. - `send_schema: unknown` The complete schema for the `template` part that sends this exact template, including its fixed identity, named parameters, media header, and carousel values. After approval it is published on the registry's next read-back, up to about fifteen minutes later; until then it is `null` and a send is refused with `template_not_sendable` pointing at the template. `null` otherwise means this template cannot be addressed safely through this API. - `status: string` Where this template stands. Only `approved` may be sent. `draft` — a submission attempt has not produced a registered template. Consult `retry_allowed`; draft status alone never permits resubmission. `pending` — under review. Review time varies: templates have been approved in minutes and, in other cases, over several days. A `template.updated` event reports each change of `status` or `category`; this read remains the authority to reconcile against. `approved` — sendable. After approval, `send_schema` is published on the registry's next read-back, up to about fifteen minutes later. `rejected` — refused; `rejected_reason` may say why. `paused` — was approved and is currently held, usually for quality. Not terminal: it can become `approved` again without you doing anything. `disabled` — no longer usable. Values grow additively, and anything you do not recognise is not sendable. - `updated_at: string` When this template's registry facts last changed. An unchanged channel reconciliation does not move it. - `content: optional object { body, buttons, carousel, 2 more }` Human-readable copy and fixed actions in a registered template. - `body: optional string` - `buttons: optional array of object { type, phone_number, text, url }` - `type: string` The action kind; values grow additively. `one_time_code` is an authentication template's code button: it copies or fills in the code each send supplies as the `code` parameter, carries no `url`, and has no send-time slot of its own. - `phone_number: optional string` A fixed telephone destination baked into the template, when present. - `text: optional string` The label shown to the recipient, when the channel supplies one. - `url: optional string` The destination baked into the template, when present. A `url` button's destination may end in `{{1}}`, the variable each send fills. - `carousel: optional array of object { body, buttons, header }` - `body: optional string` - `buttons: optional array of object { type, phone_number, text, url }` - `type: string` The action kind; values grow additively. `one_time_code` is an authentication template's code button: it copies or fills in the code each send supplies as the `code` parameter, carries no `url`, and has no send-time slot of its own. - `phone_number: optional string` A fixed telephone destination baked into the template, when present. - `text: optional string` The label shown to the recipient, when the channel supplies one. - `url: optional string` The destination baked into the template, when present. A `url` button's destination may end in `{{1}}`, the variable each send fills. - `header: optional object { kind, text }` A media or text header as it will appear to the recipient. - `kind: string` `text`, `image`, `video`, or `document`; values grow additively. - `text: optional string` Fixed header copy. Omitted for media headers. - `footer: optional string` - `header: optional object { kind, text }` A media or text header as it will appear to the recipient. - `kind: string` `text`, `image`, `video`, or `document`; values grow additively. - `text: optional string` Fixed header copy. Omitted for media headers. - `retry_allowed: optional boolean` Whether another submission using this draft's name and language is currently allowed. A corrected definition may be required. Present on all responses from current servers. Clients must not offer retry unless this is explicitly `true`. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/templates \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" \ -d '{ "category": "category", "language": "language", "name": "name" }' ``` #### Response ```json { "category": "category", "created_at": "2019-12-27T18:11:19.117Z", "language": "language", "name": "name", "parameters": {}, "quality": "quality", "rejected_reason": "rejected_reason", "send_schema": {}, "status": "status", "updated_at": "2019-12-27T18:11:19.117Z", "content": { "body": "body", "buttons": [ { "type": "type", "phone_number": "phone_number", "text": "text", "url": "url" } ], "carousel": [ { "body": "body", "buttons": [ { "type": "type", "phone_number": "phone_number", "text": "text", "url": "url" } ], "header": { "kind": "kind", "text": "text" } } ], "footer": "footer", "header": { "kind": "kind", "text": "text" } }, "retry_allowed": true } ``` ## List templates **get** `/v1/templates` Lists the templates registered for this key's account, newest first, with the parameter schema each one takes. This is the read a `422 outside_customer_window` points you at: outside a customer's service window only an approved `template` part sends, and this is where the sendable ones and their variables are. It is also the read to hand an agent — `parameters` is a JSON Schema shaped to be used verbatim as a tool definition. Templates in every status are listed, including ones that are not sendable, so a pause or a rejection is visible rather than looking like a template that vanished. Filter on `status == "approved"` and a non-null `send_schema` for the sendable set: an approved template is sendable once the registry has read it back and published its `send_schema`. ### Query Parameters - `cursor: optional string` A `next_cursor` from a previous page. Omit for the first page. - `limit: optional number` How many templates to return, 1–100. Defaults to 100. A value outside the range is refused rather than clamped. ### Returns - `TemplatePage object { data, has_more, next_cursor }` One page of templates, newest first. - `data: array of Template` - `category: string` `utility`, `marketing` or `authentication` — the category review ASSIGNED, which can differ from the one submitted — read it back after approval, since it determines pricing and whether marketing delivery rules apply. Values grow additively. - `created_at: string` - `language: string` The locale this variant is written in, such as `en_US`. - `name: string` Lowercase letters, digits and underscores. Permanent once submitted. - `parameters: unknown` The variables this template takes, as a JSON Schema (2020-12) object — ready to hand to a model verbatim as a tool schema. Every property is a string and every one is required: the channel substitutes all of them. Each property publishes `minLength`, `maxLength` and `pattern` alongside its example, so a model sees the same value rules the send path enforces: values are 1–1024 characters, not whitespace-only, and contain no line break, tab or run of four spaces. An `authentication` template takes exactly one parameter, `code`: the one-time code the message delivers, 1–15 characters. You generate the code; it is shown in the message body and is what the code button copies or fills in. A longer value is refused, never shortened. The `{{1}}` in such a template's `content.body` is where that code appears. An empty `properties` object means the template takes no variables. `null` means something different and specific: this template's variables cannot be addressed by name over this API (they are positional, or they live in a part of the template this API does not read yet). A `template` part naming such a template cannot supply its variables. - `quality: string` The channel's quality signal for this template, when it has one. `null` until it does. Free text; treat an unknown value as no signal. - `rejected_reason: string` Why the template was refused or held, when the channel said. Free text for a human; the wording is not stable and must not be branched on. `null` when there is nothing to say. - `send_schema: unknown` The complete schema for the `template` part that sends this exact template, including its fixed identity, named parameters, media header, and carousel values. After approval it is published on the registry's next read-back, up to about fifteen minutes later; until then it is `null` and a send is refused with `template_not_sendable` pointing at the template. `null` otherwise means this template cannot be addressed safely through this API. - `status: string` Where this template stands. Only `approved` may be sent. `draft` — a submission attempt has not produced a registered template. Consult `retry_allowed`; draft status alone never permits resubmission. `pending` — under review. Review time varies: templates have been approved in minutes and, in other cases, over several days. A `template.updated` event reports each change of `status` or `category`; this read remains the authority to reconcile against. `approved` — sendable. After approval, `send_schema` is published on the registry's next read-back, up to about fifteen minutes later. `rejected` — refused; `rejected_reason` may say why. `paused` — was approved and is currently held, usually for quality. Not terminal: it can become `approved` again without you doing anything. `disabled` — no longer usable. Values grow additively, and anything you do not recognise is not sendable. - `updated_at: string` When this template's registry facts last changed. An unchanged channel reconciliation does not move it. - `content: optional object { body, buttons, carousel, 2 more }` Human-readable copy and fixed actions in a registered template. - `body: optional string` - `buttons: optional array of object { type, phone_number, text, url }` - `type: string` The action kind; values grow additively. `one_time_code` is an authentication template's code button: it copies or fills in the code each send supplies as the `code` parameter, carries no `url`, and has no send-time slot of its own. - `phone_number: optional string` A fixed telephone destination baked into the template, when present. - `text: optional string` The label shown to the recipient, when the channel supplies one. - `url: optional string` The destination baked into the template, when present. A `url` button's destination may end in `{{1}}`, the variable each send fills. - `carousel: optional array of object { body, buttons, header }` - `body: optional string` - `buttons: optional array of object { type, phone_number, text, url }` - `type: string` The action kind; values grow additively. `one_time_code` is an authentication template's code button: it copies or fills in the code each send supplies as the `code` parameter, carries no `url`, and has no send-time slot of its own. - `phone_number: optional string` A fixed telephone destination baked into the template, when present. - `text: optional string` The label shown to the recipient, when the channel supplies one. - `url: optional string` The destination baked into the template, when present. A `url` button's destination may end in `{{1}}`, the variable each send fills. - `header: optional object { kind, text }` A media or text header as it will appear to the recipient. - `kind: string` `text`, `image`, `video`, or `document`; values grow additively. - `text: optional string` Fixed header copy. Omitted for media headers. - `footer: optional string` - `header: optional object { kind, text }` A media or text header as it will appear to the recipient. - `kind: string` `text`, `image`, `video`, or `document`; values grow additively. - `text: optional string` Fixed header copy. Omitted for media headers. - `retry_allowed: optional boolean` Whether another submission using this draft's name and language is currently allowed. A corrected definition may be required. Present on all responses from current servers. Clients must not offer retry unless this is explicitly `true`. - `has_more: boolean` True when another page follows. - `next_cursor: optional string` Pass as `cursor` to read the next page. Present only when `has_more` is true. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/templates \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` #### Response ```json { "data": [ { "category": "category", "created_at": "2019-12-27T18:11:19.117Z", "language": "language", "name": "name", "parameters": {}, "quality": "quality", "rejected_reason": "rejected_reason", "send_schema": {}, "status": "status", "updated_at": "2019-12-27T18:11:19.117Z", "content": { "body": "body", "buttons": [ { "type": "type", "phone_number": "phone_number", "text": "text", "url": "url" } ], "carousel": [ { "body": "body", "buttons": [ { "type": "type", "phone_number": "phone_number", "text": "text", "url": "url" } ], "header": { "kind": "kind", "text": "text" } } ], "footer": "footer", "header": { "kind": "kind", "text": "text" } }, "retry_allowed": true } ], "has_more": true, "next_cursor": "next_cursor" } ``` ## Domain Types ### Template - `Template object { category, created_at, language, 9 more }` One registered message template in any status, with the parameters it takes. A template is identified by its `name` and `language` together — that is the pair a `template` part names, and the pair this API addresses it by. There is no separate template id. - `category: string` `utility`, `marketing` or `authentication` — the category review ASSIGNED, which can differ from the one submitted — read it back after approval, since it determines pricing and whether marketing delivery rules apply. Values grow additively. - `created_at: string` - `language: string` The locale this variant is written in, such as `en_US`. - `name: string` Lowercase letters, digits and underscores. Permanent once submitted. - `parameters: unknown` The variables this template takes, as a JSON Schema (2020-12) object — ready to hand to a model verbatim as a tool schema. Every property is a string and every one is required: the channel substitutes all of them. Each property publishes `minLength`, `maxLength` and `pattern` alongside its example, so a model sees the same value rules the send path enforces: values are 1–1024 characters, not whitespace-only, and contain no line break, tab or run of four spaces. An `authentication` template takes exactly one parameter, `code`: the one-time code the message delivers, 1–15 characters. You generate the code; it is shown in the message body and is what the code button copies or fills in. A longer value is refused, never shortened. The `{{1}}` in such a template's `content.body` is where that code appears. An empty `properties` object means the template takes no variables. `null` means something different and specific: this template's variables cannot be addressed by name over this API (they are positional, or they live in a part of the template this API does not read yet). A `template` part naming such a template cannot supply its variables. - `quality: string` The channel's quality signal for this template, when it has one. `null` until it does. Free text; treat an unknown value as no signal. - `rejected_reason: string` Why the template was refused or held, when the channel said. Free text for a human; the wording is not stable and must not be branched on. `null` when there is nothing to say. - `send_schema: unknown` The complete schema for the `template` part that sends this exact template, including its fixed identity, named parameters, media header, and carousel values. After approval it is published on the registry's next read-back, up to about fifteen minutes later; until then it is `null` and a send is refused with `template_not_sendable` pointing at the template. `null` otherwise means this template cannot be addressed safely through this API. - `status: string` Where this template stands. Only `approved` may be sent. `draft` — a submission attempt has not produced a registered template. Consult `retry_allowed`; draft status alone never permits resubmission. `pending` — under review. Review time varies: templates have been approved in minutes and, in other cases, over several days. A `template.updated` event reports each change of `status` or `category`; this read remains the authority to reconcile against. `approved` — sendable. After approval, `send_schema` is published on the registry's next read-back, up to about fifteen minutes later. `rejected` — refused; `rejected_reason` may say why. `paused` — was approved and is currently held, usually for quality. Not terminal: it can become `approved` again without you doing anything. `disabled` — no longer usable. Values grow additively, and anything you do not recognise is not sendable. - `updated_at: string` When this template's registry facts last changed. An unchanged channel reconciliation does not move it. - `content: optional object { body, buttons, carousel, 2 more }` Human-readable copy and fixed actions in a registered template. - `body: optional string` - `buttons: optional array of object { type, phone_number, text, url }` - `type: string` The action kind; values grow additively. `one_time_code` is an authentication template's code button: it copies or fills in the code each send supplies as the `code` parameter, carries no `url`, and has no send-time slot of its own. - `phone_number: optional string` A fixed telephone destination baked into the template, when present. - `text: optional string` The label shown to the recipient, when the channel supplies one. - `url: optional string` The destination baked into the template, when present. A `url` button's destination may end in `{{1}}`, the variable each send fills. - `carousel: optional array of object { body, buttons, header }` - `body: optional string` - `buttons: optional array of object { type, phone_number, text, url }` - `type: string` The action kind; values grow additively. `one_time_code` is an authentication template's code button: it copies or fills in the code each send supplies as the `code` parameter, carries no `url`, and has no send-time slot of its own. - `phone_number: optional string` A fixed telephone destination baked into the template, when present. - `text: optional string` The label shown to the recipient, when the channel supplies one. - `url: optional string` The destination baked into the template, when present. A `url` button's destination may end in `{{1}}`, the variable each send fills. - `header: optional object { kind, text }` A media or text header as it will appear to the recipient. - `kind: string` `text`, `image`, `video`, or `document`; values grow additively. - `text: optional string` Fixed header copy. Omitted for media headers. - `footer: optional string` - `header: optional object { kind, text }` A media or text header as it will appear to the recipient. - `kind: string` `text`, `image`, `video`, or `document`; values grow additively. - `text: optional string` Fixed header copy. Omitted for media headers. - `retry_allowed: optional boolean` Whether another submission using this draft's name and language is currently allowed. A corrected definition may be required. Present on all responses from current servers. Clients must not offer retry unless this is explicitly `true`. ### Template Page - `TemplatePage object { data, has_more, next_cursor }` One page of templates, newest first. - `data: array of Template` - `category: string` `utility`, `marketing` or `authentication` — the category review ASSIGNED, which can differ from the one submitted — read it back after approval, since it determines pricing and whether marketing delivery rules apply. Values grow additively. - `created_at: string` - `language: string` The locale this variant is written in, such as `en_US`. - `name: string` Lowercase letters, digits and underscores. Permanent once submitted. - `parameters: unknown` The variables this template takes, as a JSON Schema (2020-12) object — ready to hand to a model verbatim as a tool schema. Every property is a string and every one is required: the channel substitutes all of them. Each property publishes `minLength`, `maxLength` and `pattern` alongside its example, so a model sees the same value rules the send path enforces: values are 1–1024 characters, not whitespace-only, and contain no line break, tab or run of four spaces. An `authentication` template takes exactly one parameter, `code`: the one-time code the message delivers, 1–15 characters. You generate the code; it is shown in the message body and is what the code button copies or fills in. A longer value is refused, never shortened. The `{{1}}` in such a template's `content.body` is where that code appears. An empty `properties` object means the template takes no variables. `null` means something different and specific: this template's variables cannot be addressed by name over this API (they are positional, or they live in a part of the template this API does not read yet). A `template` part naming such a template cannot supply its variables. - `quality: string` The channel's quality signal for this template, when it has one. `null` until it does. Free text; treat an unknown value as no signal. - `rejected_reason: string` Why the template was refused or held, when the channel said. Free text for a human; the wording is not stable and must not be branched on. `null` when there is nothing to say. - `send_schema: unknown` The complete schema for the `template` part that sends this exact template, including its fixed identity, named parameters, media header, and carousel values. After approval it is published on the registry's next read-back, up to about fifteen minutes later; until then it is `null` and a send is refused with `template_not_sendable` pointing at the template. `null` otherwise means this template cannot be addressed safely through this API. - `status: string` Where this template stands. Only `approved` may be sent. `draft` — a submission attempt has not produced a registered template. Consult `retry_allowed`; draft status alone never permits resubmission. `pending` — under review. Review time varies: templates have been approved in minutes and, in other cases, over several days. A `template.updated` event reports each change of `status` or `category`; this read remains the authority to reconcile against. `approved` — sendable. After approval, `send_schema` is published on the registry's next read-back, up to about fifteen minutes later. `rejected` — refused; `rejected_reason` may say why. `paused` — was approved and is currently held, usually for quality. Not terminal: it can become `approved` again without you doing anything. `disabled` — no longer usable. Values grow additively, and anything you do not recognise is not sendable. - `updated_at: string` When this template's registry facts last changed. An unchanged channel reconciliation does not move it. - `content: optional object { body, buttons, carousel, 2 more }` Human-readable copy and fixed actions in a registered template. - `body: optional string` - `buttons: optional array of object { type, phone_number, text, url }` - `type: string` The action kind; values grow additively. `one_time_code` is an authentication template's code button: it copies or fills in the code each send supplies as the `code` parameter, carries no `url`, and has no send-time slot of its own. - `phone_number: optional string` A fixed telephone destination baked into the template, when present. - `text: optional string` The label shown to the recipient, when the channel supplies one. - `url: optional string` The destination baked into the template, when present. A `url` button's destination may end in `{{1}}`, the variable each send fills. - `carousel: optional array of object { body, buttons, header }` - `body: optional string` - `buttons: optional array of object { type, phone_number, text, url }` - `type: string` The action kind; values grow additively. `one_time_code` is an authentication template's code button: it copies or fills in the code each send supplies as the `code` parameter, carries no `url`, and has no send-time slot of its own. - `phone_number: optional string` A fixed telephone destination baked into the template, when present. - `text: optional string` The label shown to the recipient, when the channel supplies one. - `url: optional string` The destination baked into the template, when present. A `url` button's destination may end in `{{1}}`, the variable each send fills. - `header: optional object { kind, text }` A media or text header as it will appear to the recipient. - `kind: string` `text`, `image`, `video`, or `document`; values grow additively. - `text: optional string` Fixed header copy. Omitted for media headers. - `footer: optional string` - `header: optional object { kind, text }` A media or text header as it will appear to the recipient. - `kind: string` `text`, `image`, `video`, or `document`; values grow additively. - `text: optional string` Fixed header copy. Omitted for media headers. - `retry_allowed: optional boolean` Whether another submission using this draft's name and language is currently allowed. A corrected definition may be required. Present on all responses from current servers. Clients must not offer retry unless this is explicitly `true`. - `has_more: boolean` True when another page follows. - `next_cursor: optional string` Pass as `cursor` to read the next page. Present only when `has_more` is true. --- # Register a template URL: https://docs.linqapp.com/channel/whatsapp/api/resources/templates/methods/create/ **post** `/v1/templates` Registers a template and submits it for review, synchronously. The call returns once the channel has accepted the submission, so a name or a body it refuses is a `422` you read immediately rather than a silence you discover later. What comes back is almost always `status: "pending"`. Review time varies: templates have been approved in minutes and, in other cases, over several days. A `template.updated` event on the event stream and your webhooks reports each change of `status` or `category`, so you need not poll; `GET /v1/templates` stays the authority to reconcile against. **Nothing is sendable until it is `approved`**. After approval the `send_schema` is published on the registry's next read-back, up to about fifteen minutes later; until then a send is refused with `template_not_sendable` pointing at the template. The `category` on the approved template is the one review assigned and can differ from the one you submitted; read it back, since it determines pricing and whether marketing delivery rules apply. Status is never ours to assert. An approved template can be paused later for quality and approved again afterwards, and this API reports what the channel currently says rather than what it said at submission. A refusal decided before any submission attempt records nothing, and its message says so: the name remains reusable. Once a submission is attempted, its evidence remains visible as `status: "draft"` with the derived parameter schema even if the attempt is refused or its answer is lost. A definitive refusal leaves the name reusable after correction; an unknown outcome permanently fences the name and must not be retried. This ordering prevents an accepted template from becoming invisible here. A name that is already registered beyond draft answers `409` — submitted names are permanent. An account with no messaging channel answers retryable HTTP 503 `no_channel_account` with a 3xxx `error.code`, not a validation error. It carries no `Retry-After` because setup has no honest completion time to publish. An invalid channel credential likewise answers HTTP 503 `template_channel_unavailable` with a 3xxx `error.code`, not 422 `template_refused`: rotating that credential is this service's repair, not a change to the template. It carries no `Retry-After` because rotation is an operator action rather than a clock boundary. Media-header preparation is bounded and resumable. While the same request is actively preparing, HTTP 503 `template_submission_in_progress` (a 3xxx `error.code`, 3021) asks you to retry the unchanged body. Exhausted preparation answers HTTP 503 `template_asset_unavailable` (a 3xxx `error.code`, 3011). Once the template-create call may have reached the channel but its answer is unknown, HTTP 409 `template_outcome_indeterminate` (a 2xxx `error.code`, 2039) is permanent: do not resubmit that name; registry reconciliation must establish the outcome. HTTP 201 is returned only after the channel accepted the template submission. ### Body Parameters - `category: string` `utility`, `marketing` or `authentication`. The channel may RECATEGORISE on review — copy that reads as marketing is treated as marketing whatever was requested — and the assigned category is what the send is priced at. Read `category` back off the response and off `GET /v1/templates`. An `authentication` template renders a fixed one-time-code layout and cannot carry a `carousel`; the pair is refused with a fault at `/carousel` before anything is recorded. - `language: string` The locale this variant is written in, such as `en_US`. One template name may have several language variants, each registered separately. The `x-template-languages` list documents upstream-supported values as of its verification date; this service accepts any well-formed code so a newly supported locale is not refused here. - `name: string` Lowercase letters, digits and underscores. Permanent once submitted: a name cannot be reused for different copy. - `authentication: optional object { otp_type, add_security_recommendation, autofill_text, 6 more }` Selects the fixed-copy authentication specialization. Valid only when `category` is `authentication`; omit to retain ordinary body authoring. - `otp_type: "copy_code" or "one_tap" or "zero_tap"` `copy_code` works on every client. `one_tap` and `zero_tap` are Android app integrations and require both app identity fields. - `"copy_code"` - `"one_tap"` - `"zero_tap"` - `add_security_recommendation: optional boolean` Include the channel's localized security recommendation. - `autofill_text: optional string` Localized Android one-tap button label, maximum 25 characters. - `code_expiration_minutes: optional number` Show the localized code-expiry footer. Whole minutes from 1 through 90. - `copy_code_text: optional string` Localized fallback copy-button label, maximum 25 characters. - `message_send_ttl_seconds: optional number` Stop attempting delivery after this many seconds. Authentication templates accept 30 through 900. - `package_name: optional string` Android application package name. Required for `one_tap` and `zero_tap`; omit for `copy_code`. - `signature_hash: optional string` Android app signing-key hash. Required for `one_tap` and `zero_tap`; omit for `copy_code`. - `zero_tap_terms_accepted: optional boolean` Must be true for `zero_tap`; omit for the other subtypes. - `body: optional object { text, examples }` The ordinary authoring body. Required unless `authentication` is supplied; specialized authentication templates omit it because their localized body is fixed. - `text: string` The message copy. Use `{{name}}` for each variable — lowercase letters, digits and underscores, the same names a `template` part supplies values for. Numbered placeholders such as `{{1}}` are refused: this API addresses template variables by name. At most 32 distinct placeholders may appear; a larger set is refused at this field. - `examples: optional unknown` One example value per variable, keyed by variable name. **Required for every variable the copy uses** — the channel refuses a template whose variables carry no examples, and reviewers read the examples to decide. Omit it entirely when the copy has no variables. Each value is 1–1024 characters, may not be whitespace-only, and may not contain a line break, a tab, or four consecutive spaces, because a parameter value carries the same published rules at send time. - `buttons: optional array of object { text, example, type, url }` Buttons for an ordinary template: `url` buttons (fixed, or ending in the send-time variable `{{1}}`) and `quick_reply` buttons. Up to 10 in total, at most two `url`, and the quick replies adjacent to one another. Labels and fixed destinations are baked into the reviewed template; a dynamic destination and every quick reply become slots the approved template's `send_schema` requires on `buttons[]`. - `text: string` Visible label, maximum 25 characters. - `example: optional string` Required exactly when `url` ends in `{{1}}`: a sample VALUE for that variable, reviewed with the template. Refused on a fixed destination and on a `quick_reply` button. - `type: optional "url" or "quick_reply"` `url` (the default when omitted) or `quick_reply`. - `"url"` - `"quick_reply"` - `url: optional string` For a `url` button: the HTTPS destination, at most 2000 characters. It may end in exactly `{{1}}` — `https://example.com/jobs/{{1}}` — and nothing else in it may vary; the value is appended at send, verbatim, so percent-encode it yourself. Refused on a `quick_reply` button. - `carousel: optional object { cards }` Optional media-card carousel definition. All 2–10 cards must use the same media kind, body presence, and ordered button-type sequence. A carousel template is the `body` plus its cards: it cannot be combined with `footer`, `media_header` or `buttons`. Valid only when `category` is `marketing` or `utility`: an authentication template renders a fixed one-time-code layout with no card slot, so the pair is refused with a fault at `/carousel` before anything is recorded rather than created without its cards. - `cards: array of object { media, body, buttons }` - `media: object { asset_handle, kind }` - `asset_handle: string` The asset handle returned by the channel's template-authoring upload flow. This is neither this API's upload_ref nor an inbound media_id. - `kind: "image" or "video"` - `"image"` - `"video"` - `body: optional object { text, examples }` The body copy of a template, with `{{variable}}` placeholders for the parts that change per send. - `text: string` The message copy. Use `{{name}}` for each variable — lowercase letters, digits and underscores, the same names a `template` part supplies values for. Numbered placeholders such as `{{1}}` are refused: this API addresses template variables by name. At most 32 distinct placeholders may appear; a larger set is refused at this field. - `examples: optional unknown` One example value per variable, keyed by variable name. **Required for every variable the copy uses** — the channel refuses a template whose variables carry no examples, and reviewers read the examples to decide. Omit it entirely when the copy has no variables. Each value is 1–1024 characters, may not be whitespace-only, and may not contain a line break, a tab, or four consecutive spaces, because a parameter value carries the same published rules at send time. - `buttons: optional array of object { text, type, phone_number, url }` - `text: string` - `type: "quick_reply" or "phone_number" or "url"` - `"quick_reply"` - `"phone_number"` - `"url"` - `phone_number: optional string` - `url: optional string` - `footer: optional string` An optional footer line for an ordinary template. Takes no variables. It cannot be combined with `carousel`: a carousel bubble is the body plus its cards and has no footer, so the pair is refused with a fault at `/footer` before anything is recorded and the name remains reusable. - `media_header: optional object { kind, upload_ref }` Optional image, video, or document header for an ordinary template. The referenced bytes are uploaded for template review as part of this submission. It cannot be combined with `authentication` or `carousel`. - `kind: "image" or "video" or "document"` The media shape reviewed with this template. - `"image"` - `"video"` - `"document"` - `upload_ref: string` A durable handle returned by `POST /v1/media` for this account and key mode. Template authoring accepts JPEG, PNG, MP4, and PDF up to 5 MiB for every kind. This is this API's conservative authoring limit. The `upload_ref` follows the media route's documented retention posture and is not permanent. ### Returns - `Template object { category, created_at, language, 9 more }` One registered message template in any status, with the parameters it takes. A template is identified by its `name` and `language` together — that is the pair a `template` part names, and the pair this API addresses it by. There is no separate template id. - `category: string` `utility`, `marketing` or `authentication` — the category review ASSIGNED, which can differ from the one submitted — read it back after approval, since it determines pricing and whether marketing delivery rules apply. Values grow additively. - `created_at: string` - `language: string` The locale this variant is written in, such as `en_US`. - `name: string` Lowercase letters, digits and underscores. Permanent once submitted. - `parameters: unknown` The variables this template takes, as a JSON Schema (2020-12) object — ready to hand to a model verbatim as a tool schema. Every property is a string and every one is required: the channel substitutes all of them. Each property publishes `minLength`, `maxLength` and `pattern` alongside its example, so a model sees the same value rules the send path enforces: values are 1–1024 characters, not whitespace-only, and contain no line break, tab or run of four spaces. An `authentication` template takes exactly one parameter, `code`: the one-time code the message delivers, 1–15 characters. You generate the code; it is shown in the message body and is what the code button copies or fills in. A longer value is refused, never shortened. The `{{1}}` in such a template's `content.body` is where that code appears. An empty `properties` object means the template takes no variables. `null` means something different and specific: this template's variables cannot be addressed by name over this API (they are positional, or they live in a part of the template this API does not read yet). A `template` part naming such a template cannot supply its variables. - `quality: string` The channel's quality signal for this template, when it has one. `null` until it does. Free text; treat an unknown value as no signal. - `rejected_reason: string` Why the template was refused or held, when the channel said. Free text for a human; the wording is not stable and must not be branched on. `null` when there is nothing to say. - `send_schema: unknown` The complete schema for the `template` part that sends this exact template, including its fixed identity, named parameters, media header, and carousel values. After approval it is published on the registry's next read-back, up to about fifteen minutes later; until then it is `null` and a send is refused with `template_not_sendable` pointing at the template. `null` otherwise means this template cannot be addressed safely through this API. - `status: string` Where this template stands. Only `approved` may be sent. `draft` — a submission attempt has not produced a registered template. Consult `retry_allowed`; draft status alone never permits resubmission. `pending` — under review. Review time varies: templates have been approved in minutes and, in other cases, over several days. A `template.updated` event reports each change of `status` or `category`; this read remains the authority to reconcile against. `approved` — sendable. After approval, `send_schema` is published on the registry's next read-back, up to about fifteen minutes later. `rejected` — refused; `rejected_reason` may say why. `paused` — was approved and is currently held, usually for quality. Not terminal: it can become `approved` again without you doing anything. `disabled` — no longer usable. Values grow additively, and anything you do not recognise is not sendable. - `updated_at: string` When this template's registry facts last changed. An unchanged channel reconciliation does not move it. - `content: optional object { body, buttons, carousel, 2 more }` Human-readable copy and fixed actions in a registered template. - `body: optional string` - `buttons: optional array of object { type, phone_number, text, url }` - `type: string` The action kind; values grow additively. `one_time_code` is an authentication template's code button: it copies or fills in the code each send supplies as the `code` parameter, carries no `url`, and has no send-time slot of its own. - `phone_number: optional string` A fixed telephone destination baked into the template, when present. - `text: optional string` The label shown to the recipient, when the channel supplies one. - `url: optional string` The destination baked into the template, when present. A `url` button's destination may end in `{{1}}`, the variable each send fills. - `carousel: optional array of object { body, buttons, header }` - `body: optional string` - `buttons: optional array of object { type, phone_number, text, url }` - `type: string` The action kind; values grow additively. `one_time_code` is an authentication template's code button: it copies or fills in the code each send supplies as the `code` parameter, carries no `url`, and has no send-time slot of its own. - `phone_number: optional string` A fixed telephone destination baked into the template, when present. - `text: optional string` The label shown to the recipient, when the channel supplies one. - `url: optional string` The destination baked into the template, when present. A `url` button's destination may end in `{{1}}`, the variable each send fills. - `header: optional object { kind, text }` A media or text header as it will appear to the recipient. - `kind: string` `text`, `image`, `video`, or `document`; values grow additively. - `text: optional string` Fixed header copy. Omitted for media headers. - `footer: optional string` - `header: optional object { kind, text }` A media or text header as it will appear to the recipient. - `kind: string` `text`, `image`, `video`, or `document`; values grow additively. - `text: optional string` Fixed header copy. Omitted for media headers. - `retry_allowed: optional boolean` Whether another submission using this draft's name and language is currently allowed. A corrected definition may be required. Present on all responses from current servers. Clients must not offer retry unless this is explicitly `true`. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/templates \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" \ -d '{ "category": "category", "language": "language", "name": "name" }' ``` #### Response ```json { "category": "category", "created_at": "2019-12-27T18:11:19.117Z", "language": "language", "name": "name", "parameters": {}, "quality": "quality", "rejected_reason": "rejected_reason", "send_schema": {}, "status": "status", "updated_at": "2019-12-27T18:11:19.117Z", "content": { "body": "body", "buttons": [ { "type": "type", "phone_number": "phone_number", "text": "text", "url": "url" } ], "carousel": [ { "body": "body", "buttons": [ { "type": "type", "phone_number": "phone_number", "text": "text", "url": "url" } ], "header": { "kind": "kind", "text": "text" } } ], "footer": "footer", "header": { "kind": "kind", "text": "text" } }, "retry_allowed": true } ``` --- # List templates URL: https://docs.linqapp.com/channel/whatsapp/api/resources/templates/methods/list/ **get** `/v1/templates` Lists the templates registered for this key's account, newest first, with the parameter schema each one takes. This is the read a `422 outside_customer_window` points you at: outside a customer's service window only an approved `template` part sends, and this is where the sendable ones and their variables are. It is also the read to hand an agent — `parameters` is a JSON Schema shaped to be used verbatim as a tool definition. Templates in every status are listed, including ones that are not sendable, so a pause or a rejection is visible rather than looking like a template that vanished. Filter on `status == "approved"` and a non-null `send_schema` for the sendable set: an approved template is sendable once the registry has read it back and published its `send_schema`. ### Query Parameters - `cursor: optional string` A `next_cursor` from a previous page. Omit for the first page. - `limit: optional number` How many templates to return, 1–100. Defaults to 100. A value outside the range is refused rather than clamped. ### Returns - `TemplatePage object { data, has_more, next_cursor }` One page of templates, newest first. - `data: array of Template` - `category: string` `utility`, `marketing` or `authentication` — the category review ASSIGNED, which can differ from the one submitted — read it back after approval, since it determines pricing and whether marketing delivery rules apply. Values grow additively. - `created_at: string` - `language: string` The locale this variant is written in, such as `en_US`. - `name: string` Lowercase letters, digits and underscores. Permanent once submitted. - `parameters: unknown` The variables this template takes, as a JSON Schema (2020-12) object — ready to hand to a model verbatim as a tool schema. Every property is a string and every one is required: the channel substitutes all of them. Each property publishes `minLength`, `maxLength` and `pattern` alongside its example, so a model sees the same value rules the send path enforces: values are 1–1024 characters, not whitespace-only, and contain no line break, tab or run of four spaces. An `authentication` template takes exactly one parameter, `code`: the one-time code the message delivers, 1–15 characters. You generate the code; it is shown in the message body and is what the code button copies or fills in. A longer value is refused, never shortened. The `{{1}}` in such a template's `content.body` is where that code appears. An empty `properties` object means the template takes no variables. `null` means something different and specific: this template's variables cannot be addressed by name over this API (they are positional, or they live in a part of the template this API does not read yet). A `template` part naming such a template cannot supply its variables. - `quality: string` The channel's quality signal for this template, when it has one. `null` until it does. Free text; treat an unknown value as no signal. - `rejected_reason: string` Why the template was refused or held, when the channel said. Free text for a human; the wording is not stable and must not be branched on. `null` when there is nothing to say. - `send_schema: unknown` The complete schema for the `template` part that sends this exact template, including its fixed identity, named parameters, media header, and carousel values. After approval it is published on the registry's next read-back, up to about fifteen minutes later; until then it is `null` and a send is refused with `template_not_sendable` pointing at the template. `null` otherwise means this template cannot be addressed safely through this API. - `status: string` Where this template stands. Only `approved` may be sent. `draft` — a submission attempt has not produced a registered template. Consult `retry_allowed`; draft status alone never permits resubmission. `pending` — under review. Review time varies: templates have been approved in minutes and, in other cases, over several days. A `template.updated` event reports each change of `status` or `category`; this read remains the authority to reconcile against. `approved` — sendable. After approval, `send_schema` is published on the registry's next read-back, up to about fifteen minutes later. `rejected` — refused; `rejected_reason` may say why. `paused` — was approved and is currently held, usually for quality. Not terminal: it can become `approved` again without you doing anything. `disabled` — no longer usable. Values grow additively, and anything you do not recognise is not sendable. - `updated_at: string` When this template's registry facts last changed. An unchanged channel reconciliation does not move it. - `content: optional object { body, buttons, carousel, 2 more }` Human-readable copy and fixed actions in a registered template. - `body: optional string` - `buttons: optional array of object { type, phone_number, text, url }` - `type: string` The action kind; values grow additively. `one_time_code` is an authentication template's code button: it copies or fills in the code each send supplies as the `code` parameter, carries no `url`, and has no send-time slot of its own. - `phone_number: optional string` A fixed telephone destination baked into the template, when present. - `text: optional string` The label shown to the recipient, when the channel supplies one. - `url: optional string` The destination baked into the template, when present. A `url` button's destination may end in `{{1}}`, the variable each send fills. - `carousel: optional array of object { body, buttons, header }` - `body: optional string` - `buttons: optional array of object { type, phone_number, text, url }` - `type: string` The action kind; values grow additively. `one_time_code` is an authentication template's code button: it copies or fills in the code each send supplies as the `code` parameter, carries no `url`, and has no send-time slot of its own. - `phone_number: optional string` A fixed telephone destination baked into the template, when present. - `text: optional string` The label shown to the recipient, when the channel supplies one. - `url: optional string` The destination baked into the template, when present. A `url` button's destination may end in `{{1}}`, the variable each send fills. - `header: optional object { kind, text }` A media or text header as it will appear to the recipient. - `kind: string` `text`, `image`, `video`, or `document`; values grow additively. - `text: optional string` Fixed header copy. Omitted for media headers. - `footer: optional string` - `header: optional object { kind, text }` A media or text header as it will appear to the recipient. - `kind: string` `text`, `image`, `video`, or `document`; values grow additively. - `text: optional string` Fixed header copy. Omitted for media headers. - `retry_allowed: optional boolean` Whether another submission using this draft's name and language is currently allowed. A corrected definition may be required. Present on all responses from current servers. Clients must not offer retry unless this is explicitly `true`. - `has_more: boolean` True when another page follows. - `next_cursor: optional string` Pass as `cursor` to read the next page. Present only when `has_more` is true. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/templates \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` #### Response ```json { "data": [ { "category": "category", "created_at": "2019-12-27T18:11:19.117Z", "language": "language", "name": "name", "parameters": {}, "quality": "quality", "rejected_reason": "rejected_reason", "send_schema": {}, "status": "status", "updated_at": "2019-12-27T18:11:19.117Z", "content": { "body": "body", "buttons": [ { "type": "type", "phone_number": "phone_number", "text": "text", "url": "url" } ], "carousel": [ { "body": "body", "buttons": [ { "type": "type", "phone_number": "phone_number", "text": "text", "url": "url" } ], "header": { "kind": "kind", "text": "text" } } ], "footer": "footer", "header": { "kind": "kind", "text": "text" } }, "retry_allowed": true } ], "has_more": true, "next_cursor": "next_cursor" } ``` --- # Webhook Deliveries URL: https://docs.linqapp.com/channel/whatsapp/api/resources/webhook_deliveries/ ## List webhook delivery history **get** `/v1/webhook_deliveries` Lists webhook deliveries and their retained applied attempts, newest delivery first. Without an exact `delivery_id`, `event_id`, or `trace_id` lookup, the time window defaults to the latest 24 hours and cannot exceed 30 days. Exact identifiers may reach older retained evidence. Successful delivery detail becomes eligible for sweeping after 30 days; failed evidence may remain longer. The response therefore publishes an inclusive successful-history incompleteness horizon and the instant when attempt-history collection began. Neither is a blanket retention promise. `spent_attempt_count` can exceed `observed_attempt_count` when an attempt ends without a retained verdict. Such a gap is reported, never filled with an invented attempt result. Payloads, bodies, headers, credentials, signatures, diagnostic errors and destination URL paths are never returned. ### Query Parameters - `cursor: optional string` - `delivery_id: optional string` - `endpoint_id: optional string` - `event_id: optional string` - `event_kind: optional string` - `from: optional string` - `limit: optional number` - `outcome: optional string` - `to: optional string` - `trace_id: optional string` ### Returns - `DeliveryPage object { attempt_history_coverage_started_at, data, has_more, 3 more }` A bounded page of webhook deliveries. Parent deliveries are never split across pages. - `attempt_history_coverage_started_at: string` Inclusive instant when attempt-history collection began. Earlier deliveries cannot claim complete attempt history. - `data: array of Delivery` - `id: string` - `attempt_history_complete: boolean` True only when every spent attempt has a retained applied verdict and collection covered this delivery from creation. - `attempts: array of DeliveryAttempt` - `attempt: number` The spent attempt number. Gaps mean a lease expired without an applied verdict. - `attempt_completed_at: string` - `attempt_started_at: string` - `destination: string` Scheme, host and effective port only. Path, query, fragment and credentials are never returned. - `http_status: number` Response status, or `null` when no response was received. - `phase: string` `pre_dial` when no request began, or `wire` after the HTTP round trip began. - `reason_code: string` A bounded machine reason. Treat unknown values as `unknown`. - `verdict: string` `delivered`, `retryable`, or `permanent`. Treat unknown values as an unavailable verdict. - `wire_completed_at: string` - `wire_duration_ms: number` - `wire_started_at: string` - `trace_id: optional string` W3C trace id when one was recorded. Correlation only; never authorization. - `created_at: string` - `endpoint_id: string` - `event_id: string` - `event_kind: string` - `observed_attempt_count: number` Applied attempt verdicts retained below. - `seq_from: number` - `seq_to: number` - `spent_attempt_count: number` Attempts spent by the delivery machine, including leases that expired without an applied verdict. - `state: string` `pending`, `delivering`, `delivered`, `permanent_refusal`, or `retry_exhausted`. - `chat_id: optional string` - `next_attempt_at: optional string` Present only while `state` is `pending`: the instant the next attempt becomes due. A value in the future is a delivery backing off after a failed attempt; a value at or before now is a delivery that is due and waiting — usually behind an earlier delivery to the same endpoint and chat. Deliveries to one endpoint and chat are sent in the order their events were recorded. A `message.received` for a message carrying attachments is recorded once every attachment has been captured or has failed, or ten minutes after the message arrived, whichever comes first. It can therefore follow deliveries for later messages of the same chat, and carry a lower `data.seq_from` than an event you already received: `seq_from` can decrease relative to arrival. Never discard such an event as stale: deduplicate by the event `id`, order a conversation by `data.seq_from`, and for live processing buffer briefly or reconcile with `GET /v1/chats/{chat}/events`. `POST /v1/webhook_deliveries/{delivery}/retry` moves a future value to now. - `has_more: boolean` - `older_successful_history_may_have_been_swept: boolean` True when successful delivery detail may have been swept from this account partition. - `successful_history_incomplete_through: string` Inclusive creation-time horizon through which successful delivery detail may be incomplete. - `next_cursor: optional string` ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/webhook_deliveries \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` #### Response ```json { "attempt_history_coverage_started_at": "2019-12-27T18:11:19.117Z", "data": [ { "id": "id", "attempt_history_complete": true, "attempts": [ { "attempt": 0, "attempt_completed_at": "2019-12-27T18:11:19.117Z", "attempt_started_at": "2019-12-27T18:11:19.117Z", "destination": "destination", "http_status": 0, "phase": "phase", "reason_code": "reason_code", "verdict": "verdict", "wire_completed_at": "2019-12-27T18:11:19.117Z", "wire_duration_ms": 0, "wire_started_at": "2019-12-27T18:11:19.117Z", "trace_id": "trace_id" } ], "created_at": "2019-12-27T18:11:19.117Z", "endpoint_id": "endpoint_id", "event_id": "event_id", "event_kind": "event_kind", "observed_attempt_count": 0, "seq_from": 0, "seq_to": 0, "spent_attempt_count": 0, "state": "state", "chat_id": "chat_id", "next_attempt_at": "2019-12-27T18:11:19.117Z" } ], "has_more": true, "older_successful_history_may_have_been_swept": true, "successful_history_incomplete_through": "2019-12-27T18:11:19.117Z", "next_cursor": "next_cursor" } ``` ## Retry a pending webhook delivery now **post** `/v1/webhook_deliveries/{delivery}/retry` Pulls a pending delivery's next attempt forward to now, so a receiver that was down — or not yet deployed — gets its retry immediately instead of at the end of the backoff. The delivery is otherwise untouched: the same event, the same payload, the same position in its endpoint-and-chat order. Later deliveries to the same endpoint and chat wait behind it, so pulling the delivery at the head of the line forward and having it succeed releases the rest. A message that is waiting for its attachments has no delivery yet, so there is nothing to pull forward until it is recorded. **The attempt this triggers is an ordinary one, and it is not free.** Every delivery gets at most nine attempts; the one you pull forward spends one of them, and a failure schedules the next attempt on the same backoff as before, from the same attempt number. Pulling forward against a receiver that is still down therefore only spends the bounded attempts faster. Once the last attempt fails the delivery leaves live delivery as `retry_exhausted`, later deliveries in its line proceed, and only a replay (`POST /v1/webhook_endpoints/{endpoint}/replays`) can send its event. Answers `200` with the delivery as `GET /v1/webhook_deliveries` renders it. A `pending` delivery whose `next_attempt_at` is already at or before now is answered `200` unchanged — pulling forward what is already due is a no-op, not an error — so read `next_attempt_at` to tell the two apart. A `delivering` delivery answers `409 webhook_delivery_in_progress`: an attempt is on the wire and its result decides the next timer. A `delivered`, `permanent_refusal` or `retry_exhausted` delivery answers `409 webhook_delivery_terminal` with the state in the message. An unknown delivery, or one belonging to another account or partition, answers `404 webhook_delivery_not_found`. ### Path Parameters - `delivery: string` ### Returns - `Delivery object { id, attempt_history_complete, attempts, 11 more }` One webhook delivery and every retained applied attempt belonging to it. - `id: string` - `attempt_history_complete: boolean` True only when every spent attempt has a retained applied verdict and collection covered this delivery from creation. - `attempts: array of DeliveryAttempt` - `attempt: number` The spent attempt number. Gaps mean a lease expired without an applied verdict. - `attempt_completed_at: string` - `attempt_started_at: string` - `destination: string` Scheme, host and effective port only. Path, query, fragment and credentials are never returned. - `http_status: number` Response status, or `null` when no response was received. - `phase: string` `pre_dial` when no request began, or `wire` after the HTTP round trip began. - `reason_code: string` A bounded machine reason. Treat unknown values as `unknown`. - `verdict: string` `delivered`, `retryable`, or `permanent`. Treat unknown values as an unavailable verdict. - `wire_completed_at: string` - `wire_duration_ms: number` - `wire_started_at: string` - `trace_id: optional string` W3C trace id when one was recorded. Correlation only; never authorization. - `created_at: string` - `endpoint_id: string` - `event_id: string` - `event_kind: string` - `observed_attempt_count: number` Applied attempt verdicts retained below. - `seq_from: number` - `seq_to: number` - `spent_attempt_count: number` Attempts spent by the delivery machine, including leases that expired without an applied verdict. - `state: string` `pending`, `delivering`, `delivered`, `permanent_refusal`, or `retry_exhausted`. - `chat_id: optional string` - `next_attempt_at: optional string` Present only while `state` is `pending`: the instant the next attempt becomes due. A value in the future is a delivery backing off after a failed attempt; a value at or before now is a delivery that is due and waiting — usually behind an earlier delivery to the same endpoint and chat. Deliveries to one endpoint and chat are sent in the order their events were recorded. A `message.received` for a message carrying attachments is recorded once every attachment has been captured or has failed, or ten minutes after the message arrived, whichever comes first. It can therefore follow deliveries for later messages of the same chat, and carry a lower `data.seq_from` than an event you already received: `seq_from` can decrease relative to arrival. Never discard such an event as stale: deduplicate by the event `id`, order a conversation by `data.seq_from`, and for live processing buffer briefly or reconcile with `GET /v1/chats/{chat}/events`. `POST /v1/webhook_deliveries/{delivery}/retry` moves a future value to now. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/webhook_deliveries/$DELIVERY/retry \ -X POST \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` #### Response ```json { "id": "id", "attempt_history_complete": true, "attempts": [ { "attempt": 0, "attempt_completed_at": "2019-12-27T18:11:19.117Z", "attempt_started_at": "2019-12-27T18:11:19.117Z", "destination": "destination", "http_status": 0, "phase": "phase", "reason_code": "reason_code", "verdict": "verdict", "wire_completed_at": "2019-12-27T18:11:19.117Z", "wire_duration_ms": 0, "wire_started_at": "2019-12-27T18:11:19.117Z", "trace_id": "trace_id" } ], "created_at": "2019-12-27T18:11:19.117Z", "endpoint_id": "endpoint_id", "event_id": "event_id", "event_kind": "event_kind", "observed_attempt_count": 0, "seq_from": 0, "seq_to": 0, "spent_attempt_count": 0, "state": "state", "chat_id": "chat_id", "next_attempt_at": "2019-12-27T18:11:19.117Z" } ``` ## Domain Types ### Delivery - `Delivery object { id, attempt_history_complete, attempts, 11 more }` One webhook delivery and every retained applied attempt belonging to it. - `id: string` - `attempt_history_complete: boolean` True only when every spent attempt has a retained applied verdict and collection covered this delivery from creation. - `attempts: array of DeliveryAttempt` - `attempt: number` The spent attempt number. Gaps mean a lease expired without an applied verdict. - `attempt_completed_at: string` - `attempt_started_at: string` - `destination: string` Scheme, host and effective port only. Path, query, fragment and credentials are never returned. - `http_status: number` Response status, or `null` when no response was received. - `phase: string` `pre_dial` when no request began, or `wire` after the HTTP round trip began. - `reason_code: string` A bounded machine reason. Treat unknown values as `unknown`. - `verdict: string` `delivered`, `retryable`, or `permanent`. Treat unknown values as an unavailable verdict. - `wire_completed_at: string` - `wire_duration_ms: number` - `wire_started_at: string` - `trace_id: optional string` W3C trace id when one was recorded. Correlation only; never authorization. - `created_at: string` - `endpoint_id: string` - `event_id: string` - `event_kind: string` - `observed_attempt_count: number` Applied attempt verdicts retained below. - `seq_from: number` - `seq_to: number` - `spent_attempt_count: number` Attempts spent by the delivery machine, including leases that expired without an applied verdict. - `state: string` `pending`, `delivering`, `delivered`, `permanent_refusal`, or `retry_exhausted`. - `chat_id: optional string` - `next_attempt_at: optional string` Present only while `state` is `pending`: the instant the next attempt becomes due. A value in the future is a delivery backing off after a failed attempt; a value at or before now is a delivery that is due and waiting — usually behind an earlier delivery to the same endpoint and chat. Deliveries to one endpoint and chat are sent in the order their events were recorded. A `message.received` for a message carrying attachments is recorded once every attachment has been captured or has failed, or ten minutes after the message arrived, whichever comes first. It can therefore follow deliveries for later messages of the same chat, and carry a lower `data.seq_from` than an event you already received: `seq_from` can decrease relative to arrival. Never discard such an event as stale: deduplicate by the event `id`, order a conversation by `data.seq_from`, and for live processing buffer briefly or reconcile with `GET /v1/chats/{chat}/events`. `POST /v1/webhook_deliveries/{delivery}/retry` moves a future value to now. ### Delivery Attempt - `DeliveryAttempt object { attempt, attempt_completed_at, attempt_started_at, 9 more }` One applied attempt to deliver an account event to a webhook endpoint. - `attempt: number` The spent attempt number. Gaps mean a lease expired without an applied verdict. - `attempt_completed_at: string` - `attempt_started_at: string` - `destination: string` Scheme, host and effective port only. Path, query, fragment and credentials are never returned. - `http_status: number` Response status, or `null` when no response was received. - `phase: string` `pre_dial` when no request began, or `wire` after the HTTP round trip began. - `reason_code: string` A bounded machine reason. Treat unknown values as `unknown`. - `verdict: string` `delivered`, `retryable`, or `permanent`. Treat unknown values as an unavailable verdict. - `wire_completed_at: string` - `wire_duration_ms: number` - `wire_started_at: string` - `trace_id: optional string` W3C trace id when one was recorded. Correlation only; never authorization. ### Delivery Page - `DeliveryPage object { attempt_history_coverage_started_at, data, has_more, 3 more }` A bounded page of webhook deliveries. Parent deliveries are never split across pages. - `attempt_history_coverage_started_at: string` Inclusive instant when attempt-history collection began. Earlier deliveries cannot claim complete attempt history. - `data: array of Delivery` - `id: string` - `attempt_history_complete: boolean` True only when every spent attempt has a retained applied verdict and collection covered this delivery from creation. - `attempts: array of DeliveryAttempt` - `attempt: number` The spent attempt number. Gaps mean a lease expired without an applied verdict. - `attempt_completed_at: string` - `attempt_started_at: string` - `destination: string` Scheme, host and effective port only. Path, query, fragment and credentials are never returned. - `http_status: number` Response status, or `null` when no response was received. - `phase: string` `pre_dial` when no request began, or `wire` after the HTTP round trip began. - `reason_code: string` A bounded machine reason. Treat unknown values as `unknown`. - `verdict: string` `delivered`, `retryable`, or `permanent`. Treat unknown values as an unavailable verdict. - `wire_completed_at: string` - `wire_duration_ms: number` - `wire_started_at: string` - `trace_id: optional string` W3C trace id when one was recorded. Correlation only; never authorization. - `created_at: string` - `endpoint_id: string` - `event_id: string` - `event_kind: string` - `observed_attempt_count: number` Applied attempt verdicts retained below. - `seq_from: number` - `seq_to: number` - `spent_attempt_count: number` Attempts spent by the delivery machine, including leases that expired without an applied verdict. - `state: string` `pending`, `delivering`, `delivered`, `permanent_refusal`, or `retry_exhausted`. - `chat_id: optional string` - `next_attempt_at: optional string` Present only while `state` is `pending`: the instant the next attempt becomes due. A value in the future is a delivery backing off after a failed attempt; a value at or before now is a delivery that is due and waiting — usually behind an earlier delivery to the same endpoint and chat. Deliveries to one endpoint and chat are sent in the order their events were recorded. A `message.received` for a message carrying attachments is recorded once every attachment has been captured or has failed, or ten minutes after the message arrived, whichever comes first. It can therefore follow deliveries for later messages of the same chat, and carry a lower `data.seq_from` than an event you already received: `seq_from` can decrease relative to arrival. Never discard such an event as stale: deduplicate by the event `id`, order a conversation by `data.seq_from`, and for live processing buffer briefly or reconcile with `GET /v1/chats/{chat}/events`. `POST /v1/webhook_deliveries/{delivery}/retry` moves a future value to now. - `has_more: boolean` - `older_successful_history_may_have_been_swept: boolean` True when successful delivery detail may have been swept from this account partition. - `successful_history_incomplete_through: string` Inclusive creation-time horizon through which successful delivery detail may be incomplete. - `next_cursor: optional string` --- # List webhook delivery history URL: https://docs.linqapp.com/channel/whatsapp/api/resources/webhook_deliveries/methods/list/ **get** `/v1/webhook_deliveries` Lists webhook deliveries and their retained applied attempts, newest delivery first. Without an exact `delivery_id`, `event_id`, or `trace_id` lookup, the time window defaults to the latest 24 hours and cannot exceed 30 days. Exact identifiers may reach older retained evidence. Successful delivery detail becomes eligible for sweeping after 30 days; failed evidence may remain longer. The response therefore publishes an inclusive successful-history incompleteness horizon and the instant when attempt-history collection began. Neither is a blanket retention promise. `spent_attempt_count` can exceed `observed_attempt_count` when an attempt ends without a retained verdict. Such a gap is reported, never filled with an invented attempt result. Payloads, bodies, headers, credentials, signatures, diagnostic errors and destination URL paths are never returned. ### Query Parameters - `cursor: optional string` - `delivery_id: optional string` - `endpoint_id: optional string` - `event_id: optional string` - `event_kind: optional string` - `from: optional string` - `limit: optional number` - `outcome: optional string` - `to: optional string` - `trace_id: optional string` ### Returns - `DeliveryPage object { attempt_history_coverage_started_at, data, has_more, 3 more }` A bounded page of webhook deliveries. Parent deliveries are never split across pages. - `attempt_history_coverage_started_at: string` Inclusive instant when attempt-history collection began. Earlier deliveries cannot claim complete attempt history. - `data: array of Delivery` - `id: string` - `attempt_history_complete: boolean` True only when every spent attempt has a retained applied verdict and collection covered this delivery from creation. - `attempts: array of DeliveryAttempt` - `attempt: number` The spent attempt number. Gaps mean a lease expired without an applied verdict. - `attempt_completed_at: string` - `attempt_started_at: string` - `destination: string` Scheme, host and effective port only. Path, query, fragment and credentials are never returned. - `http_status: number` Response status, or `null` when no response was received. - `phase: string` `pre_dial` when no request began, or `wire` after the HTTP round trip began. - `reason_code: string` A bounded machine reason. Treat unknown values as `unknown`. - `verdict: string` `delivered`, `retryable`, or `permanent`. Treat unknown values as an unavailable verdict. - `wire_completed_at: string` - `wire_duration_ms: number` - `wire_started_at: string` - `trace_id: optional string` W3C trace id when one was recorded. Correlation only; never authorization. - `created_at: string` - `endpoint_id: string` - `event_id: string` - `event_kind: string` - `observed_attempt_count: number` Applied attempt verdicts retained below. - `seq_from: number` - `seq_to: number` - `spent_attempt_count: number` Attempts spent by the delivery machine, including leases that expired without an applied verdict. - `state: string` `pending`, `delivering`, `delivered`, `permanent_refusal`, or `retry_exhausted`. - `chat_id: optional string` - `next_attempt_at: optional string` Present only while `state` is `pending`: the instant the next attempt becomes due. A value in the future is a delivery backing off after a failed attempt; a value at or before now is a delivery that is due and waiting — usually behind an earlier delivery to the same endpoint and chat. Deliveries to one endpoint and chat are sent in the order their events were recorded. A `message.received` for a message carrying attachments is recorded once every attachment has been captured or has failed, or ten minutes after the message arrived, whichever comes first. It can therefore follow deliveries for later messages of the same chat, and carry a lower `data.seq_from` than an event you already received: `seq_from` can decrease relative to arrival. Never discard such an event as stale: deduplicate by the event `id`, order a conversation by `data.seq_from`, and for live processing buffer briefly or reconcile with `GET /v1/chats/{chat}/events`. `POST /v1/webhook_deliveries/{delivery}/retry` moves a future value to now. - `has_more: boolean` - `older_successful_history_may_have_been_swept: boolean` True when successful delivery detail may have been swept from this account partition. - `successful_history_incomplete_through: string` Inclusive creation-time horizon through which successful delivery detail may be incomplete. - `next_cursor: optional string` ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/webhook_deliveries \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` #### Response ```json { "attempt_history_coverage_started_at": "2019-12-27T18:11:19.117Z", "data": [ { "id": "id", "attempt_history_complete": true, "attempts": [ { "attempt": 0, "attempt_completed_at": "2019-12-27T18:11:19.117Z", "attempt_started_at": "2019-12-27T18:11:19.117Z", "destination": "destination", "http_status": 0, "phase": "phase", "reason_code": "reason_code", "verdict": "verdict", "wire_completed_at": "2019-12-27T18:11:19.117Z", "wire_duration_ms": 0, "wire_started_at": "2019-12-27T18:11:19.117Z", "trace_id": "trace_id" } ], "created_at": "2019-12-27T18:11:19.117Z", "endpoint_id": "endpoint_id", "event_id": "event_id", "event_kind": "event_kind", "observed_attempt_count": 0, "seq_from": 0, "seq_to": 0, "spent_attempt_count": 0, "state": "state", "chat_id": "chat_id", "next_attempt_at": "2019-12-27T18:11:19.117Z" } ], "has_more": true, "older_successful_history_may_have_been_swept": true, "successful_history_incomplete_through": "2019-12-27T18:11:19.117Z", "next_cursor": "next_cursor" } ``` --- # Retry a pending webhook delivery now URL: https://docs.linqapp.com/channel/whatsapp/api/resources/webhook_deliveries/methods/retry/ **post** `/v1/webhook_deliveries/{delivery}/retry` Pulls a pending delivery's next attempt forward to now, so a receiver that was down — or not yet deployed — gets its retry immediately instead of at the end of the backoff. The delivery is otherwise untouched: the same event, the same payload, the same position in its endpoint-and-chat order. Later deliveries to the same endpoint and chat wait behind it, so pulling the delivery at the head of the line forward and having it succeed releases the rest. A message that is waiting for its attachments has no delivery yet, so there is nothing to pull forward until it is recorded. **The attempt this triggers is an ordinary one, and it is not free.** Every delivery gets at most nine attempts; the one you pull forward spends one of them, and a failure schedules the next attempt on the same backoff as before, from the same attempt number. Pulling forward against a receiver that is still down therefore only spends the bounded attempts faster. Once the last attempt fails the delivery leaves live delivery as `retry_exhausted`, later deliveries in its line proceed, and only a replay (`POST /v1/webhook_endpoints/{endpoint}/replays`) can send its event. Answers `200` with the delivery as `GET /v1/webhook_deliveries` renders it. A `pending` delivery whose `next_attempt_at` is already at or before now is answered `200` unchanged — pulling forward what is already due is a no-op, not an error — so read `next_attempt_at` to tell the two apart. A `delivering` delivery answers `409 webhook_delivery_in_progress`: an attempt is on the wire and its result decides the next timer. A `delivered`, `permanent_refusal` or `retry_exhausted` delivery answers `409 webhook_delivery_terminal` with the state in the message. An unknown delivery, or one belonging to another account or partition, answers `404 webhook_delivery_not_found`. ### Path Parameters - `delivery: string` ### Returns - `Delivery object { id, attempt_history_complete, attempts, 11 more }` One webhook delivery and every retained applied attempt belonging to it. - `id: string` - `attempt_history_complete: boolean` True only when every spent attempt has a retained applied verdict and collection covered this delivery from creation. - `attempts: array of DeliveryAttempt` - `attempt: number` The spent attempt number. Gaps mean a lease expired without an applied verdict. - `attempt_completed_at: string` - `attempt_started_at: string` - `destination: string` Scheme, host and effective port only. Path, query, fragment and credentials are never returned. - `http_status: number` Response status, or `null` when no response was received. - `phase: string` `pre_dial` when no request began, or `wire` after the HTTP round trip began. - `reason_code: string` A bounded machine reason. Treat unknown values as `unknown`. - `verdict: string` `delivered`, `retryable`, or `permanent`. Treat unknown values as an unavailable verdict. - `wire_completed_at: string` - `wire_duration_ms: number` - `wire_started_at: string` - `trace_id: optional string` W3C trace id when one was recorded. Correlation only; never authorization. - `created_at: string` - `endpoint_id: string` - `event_id: string` - `event_kind: string` - `observed_attempt_count: number` Applied attempt verdicts retained below. - `seq_from: number` - `seq_to: number` - `spent_attempt_count: number` Attempts spent by the delivery machine, including leases that expired without an applied verdict. - `state: string` `pending`, `delivering`, `delivered`, `permanent_refusal`, or `retry_exhausted`. - `chat_id: optional string` - `next_attempt_at: optional string` Present only while `state` is `pending`: the instant the next attempt becomes due. A value in the future is a delivery backing off after a failed attempt; a value at or before now is a delivery that is due and waiting — usually behind an earlier delivery to the same endpoint and chat. Deliveries to one endpoint and chat are sent in the order their events were recorded. A `message.received` for a message carrying attachments is recorded once every attachment has been captured or has failed, or ten minutes after the message arrived, whichever comes first. It can therefore follow deliveries for later messages of the same chat, and carry a lower `data.seq_from` than an event you already received: `seq_from` can decrease relative to arrival. Never discard such an event as stale: deduplicate by the event `id`, order a conversation by `data.seq_from`, and for live processing buffer briefly or reconcile with `GET /v1/chats/{chat}/events`. `POST /v1/webhook_deliveries/{delivery}/retry` moves a future value to now. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/webhook_deliveries/$DELIVERY/retry \ -X POST \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` #### Response ```json { "id": "id", "attempt_history_complete": true, "attempts": [ { "attempt": 0, "attempt_completed_at": "2019-12-27T18:11:19.117Z", "attempt_started_at": "2019-12-27T18:11:19.117Z", "destination": "destination", "http_status": 0, "phase": "phase", "reason_code": "reason_code", "verdict": "verdict", "wire_completed_at": "2019-12-27T18:11:19.117Z", "wire_duration_ms": 0, "wire_started_at": "2019-12-27T18:11:19.117Z", "trace_id": "trace_id" } ], "created_at": "2019-12-27T18:11:19.117Z", "endpoint_id": "endpoint_id", "event_id": "event_id", "event_kind": "event_kind", "observed_attempt_count": 0, "seq_from": 0, "seq_to": 0, "spent_attempt_count": 0, "state": "state", "chat_id": "chat_id", "next_attempt_at": "2019-12-27T18:11:19.117Z" } ``` --- # Webhook Endpoints URL: https://docs.linqapp.com/channel/whatsapp/api/resources/webhook_endpoints/ ## Register a webhook endpoint **post** `/v1/webhook_endpoints` Registers a destination for this brand's events and mints its signing secret. The `201` body carries the secret in plain text, and that is the only time it is ever shown: store it where your receiver can read it before you finish the call. Verify with any Standard Webhooks library. The URL is checked here so an unusable one is refused synchronously rather than becoming silent delivery failures — but the check is a courtesy, not the boundary: every attempt re-checks the address it is actually about to connect to, so a name that resolves somewhere else later is still refused then. Cleartext endpoints are never deliverable: `http://` is refused here and the scheme is checked again before every attempt. Loopback and private addresses are refused too, so a receiver running only on localhost cannot use webhooks. Use `GET /v1/streams/events` while developing locally, until you have a public TLS endpoint. A live endpoint needs the account's messaging account to be connected: until connecting it has finished, registration is refused with `409 webhook_account_not_connected` and nothing is created. ### Body Parameters - `url: string` Where to POST events. Must be absolute and `https`, and must not carry credentials in the url. **What is checked WHEN.** Registration refuses the faults that are visible in the url itself: the scheme, credentials, and a literal IP address that is private, loopback or link-local. It does NOT resolve hostnames, so a NAME pointing at a private address is accepted here and refused later, at every delivery attempt, when the address it actually resolves to is checked immediately before the connection is made. That second check is the one that is load-bearing, and it cannot be done at registration: a name can resolve differently a second after you register it. So a synchronous `422` means the url can never work. A `201` means it looked fine — watch the endpoint's health for what happened next. - `description: optional string` Your own label for this endpoint. Text a human reads: control characters are refused. - `event_kinds: optional array of string` The event kinds to deliver here. Omit it — or send an empty array — for every kind, including kinds added later, which is what most integrations want. Kinds are the same values the stream's `event:` carries. - `phone_number_ids: optional array of string` The phone numbers whose events to deliver here. Omit it — or send an empty array — for every current and future number, which is what most integrations want. A non-empty list names exact phone-number ids from `GET /v1/phone_numbers` for this account and mode. An id this account cannot use — unknown, belonging to another account or to the other mode, or not an active number of this account — is refused with HTTP 422 (`webhook_phone_number_not_found`) pointered at the list, `/phone_number_ids`, never at the id, so the refusal discloses nothing about whose number it is; only an id that is malformed (empty, or over 128 bytes) is pointered at its own index, `/phone_number_ids/{i}`, before any lookup. Nothing is created. Account-wide events that carry no phone number go only to an unscoped endpoint. ### Returns - `EndpointCreated object { id, created_at, disabled_at, 11 more }` A newly registered endpoint, together with its signing secret. The secret appears in this response and never again. - `id: string` The endpoint's id. - `created_at: string` - `disabled_at: string` When this endpoint was last disabled. `null` while it is enabled. - `event_kinds: array of string` The event kinds delivered here, or `null` for every kind (including kinds added later). - `health: EndpointHealth` How a destination has been behaving, taken from the deliveries actually attempted against it. Worth reading before assuming an integration is healthy: a destination that has been refusing events shows up here well before anyone notices they are missing. - `consecutive_failures: number` Failed attempts since the last success. Reset to 0 by any success. - `last_failure_at: string` When a delivery to this endpoint last failed. `null` if none ever has. - `last_failure_reason: string` A short reason for the last failure, written for a human reading it. The wording is not stable; do not branch on it. - `last_failure_status: number` The HTTP status of that last failure. `null` when the attempt never reached a response at all — a name that did not resolve, a refused connection, a timeout, or an address we will not dial. - `last_success_at: string` When a delivery to this endpoint last succeeded. `null` if none ever has. - `secret: string` The signing secret, in the Standard Webhooks presentation form (`whsec_` followed by base64). **Shown exactly once, here.** It is not recoverable from any later read — if you lose it, add a second secret and retire this one. - `secret_id: string` The id of the secret above — the handle you retire it by. - `status: string` `enabled` or `disabled`. A disabled endpoint receives nothing, and events are not queued for it — see the update operation. Values grow additively. - `updated_at: string` - `url: string` Where events are POSTed. `https` only. - `backlog_dropped: optional number` How many undelivered events were dropped by THIS request, present only on the response to a request that disabled or deleted the endpoint. Disabling is a cutoff: everything still queued for this endpoint is dropped then and there rather than waiting to be replayed later. - `backlog_resume_cursor: optional string` Where to pick the dropped events back up: pass it as the `cursor` query parameter to `GET /v1/streams/events` and the first event you receive is the first one dropped. Present alongside `backlog_dropped` and only then. **Keep it if you rely on webhooks alone.** A webhook carries the event's identity but not its position in the stream, so this response is the only place a push-only integration is handed the position of the gap it just created. Reconnecting without a cursor starts at the present moment and skips the gap entirely. It stays valid while the events behind it are retained; past that the stream answers `410 cursor_expired` rather than pretending. - `description: optional string` Your own label for this endpoint. - `phone_number_ids: optional array of string` The phone numbers whose events are delivered here: the exact registered phone-number ids selected for this destination, or `null` for every current and future number (the default). Ids are the ones `GET /v1/phone_numbers` returns for this account and mode, and every one listed was an active number of this account when it was accepted. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/webhook_endpoints \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" \ -d '{ "url": "url" }' ``` #### Response ```json { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "disabled_at": "2019-12-27T18:11:19.117Z", "event_kinds": [ "string" ], "health": { "consecutive_failures": 0, "last_failure_at": "2019-12-27T18:11:19.117Z", "last_failure_reason": "last_failure_reason", "last_failure_status": 0, "last_success_at": "2019-12-27T18:11:19.117Z" }, "secret": "secret", "secret_id": "secret_id", "status": "status", "updated_at": "2019-12-27T18:11:19.117Z", "url": "url", "backlog_dropped": 0, "backlog_resume_cursor": "backlog_resume_cursor", "description": "description", "phone_number_ids": [ "string" ] } ``` ## Delete a webhook endpoint **delete** `/v1/webhook_endpoints/{endpoint}` Removes an endpoint. Its queued events are dropped, its signing secrets are retired, and its URL becomes free to register again. The response is the endpoint as it was left. ### Path Parameters - `endpoint: string` ### Returns - `Endpoint object { id, created_at, disabled_at, 9 more }` A destination this brand's events are delivered to. - `id: string` The endpoint's id. - `created_at: string` - `disabled_at: string` When this endpoint was last disabled. `null` while it is enabled. - `event_kinds: array of string` The event kinds delivered here, or `null` for every kind (including kinds added later). - `health: EndpointHealth` How a destination has been behaving, taken from the deliveries actually attempted against it. Worth reading before assuming an integration is healthy: a destination that has been refusing events shows up here well before anyone notices they are missing. - `consecutive_failures: number` Failed attempts since the last success. Reset to 0 by any success. - `last_failure_at: string` When a delivery to this endpoint last failed. `null` if none ever has. - `last_failure_reason: string` A short reason for the last failure, written for a human reading it. The wording is not stable; do not branch on it. - `last_failure_status: number` The HTTP status of that last failure. `null` when the attempt never reached a response at all — a name that did not resolve, a refused connection, a timeout, or an address we will not dial. - `last_success_at: string` When a delivery to this endpoint last succeeded. `null` if none ever has. - `status: string` `enabled` or `disabled`. A disabled endpoint receives nothing, and events are not queued for it — see the update operation. Values grow additively. - `updated_at: string` - `url: string` Where events are POSTed. `https` only. - `backlog_dropped: optional number` How many undelivered events were dropped by THIS request, present only on the response to a request that disabled or deleted the endpoint. Disabling is a cutoff: everything still queued for this endpoint is dropped then and there rather than waiting to be replayed later. - `backlog_resume_cursor: optional string` Where to pick the dropped events back up: pass it as the `cursor` query parameter to `GET /v1/streams/events` and the first event you receive is the first one dropped. Present alongside `backlog_dropped` and only then. **Keep it if you rely on webhooks alone.** A webhook carries the event's identity but not its position in the stream, so this response is the only place a push-only integration is handed the position of the gap it just created. Reconnecting without a cursor starts at the present moment and skips the gap entirely. It stays valid while the events behind it are retained; past that the stream answers `410 cursor_expired` rather than pretending. - `description: optional string` Your own label for this endpoint. - `phone_number_ids: optional array of string` The phone numbers whose events are delivered here: the exact registered phone-number ids selected for this destination, or `null` for every current and future number (the default). Ids are the ones `GET /v1/phone_numbers` returns for this account and mode, and every one listed was an active number of this account when it was accepted. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/webhook_endpoints/$ENDPOINT \ -X DELETE \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` #### Response ```json { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "disabled_at": "2019-12-27T18:11:19.117Z", "event_kinds": [ "string" ], "health": { "consecutive_failures": 0, "last_failure_at": "2019-12-27T18:11:19.117Z", "last_failure_reason": "last_failure_reason", "last_failure_status": 0, "last_success_at": "2019-12-27T18:11:19.117Z" }, "status": "status", "updated_at": "2019-12-27T18:11:19.117Z", "url": "url", "backlog_dropped": 0, "backlog_resume_cursor": "backlog_resume_cursor", "description": "description", "phone_number_ids": [ "string" ] } ``` ## List webhook endpoints **get** `/v1/webhook_endpoints` Lists this brand's webhook endpoints, oldest first, each with its delivery health. ### Returns - `EndpointList object { data }` The endpoints registered for this key's brand. - `data: array of Endpoint` - `id: string` The endpoint's id. - `created_at: string` - `disabled_at: string` When this endpoint was last disabled. `null` while it is enabled. - `event_kinds: array of string` The event kinds delivered here, or `null` for every kind (including kinds added later). - `health: EndpointHealth` How a destination has been behaving, taken from the deliveries actually attempted against it. Worth reading before assuming an integration is healthy: a destination that has been refusing events shows up here well before anyone notices they are missing. - `consecutive_failures: number` Failed attempts since the last success. Reset to 0 by any success. - `last_failure_at: string` When a delivery to this endpoint last failed. `null` if none ever has. - `last_failure_reason: string` A short reason for the last failure, written for a human reading it. The wording is not stable; do not branch on it. - `last_failure_status: number` The HTTP status of that last failure. `null` when the attempt never reached a response at all — a name that did not resolve, a refused connection, a timeout, or an address we will not dial. - `last_success_at: string` When a delivery to this endpoint last succeeded. `null` if none ever has. - `status: string` `enabled` or `disabled`. A disabled endpoint receives nothing, and events are not queued for it — see the update operation. Values grow additively. - `updated_at: string` - `url: string` Where events are POSTed. `https` only. - `backlog_dropped: optional number` How many undelivered events were dropped by THIS request, present only on the response to a request that disabled or deleted the endpoint. Disabling is a cutoff: everything still queued for this endpoint is dropped then and there rather than waiting to be replayed later. - `backlog_resume_cursor: optional string` Where to pick the dropped events back up: pass it as the `cursor` query parameter to `GET /v1/streams/events` and the first event you receive is the first one dropped. Present alongside `backlog_dropped` and only then. **Keep it if you rely on webhooks alone.** A webhook carries the event's identity but not its position in the stream, so this response is the only place a push-only integration is handed the position of the gap it just created. Reconnecting without a cursor starts at the present moment and skips the gap entirely. It stays valid while the events behind it are retained; past that the stream answers `410 cursor_expired` rather than pretending. - `description: optional string` Your own label for this endpoint. - `phone_number_ids: optional array of string` The phone numbers whose events are delivered here: the exact registered phone-number ids selected for this destination, or `null` for every current and future number (the default). Ids are the ones `GET /v1/phone_numbers` returns for this account and mode, and every one listed was an active number of this account when it was accepted. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/webhook_endpoints \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` #### Response ```json { "data": [ { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "disabled_at": "2019-12-27T18:11:19.117Z", "event_kinds": [ "string" ], "health": { "consecutive_failures": 0, "last_failure_at": "2019-12-27T18:11:19.117Z", "last_failure_reason": "last_failure_reason", "last_failure_status": 0, "last_success_at": "2019-12-27T18:11:19.117Z" }, "status": "status", "updated_at": "2019-12-27T18:11:19.117Z", "url": "url", "backlog_dropped": 0, "backlog_resume_cursor": "backlog_resume_cursor", "description": "description", "phone_number_ids": [ "string" ] } ] } ``` ## Get a webhook endpoint **get** `/v1/webhook_endpoints/{endpoint}` Reads one endpoint, including its delivery health. ### Path Parameters - `endpoint: string` ### Returns - `Endpoint object { id, created_at, disabled_at, 9 more }` A destination this brand's events are delivered to. - `id: string` The endpoint's id. - `created_at: string` - `disabled_at: string` When this endpoint was last disabled. `null` while it is enabled. - `event_kinds: array of string` The event kinds delivered here, or `null` for every kind (including kinds added later). - `health: EndpointHealth` How a destination has been behaving, taken from the deliveries actually attempted against it. Worth reading before assuming an integration is healthy: a destination that has been refusing events shows up here well before anyone notices they are missing. - `consecutive_failures: number` Failed attempts since the last success. Reset to 0 by any success. - `last_failure_at: string` When a delivery to this endpoint last failed. `null` if none ever has. - `last_failure_reason: string` A short reason for the last failure, written for a human reading it. The wording is not stable; do not branch on it. - `last_failure_status: number` The HTTP status of that last failure. `null` when the attempt never reached a response at all — a name that did not resolve, a refused connection, a timeout, or an address we will not dial. - `last_success_at: string` When a delivery to this endpoint last succeeded. `null` if none ever has. - `status: string` `enabled` or `disabled`. A disabled endpoint receives nothing, and events are not queued for it — see the update operation. Values grow additively. - `updated_at: string` - `url: string` Where events are POSTed. `https` only. - `backlog_dropped: optional number` How many undelivered events were dropped by THIS request, present only on the response to a request that disabled or deleted the endpoint. Disabling is a cutoff: everything still queued for this endpoint is dropped then and there rather than waiting to be replayed later. - `backlog_resume_cursor: optional string` Where to pick the dropped events back up: pass it as the `cursor` query parameter to `GET /v1/streams/events` and the first event you receive is the first one dropped. Present alongside `backlog_dropped` and only then. **Keep it if you rely on webhooks alone.** A webhook carries the event's identity but not its position in the stream, so this response is the only place a push-only integration is handed the position of the gap it just created. Reconnecting without a cursor starts at the present moment and skips the gap entirely. It stays valid while the events behind it are retained; past that the stream answers `410 cursor_expired` rather than pretending. - `description: optional string` Your own label for this endpoint. - `phone_number_ids: optional array of string` The phone numbers whose events are delivered here: the exact registered phone-number ids selected for this destination, or `null` for every current and future number (the default). Ids are the ones `GET /v1/phone_numbers` returns for this account and mode, and every one listed was an active number of this account when it was accepted. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/webhook_endpoints/$ENDPOINT \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` #### Response ```json { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "disabled_at": "2019-12-27T18:11:19.117Z", "event_kinds": [ "string" ], "health": { "consecutive_failures": 0, "last_failure_at": "2019-12-27T18:11:19.117Z", "last_failure_reason": "last_failure_reason", "last_failure_status": 0, "last_success_at": "2019-12-27T18:11:19.117Z" }, "status": "status", "updated_at": "2019-12-27T18:11:19.117Z", "url": "url", "backlog_dropped": 0, "backlog_resume_cursor": "backlog_resume_cursor", "description": "description", "phone_number_ids": [ "string" ] } ``` ## Update a webhook endpoint **patch** `/v1/webhook_endpoints/{endpoint}` Updates an endpoint: its destination, its label, which kinds it receives, or whether it is enabled. Read `status` before disabling anything — disabling drops what is queued. While the account has no connected messaging account, an update that leaves a live endpoint enabled — including enabling a disabled one — is refused with `409 webhook_account_not_connected` and nothing is changed; disabling or deleting an endpoint is always accepted. ### Path Parameters - `endpoint: string` ### Body Parameters - `description: optional string` A new label. Text a human reads: control characters are refused. - `event_kinds: optional array of string` Replaces the subscription list outright. An empty array means every kind. - `phone_number_ids: optional array of string` Replaces the phone-number subscription outright. An empty array restores every current and future number; a non-empty list is validated exactly as at registration (HTTP 422 `webhook_phone_number_not_found`, pointered at the list for an id this account cannot use — unknown, another account's, the other mode's, or not active — and at its own index only for a malformed id; the endpoint is unchanged). The change affects only events fanned out after this update: deliveries already queued keep their destination, and a replay accepted earlier keeps the subscription it was accepted under. - `status: optional string` `enabled` or `disabled`. **Disabling is a cutoff, not a pause.** Every event still queued for this endpoint is dropped when you disable it, and while it is disabled no new event is queued for it. Enabling it again resumes with what happens next — there is no backlog to replay, by design: a destination that has just come back up is the worst possible moment to hand it hours of stale events in one burst. **Nothing is lost, and the response tells you how to get it.** `backlog_dropped` says how many events were dropped and `backlog_resume_cursor` says where they start; pass that cursor to `GET /v1/streams/events` to read them. Keep it — a webhook does not carry a stream position, so this response is the only place a push-only integration is handed one. One delivery may still arrive after this call returns: an attempt already on the wire cannot be recalled, and it is counted in `backlog_dropped` even if it lands. The count is an upper bound on what was lost. - `url: optional string` A new destination. Validated exactly as at registration. Events already queued go to the new url — a delivery in flight when you change it re-reads the endpoint before it dials, so it follows the change too. ### Returns - `Endpoint object { id, created_at, disabled_at, 9 more }` A destination this brand's events are delivered to. - `id: string` The endpoint's id. - `created_at: string` - `disabled_at: string` When this endpoint was last disabled. `null` while it is enabled. - `event_kinds: array of string` The event kinds delivered here, or `null` for every kind (including kinds added later). - `health: EndpointHealth` How a destination has been behaving, taken from the deliveries actually attempted against it. Worth reading before assuming an integration is healthy: a destination that has been refusing events shows up here well before anyone notices they are missing. - `consecutive_failures: number` Failed attempts since the last success. Reset to 0 by any success. - `last_failure_at: string` When a delivery to this endpoint last failed. `null` if none ever has. - `last_failure_reason: string` A short reason for the last failure, written for a human reading it. The wording is not stable; do not branch on it. - `last_failure_status: number` The HTTP status of that last failure. `null` when the attempt never reached a response at all — a name that did not resolve, a refused connection, a timeout, or an address we will not dial. - `last_success_at: string` When a delivery to this endpoint last succeeded. `null` if none ever has. - `status: string` `enabled` or `disabled`. A disabled endpoint receives nothing, and events are not queued for it — see the update operation. Values grow additively. - `updated_at: string` - `url: string` Where events are POSTed. `https` only. - `backlog_dropped: optional number` How many undelivered events were dropped by THIS request, present only on the response to a request that disabled or deleted the endpoint. Disabling is a cutoff: everything still queued for this endpoint is dropped then and there rather than waiting to be replayed later. - `backlog_resume_cursor: optional string` Where to pick the dropped events back up: pass it as the `cursor` query parameter to `GET /v1/streams/events` and the first event you receive is the first one dropped. Present alongside `backlog_dropped` and only then. **Keep it if you rely on webhooks alone.** A webhook carries the event's identity but not its position in the stream, so this response is the only place a push-only integration is handed the position of the gap it just created. Reconnecting without a cursor starts at the present moment and skips the gap entirely. It stays valid while the events behind it are retained; past that the stream answers `410 cursor_expired` rather than pretending. - `description: optional string` Your own label for this endpoint. - `phone_number_ids: optional array of string` The phone numbers whose events are delivered here: the exact registered phone-number ids selected for this destination, or `null` for every current and future number (the default). Ids are the ones `GET /v1/phone_numbers` returns for this account and mode, and every one listed was an active number of this account when it was accepted. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/webhook_endpoints/$ENDPOINT \ -X PATCH \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" \ -d '{}' ``` #### Response ```json { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "disabled_at": "2019-12-27T18:11:19.117Z", "event_kinds": [ "string" ], "health": { "consecutive_failures": 0, "last_failure_at": "2019-12-27T18:11:19.117Z", "last_failure_reason": "last_failure_reason", "last_failure_status": 0, "last_success_at": "2019-12-27T18:11:19.117Z" }, "status": "status", "updated_at": "2019-12-27T18:11:19.117Z", "url": "url", "backlog_dropped": 0, "backlog_resume_cursor": "backlog_resume_cursor", "description": "description", "phone_number_ids": [ "string" ] } ``` ## Domain Types ### Endpoint - `Endpoint object { id, created_at, disabled_at, 9 more }` A destination this brand's events are delivered to. - `id: string` The endpoint's id. - `created_at: string` - `disabled_at: string` When this endpoint was last disabled. `null` while it is enabled. - `event_kinds: array of string` The event kinds delivered here, or `null` for every kind (including kinds added later). - `health: EndpointHealth` How a destination has been behaving, taken from the deliveries actually attempted against it. Worth reading before assuming an integration is healthy: a destination that has been refusing events shows up here well before anyone notices they are missing. - `consecutive_failures: number` Failed attempts since the last success. Reset to 0 by any success. - `last_failure_at: string` When a delivery to this endpoint last failed. `null` if none ever has. - `last_failure_reason: string` A short reason for the last failure, written for a human reading it. The wording is not stable; do not branch on it. - `last_failure_status: number` The HTTP status of that last failure. `null` when the attempt never reached a response at all — a name that did not resolve, a refused connection, a timeout, or an address we will not dial. - `last_success_at: string` When a delivery to this endpoint last succeeded. `null` if none ever has. - `status: string` `enabled` or `disabled`. A disabled endpoint receives nothing, and events are not queued for it — see the update operation. Values grow additively. - `updated_at: string` - `url: string` Where events are POSTed. `https` only. - `backlog_dropped: optional number` How many undelivered events were dropped by THIS request, present only on the response to a request that disabled or deleted the endpoint. Disabling is a cutoff: everything still queued for this endpoint is dropped then and there rather than waiting to be replayed later. - `backlog_resume_cursor: optional string` Where to pick the dropped events back up: pass it as the `cursor` query parameter to `GET /v1/streams/events` and the first event you receive is the first one dropped. Present alongside `backlog_dropped` and only then. **Keep it if you rely on webhooks alone.** A webhook carries the event's identity but not its position in the stream, so this response is the only place a push-only integration is handed the position of the gap it just created. Reconnecting without a cursor starts at the present moment and skips the gap entirely. It stays valid while the events behind it are retained; past that the stream answers `410 cursor_expired` rather than pretending. - `description: optional string` Your own label for this endpoint. - `phone_number_ids: optional array of string` The phone numbers whose events are delivered here: the exact registered phone-number ids selected for this destination, or `null` for every current and future number (the default). Ids are the ones `GET /v1/phone_numbers` returns for this account and mode, and every one listed was an active number of this account when it was accepted. ### Endpoint Created - `EndpointCreated object { id, created_at, disabled_at, 11 more }` A newly registered endpoint, together with its signing secret. The secret appears in this response and never again. - `id: string` The endpoint's id. - `created_at: string` - `disabled_at: string` When this endpoint was last disabled. `null` while it is enabled. - `event_kinds: array of string` The event kinds delivered here, or `null` for every kind (including kinds added later). - `health: EndpointHealth` How a destination has been behaving, taken from the deliveries actually attempted against it. Worth reading before assuming an integration is healthy: a destination that has been refusing events shows up here well before anyone notices they are missing. - `consecutive_failures: number` Failed attempts since the last success. Reset to 0 by any success. - `last_failure_at: string` When a delivery to this endpoint last failed. `null` if none ever has. - `last_failure_reason: string` A short reason for the last failure, written for a human reading it. The wording is not stable; do not branch on it. - `last_failure_status: number` The HTTP status of that last failure. `null` when the attempt never reached a response at all — a name that did not resolve, a refused connection, a timeout, or an address we will not dial. - `last_success_at: string` When a delivery to this endpoint last succeeded. `null` if none ever has. - `secret: string` The signing secret, in the Standard Webhooks presentation form (`whsec_` followed by base64). **Shown exactly once, here.** It is not recoverable from any later read — if you lose it, add a second secret and retire this one. - `secret_id: string` The id of the secret above — the handle you retire it by. - `status: string` `enabled` or `disabled`. A disabled endpoint receives nothing, and events are not queued for it — see the update operation. Values grow additively. - `updated_at: string` - `url: string` Where events are POSTed. `https` only. - `backlog_dropped: optional number` How many undelivered events were dropped by THIS request, present only on the response to a request that disabled or deleted the endpoint. Disabling is a cutoff: everything still queued for this endpoint is dropped then and there rather than waiting to be replayed later. - `backlog_resume_cursor: optional string` Where to pick the dropped events back up: pass it as the `cursor` query parameter to `GET /v1/streams/events` and the first event you receive is the first one dropped. Present alongside `backlog_dropped` and only then. **Keep it if you rely on webhooks alone.** A webhook carries the event's identity but not its position in the stream, so this response is the only place a push-only integration is handed the position of the gap it just created. Reconnecting without a cursor starts at the present moment and skips the gap entirely. It stays valid while the events behind it are retained; past that the stream answers `410 cursor_expired` rather than pretending. - `description: optional string` Your own label for this endpoint. - `phone_number_ids: optional array of string` The phone numbers whose events are delivered here: the exact registered phone-number ids selected for this destination, or `null` for every current and future number (the default). Ids are the ones `GET /v1/phone_numbers` returns for this account and mode, and every one listed was an active number of this account when it was accepted. ### Endpoint Health - `EndpointHealth object { consecutive_failures, last_failure_at, last_failure_reason, 2 more }` How a destination has been behaving, taken from the deliveries actually attempted against it. Worth reading before assuming an integration is healthy: a destination that has been refusing events shows up here well before anyone notices they are missing. - `consecutive_failures: number` Failed attempts since the last success. Reset to 0 by any success. - `last_failure_at: string` When a delivery to this endpoint last failed. `null` if none ever has. - `last_failure_reason: string` A short reason for the last failure, written for a human reading it. The wording is not stable; do not branch on it. - `last_failure_status: number` The HTTP status of that last failure. `null` when the attempt never reached a response at all — a name that did not resolve, a refused connection, a timeout, or an address we will not dial. - `last_success_at: string` When a delivery to this endpoint last succeeded. `null` if none ever has. ### Endpoint List - `EndpointList object { data }` The endpoints registered for this key's brand. - `data: array of Endpoint` - `id: string` The endpoint's id. - `created_at: string` - `disabled_at: string` When this endpoint was last disabled. `null` while it is enabled. - `event_kinds: array of string` The event kinds delivered here, or `null` for every kind (including kinds added later). - `health: EndpointHealth` How a destination has been behaving, taken from the deliveries actually attempted against it. Worth reading before assuming an integration is healthy: a destination that has been refusing events shows up here well before anyone notices they are missing. - `consecutive_failures: number` Failed attempts since the last success. Reset to 0 by any success. - `last_failure_at: string` When a delivery to this endpoint last failed. `null` if none ever has. - `last_failure_reason: string` A short reason for the last failure, written for a human reading it. The wording is not stable; do not branch on it. - `last_failure_status: number` The HTTP status of that last failure. `null` when the attempt never reached a response at all — a name that did not resolve, a refused connection, a timeout, or an address we will not dial. - `last_success_at: string` When a delivery to this endpoint last succeeded. `null` if none ever has. - `status: string` `enabled` or `disabled`. A disabled endpoint receives nothing, and events are not queued for it — see the update operation. Values grow additively. - `updated_at: string` - `url: string` Where events are POSTed. `https` only. - `backlog_dropped: optional number` How many undelivered events were dropped by THIS request, present only on the response to a request that disabled or deleted the endpoint. Disabling is a cutoff: everything still queued for this endpoint is dropped then and there rather than waiting to be replayed later. - `backlog_resume_cursor: optional string` Where to pick the dropped events back up: pass it as the `cursor` query parameter to `GET /v1/streams/events` and the first event you receive is the first one dropped. Present alongside `backlog_dropped` and only then. **Keep it if you rely on webhooks alone.** A webhook carries the event's identity but not its position in the stream, so this response is the only place a push-only integration is handed the position of the gap it just created. Reconnecting without a cursor starts at the present moment and skips the gap entirely. It stays valid while the events behind it are retained; past that the stream answers `410 cursor_expired` rather than pretending. - `description: optional string` Your own label for this endpoint. - `phone_number_ids: optional array of string` The phone numbers whose events are delivered here: the exact registered phone-number ids selected for this destination, or `null` for every current and future number (the default). Ids are the ones `GET /v1/phone_numbers` returns for this account and mode, and every one listed was an active number of this account when it was accepted. # Replays ## Replay retained webhook events **post** `/v1/webhook_endpoints/{endpoint}/replays` Accept a bounded replay of events still present in account history. Account-event history has no published minimum retention period yet. Retrying the same acceptance key recovers its response for 24 hours. ### Path Parameters - `endpoint: string` ### Header Parameters - `"Idempotency-Key": string` ### Body Parameters - `after_cursor: optional string` Exclusive event-log cursor. Omit to begin inclusively at retained history. - `through_cursor: optional string` Inclusive event-log cursor. Omit to snapshot the committed tail. ### Returns - `ReplayAcceptance object { id, after_cursor, created_at, 3 more }` - `id: string` - `after_cursor: string` - `created_at: string` - `selected: number` - `state: "pending"` - `"pending"` - `through_cursor: string` ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/webhook_endpoints/$ENDPOINT/replays \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" \ -d '{}' ``` #### Response ```json { "id": "id", "after_cursor": "after_cursor", "created_at": "2019-12-27T18:11:19.117Z", "selected": 0, "state": "pending", "through_cursor": "through_cursor" } ``` ## Get webhook replay status **get** `/v1/webhook_endpoints/{endpoint}/replays/{replay}` Read durable replay progress and its immutable terminal verdict. During ordinary operation, a successfully completed replay remains readable for at least 30 days after `terminal_at`, then returns the same tenant-scoped 404 as an unknown replay. Pending and running replays are never age-swept; failed replay evidence has no scheduled expiry. ### Path Parameters - `endpoint: string` - `replay: string` ### Returns - `Replay object { id, after_cursor, created_at, 12 more }` - `id: string` - `after_cursor: string` - `created_at: string` - `delivered: number` - `delivering: number` - `exhausted: number` - `failure_reason: string` - `materialized: number` - `pending: number` - `selected: number` - `started_at: string` - `state: "pending" or "running" or "completed" or "failed"` - `"pending"` - `"running"` - `"completed"` - `"failed"` - `terminal_at: string` - `through_cursor: string` - `unmaterialized: number` ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/webhook_endpoints/$ENDPOINT/replays/$REPLAY \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` #### Response ```json { "id": "id", "after_cursor": "after_cursor", "created_at": "2019-12-27T18:11:19.117Z", "delivered": 0, "delivering": 0, "exhausted": 0, "failure_reason": "failure_reason", "materialized": 0, "pending": 0, "selected": 0, "started_at": "2019-12-27T18:11:19.117Z", "state": "pending", "terminal_at": "2019-12-27T18:11:19.117Z", "through_cursor": "through_cursor", "unmaterialized": 0 } ``` ## Domain Types ### Replay - `Replay object { id, after_cursor, created_at, 12 more }` - `id: string` - `after_cursor: string` - `created_at: string` - `delivered: number` - `delivering: number` - `exhausted: number` - `failure_reason: string` - `materialized: number` - `pending: number` - `selected: number` - `started_at: string` - `state: "pending" or "running" or "completed" or "failed"` - `"pending"` - `"running"` - `"completed"` - `"failed"` - `terminal_at: string` - `through_cursor: string` - `unmaterialized: number` ### Replay Acceptance - `ReplayAcceptance object { id, after_cursor, created_at, 3 more }` - `id: string` - `after_cursor: string` - `created_at: string` - `selected: number` - `state: "pending"` - `"pending"` - `through_cursor: string` # Secrets ## Add a signing secret **post** `/v1/webhook_endpoints/{endpoint}/secrets` Adds a second signing secret to an endpoint — the first half of a rotation. Every ACTIVE secret signs every event, and all of the signatures ride the one `webhook-signature` header (space delimited). A verifier that accepts any one of them — which is what every Standard Webhooks library does — keeps working throughout. So the rotation is: add a secret here, deploy it to your receiver, confirm traffic is verifying against it, then retire the old one. No delivery is dropped at any point. The signing set is read fresh for each delivery, immediately before it is sent. A delivery already on the wire when this call returns may therefore carry the previous set — the overlap is what makes that harmless, and it is why you deploy the new secret before retiring the old one rather than relying on an instant. An endpoint may hold up to five ACTIVE secrets at once; past that the answer is HTTP 409 `too_many_active_secrets` (a 2xxx `error.code`, 2040). Every one of them signs every event, so the header grows with the count — a rotation needs two, and the rest of the room is for one you started and did not finish. The new secret is shown exactly once, in this response. ### Path Parameters - `endpoint: string` ### Returns - `SigningSecretCreated object { id, created_at, retired_at, 2 more }` A newly added signing secret, with its value — shown exactly once. - `id: string` The secret's id. Safe to log: it is a handle, not key material. - `created_at: string` - `retired_at: string` When this secret stopped signing. `null` while it is active. - `secret: string` The signing secret in presentation form (`whsec_` + base64). **Shown exactly once, here.** - `status: string` `active` or `retired`. Values grow additively. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/webhook_endpoints/$ENDPOINT/secrets \ -X POST \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` #### Response ```json { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "retired_at": "2019-12-27T18:11:19.117Z", "secret": "secret", "status": "status" } ``` ## Retire a signing secret **delete** `/v1/webhook_endpoints/{endpoint}/secrets/{secret}` Retires a signing secret — the second half of a rotation. It stops signing immediately; signatures already sent are unaffected. An endpoint's LAST active secret cannot be retired: an endpoint that could not sign would have to stop delivering, and silently unsigned webhooks are indistinguishable from forgeries. Add the replacement first. ### Path Parameters - `endpoint: string` - `secret: string` ### Returns - `SigningSecret object { id, created_at, retired_at, status }` One signing secret. Every ACTIVE secret signs every event, and all of the signatures ride the one `webhook-signature` header — which is what makes a rotation lossless. - `id: string` The secret's id. Safe to log: it is a handle, not key material. - `created_at: string` - `retired_at: string` When this secret stopped signing. `null` while it is active. - `status: string` `active` or `retired`. Values grow additively. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/webhook_endpoints/$ENDPOINT/secrets/$SECRET \ -X DELETE \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` #### Response ```json { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "retired_at": "2019-12-27T18:11:19.117Z", "status": "status" } ``` ## List signing secrets **get** `/v1/webhook_endpoints/{endpoint}/secrets` Lists an endpoint's signing secrets — ids and status only, never the key material. Oldest first, which is the order their signatures appear in the header. ### Path Parameters - `endpoint: string` ### Returns - `SigningSecretList object { data }` An endpoint's signing secrets, oldest first — the order they sign in. - `data: array of SigningSecret` - `id: string` The secret's id. Safe to log: it is a handle, not key material. - `created_at: string` - `retired_at: string` When this secret stopped signing. `null` while it is active. - `status: string` `active` or `retired`. Values grow additively. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/webhook_endpoints/$ENDPOINT/secrets \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` #### Response ```json { "data": [ { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "retired_at": "2019-12-27T18:11:19.117Z", "status": "status" } ] } ``` ## Domain Types ### Signing Secret - `SigningSecret object { id, created_at, retired_at, status }` One signing secret. Every ACTIVE secret signs every event, and all of the signatures ride the one `webhook-signature` header — which is what makes a rotation lossless. - `id: string` The secret's id. Safe to log: it is a handle, not key material. - `created_at: string` - `retired_at: string` When this secret stopped signing. `null` while it is active. - `status: string` `active` or `retired`. Values grow additively. ### Signing Secret Created - `SigningSecretCreated object { id, created_at, retired_at, 2 more }` A newly added signing secret, with its value — shown exactly once. - `id: string` The secret's id. Safe to log: it is a handle, not key material. - `created_at: string` - `retired_at: string` When this secret stopped signing. `null` while it is active. - `secret: string` The signing secret in presentation form (`whsec_` + base64). **Shown exactly once, here.** - `status: string` `active` or `retired`. Values grow additively. ### Signing Secret List - `SigningSecretList object { data }` An endpoint's signing secrets, oldest first — the order they sign in. - `data: array of SigningSecret` - `id: string` The secret's id. Safe to log: it is a handle, not key material. - `created_at: string` - `retired_at: string` When this secret stopped signing. `null` while it is active. - `status: string` `active` or `retired`. Values grow additively. --- # Register a webhook endpoint URL: https://docs.linqapp.com/channel/whatsapp/api/resources/webhook_endpoints/methods/create/ **post** `/v1/webhook_endpoints` Registers a destination for this brand's events and mints its signing secret. The `201` body carries the secret in plain text, and that is the only time it is ever shown: store it where your receiver can read it before you finish the call. Verify with any Standard Webhooks library. The URL is checked here so an unusable one is refused synchronously rather than becoming silent delivery failures — but the check is a courtesy, not the boundary: every attempt re-checks the address it is actually about to connect to, so a name that resolves somewhere else later is still refused then. Cleartext endpoints are never deliverable: `http://` is refused here and the scheme is checked again before every attempt. Loopback and private addresses are refused too, so a receiver running only on localhost cannot use webhooks. Use `GET /v1/streams/events` while developing locally, until you have a public TLS endpoint. A live endpoint needs the account's messaging account to be connected: until connecting it has finished, registration is refused with `409 webhook_account_not_connected` and nothing is created. ### Body Parameters - `url: string` Where to POST events. Must be absolute and `https`, and must not carry credentials in the url. **What is checked WHEN.** Registration refuses the faults that are visible in the url itself: the scheme, credentials, and a literal IP address that is private, loopback or link-local. It does NOT resolve hostnames, so a NAME pointing at a private address is accepted here and refused later, at every delivery attempt, when the address it actually resolves to is checked immediately before the connection is made. That second check is the one that is load-bearing, and it cannot be done at registration: a name can resolve differently a second after you register it. So a synchronous `422` means the url can never work. A `201` means it looked fine — watch the endpoint's health for what happened next. - `description: optional string` Your own label for this endpoint. Text a human reads: control characters are refused. - `event_kinds: optional array of string` The event kinds to deliver here. Omit it — or send an empty array — for every kind, including kinds added later, which is what most integrations want. Kinds are the same values the stream's `event:` carries. - `phone_number_ids: optional array of string` The phone numbers whose events to deliver here. Omit it — or send an empty array — for every current and future number, which is what most integrations want. A non-empty list names exact phone-number ids from `GET /v1/phone_numbers` for this account and mode. An id this account cannot use — unknown, belonging to another account or to the other mode, or not an active number of this account — is refused with HTTP 422 (`webhook_phone_number_not_found`) pointered at the list, `/phone_number_ids`, never at the id, so the refusal discloses nothing about whose number it is; only an id that is malformed (empty, or over 128 bytes) is pointered at its own index, `/phone_number_ids/{i}`, before any lookup. Nothing is created. Account-wide events that carry no phone number go only to an unscoped endpoint. ### Returns - `EndpointCreated object { id, created_at, disabled_at, 11 more }` A newly registered endpoint, together with its signing secret. The secret appears in this response and never again. - `id: string` The endpoint's id. - `created_at: string` - `disabled_at: string` When this endpoint was last disabled. `null` while it is enabled. - `event_kinds: array of string` The event kinds delivered here, or `null` for every kind (including kinds added later). - `health: EndpointHealth` How a destination has been behaving, taken from the deliveries actually attempted against it. Worth reading before assuming an integration is healthy: a destination that has been refusing events shows up here well before anyone notices they are missing. - `consecutive_failures: number` Failed attempts since the last success. Reset to 0 by any success. - `last_failure_at: string` When a delivery to this endpoint last failed. `null` if none ever has. - `last_failure_reason: string` A short reason for the last failure, written for a human reading it. The wording is not stable; do not branch on it. - `last_failure_status: number` The HTTP status of that last failure. `null` when the attempt never reached a response at all — a name that did not resolve, a refused connection, a timeout, or an address we will not dial. - `last_success_at: string` When a delivery to this endpoint last succeeded. `null` if none ever has. - `secret: string` The signing secret, in the Standard Webhooks presentation form (`whsec_` followed by base64). **Shown exactly once, here.** It is not recoverable from any later read — if you lose it, add a second secret and retire this one. - `secret_id: string` The id of the secret above — the handle you retire it by. - `status: string` `enabled` or `disabled`. A disabled endpoint receives nothing, and events are not queued for it — see the update operation. Values grow additively. - `updated_at: string` - `url: string` Where events are POSTed. `https` only. - `backlog_dropped: optional number` How many undelivered events were dropped by THIS request, present only on the response to a request that disabled or deleted the endpoint. Disabling is a cutoff: everything still queued for this endpoint is dropped then and there rather than waiting to be replayed later. - `backlog_resume_cursor: optional string` Where to pick the dropped events back up: pass it as the `cursor` query parameter to `GET /v1/streams/events` and the first event you receive is the first one dropped. Present alongside `backlog_dropped` and only then. **Keep it if you rely on webhooks alone.** A webhook carries the event's identity but not its position in the stream, so this response is the only place a push-only integration is handed the position of the gap it just created. Reconnecting without a cursor starts at the present moment and skips the gap entirely. It stays valid while the events behind it are retained; past that the stream answers `410 cursor_expired` rather than pretending. - `description: optional string` Your own label for this endpoint. - `phone_number_ids: optional array of string` The phone numbers whose events are delivered here: the exact registered phone-number ids selected for this destination, or `null` for every current and future number (the default). Ids are the ones `GET /v1/phone_numbers` returns for this account and mode, and every one listed was an active number of this account when it was accepted. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/webhook_endpoints \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" \ -d '{ "url": "url" }' ``` #### Response ```json { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "disabled_at": "2019-12-27T18:11:19.117Z", "event_kinds": [ "string" ], "health": { "consecutive_failures": 0, "last_failure_at": "2019-12-27T18:11:19.117Z", "last_failure_reason": "last_failure_reason", "last_failure_status": 0, "last_success_at": "2019-12-27T18:11:19.117Z" }, "secret": "secret", "secret_id": "secret_id", "status": "status", "updated_at": "2019-12-27T18:11:19.117Z", "url": "url", "backlog_dropped": 0, "backlog_resume_cursor": "backlog_resume_cursor", "description": "description", "phone_number_ids": [ "string" ] } ``` --- # Delete a webhook endpoint URL: https://docs.linqapp.com/channel/whatsapp/api/resources/webhook_endpoints/methods/delete/ **delete** `/v1/webhook_endpoints/{endpoint}` Removes an endpoint. Its queued events are dropped, its signing secrets are retired, and its URL becomes free to register again. The response is the endpoint as it was left. ### Path Parameters - `endpoint: string` ### Returns - `Endpoint object { id, created_at, disabled_at, 9 more }` A destination this brand's events are delivered to. - `id: string` The endpoint's id. - `created_at: string` - `disabled_at: string` When this endpoint was last disabled. `null` while it is enabled. - `event_kinds: array of string` The event kinds delivered here, or `null` for every kind (including kinds added later). - `health: EndpointHealth` How a destination has been behaving, taken from the deliveries actually attempted against it. Worth reading before assuming an integration is healthy: a destination that has been refusing events shows up here well before anyone notices they are missing. - `consecutive_failures: number` Failed attempts since the last success. Reset to 0 by any success. - `last_failure_at: string` When a delivery to this endpoint last failed. `null` if none ever has. - `last_failure_reason: string` A short reason for the last failure, written for a human reading it. The wording is not stable; do not branch on it. - `last_failure_status: number` The HTTP status of that last failure. `null` when the attempt never reached a response at all — a name that did not resolve, a refused connection, a timeout, or an address we will not dial. - `last_success_at: string` When a delivery to this endpoint last succeeded. `null` if none ever has. - `status: string` `enabled` or `disabled`. A disabled endpoint receives nothing, and events are not queued for it — see the update operation. Values grow additively. - `updated_at: string` - `url: string` Where events are POSTed. `https` only. - `backlog_dropped: optional number` How many undelivered events were dropped by THIS request, present only on the response to a request that disabled or deleted the endpoint. Disabling is a cutoff: everything still queued for this endpoint is dropped then and there rather than waiting to be replayed later. - `backlog_resume_cursor: optional string` Where to pick the dropped events back up: pass it as the `cursor` query parameter to `GET /v1/streams/events` and the first event you receive is the first one dropped. Present alongside `backlog_dropped` and only then. **Keep it if you rely on webhooks alone.** A webhook carries the event's identity but not its position in the stream, so this response is the only place a push-only integration is handed the position of the gap it just created. Reconnecting without a cursor starts at the present moment and skips the gap entirely. It stays valid while the events behind it are retained; past that the stream answers `410 cursor_expired` rather than pretending. - `description: optional string` Your own label for this endpoint. - `phone_number_ids: optional array of string` The phone numbers whose events are delivered here: the exact registered phone-number ids selected for this destination, or `null` for every current and future number (the default). Ids are the ones `GET /v1/phone_numbers` returns for this account and mode, and every one listed was an active number of this account when it was accepted. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/webhook_endpoints/$ENDPOINT \ -X DELETE \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` #### Response ```json { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "disabled_at": "2019-12-27T18:11:19.117Z", "event_kinds": [ "string" ], "health": { "consecutive_failures": 0, "last_failure_at": "2019-12-27T18:11:19.117Z", "last_failure_reason": "last_failure_reason", "last_failure_status": 0, "last_success_at": "2019-12-27T18:11:19.117Z" }, "status": "status", "updated_at": "2019-12-27T18:11:19.117Z", "url": "url", "backlog_dropped": 0, "backlog_resume_cursor": "backlog_resume_cursor", "description": "description", "phone_number_ids": [ "string" ] } ``` --- # List webhook endpoints URL: https://docs.linqapp.com/channel/whatsapp/api/resources/webhook_endpoints/methods/list/ **get** `/v1/webhook_endpoints` Lists this brand's webhook endpoints, oldest first, each with its delivery health. ### Returns - `EndpointList object { data }` The endpoints registered for this key's brand. - `data: array of Endpoint` - `id: string` The endpoint's id. - `created_at: string` - `disabled_at: string` When this endpoint was last disabled. `null` while it is enabled. - `event_kinds: array of string` The event kinds delivered here, or `null` for every kind (including kinds added later). - `health: EndpointHealth` How a destination has been behaving, taken from the deliveries actually attempted against it. Worth reading before assuming an integration is healthy: a destination that has been refusing events shows up here well before anyone notices they are missing. - `consecutive_failures: number` Failed attempts since the last success. Reset to 0 by any success. - `last_failure_at: string` When a delivery to this endpoint last failed. `null` if none ever has. - `last_failure_reason: string` A short reason for the last failure, written for a human reading it. The wording is not stable; do not branch on it. - `last_failure_status: number` The HTTP status of that last failure. `null` when the attempt never reached a response at all — a name that did not resolve, a refused connection, a timeout, or an address we will not dial. - `last_success_at: string` When a delivery to this endpoint last succeeded. `null` if none ever has. - `status: string` `enabled` or `disabled`. A disabled endpoint receives nothing, and events are not queued for it — see the update operation. Values grow additively. - `updated_at: string` - `url: string` Where events are POSTed. `https` only. - `backlog_dropped: optional number` How many undelivered events were dropped by THIS request, present only on the response to a request that disabled or deleted the endpoint. Disabling is a cutoff: everything still queued for this endpoint is dropped then and there rather than waiting to be replayed later. - `backlog_resume_cursor: optional string` Where to pick the dropped events back up: pass it as the `cursor` query parameter to `GET /v1/streams/events` and the first event you receive is the first one dropped. Present alongside `backlog_dropped` and only then. **Keep it if you rely on webhooks alone.** A webhook carries the event's identity but not its position in the stream, so this response is the only place a push-only integration is handed the position of the gap it just created. Reconnecting without a cursor starts at the present moment and skips the gap entirely. It stays valid while the events behind it are retained; past that the stream answers `410 cursor_expired` rather than pretending. - `description: optional string` Your own label for this endpoint. - `phone_number_ids: optional array of string` The phone numbers whose events are delivered here: the exact registered phone-number ids selected for this destination, or `null` for every current and future number (the default). Ids are the ones `GET /v1/phone_numbers` returns for this account and mode, and every one listed was an active number of this account when it was accepted. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/webhook_endpoints \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` #### Response ```json { "data": [ { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "disabled_at": "2019-12-27T18:11:19.117Z", "event_kinds": [ "string" ], "health": { "consecutive_failures": 0, "last_failure_at": "2019-12-27T18:11:19.117Z", "last_failure_reason": "last_failure_reason", "last_failure_status": 0, "last_success_at": "2019-12-27T18:11:19.117Z" }, "status": "status", "updated_at": "2019-12-27T18:11:19.117Z", "url": "url", "backlog_dropped": 0, "backlog_resume_cursor": "backlog_resume_cursor", "description": "description", "phone_number_ids": [ "string" ] } ] } ``` --- # Get a webhook endpoint URL: https://docs.linqapp.com/channel/whatsapp/api/resources/webhook_endpoints/methods/retrieve/ **get** `/v1/webhook_endpoints/{endpoint}` Reads one endpoint, including its delivery health. ### Path Parameters - `endpoint: string` ### Returns - `Endpoint object { id, created_at, disabled_at, 9 more }` A destination this brand's events are delivered to. - `id: string` The endpoint's id. - `created_at: string` - `disabled_at: string` When this endpoint was last disabled. `null` while it is enabled. - `event_kinds: array of string` The event kinds delivered here, or `null` for every kind (including kinds added later). - `health: EndpointHealth` How a destination has been behaving, taken from the deliveries actually attempted against it. Worth reading before assuming an integration is healthy: a destination that has been refusing events shows up here well before anyone notices they are missing. - `consecutive_failures: number` Failed attempts since the last success. Reset to 0 by any success. - `last_failure_at: string` When a delivery to this endpoint last failed. `null` if none ever has. - `last_failure_reason: string` A short reason for the last failure, written for a human reading it. The wording is not stable; do not branch on it. - `last_failure_status: number` The HTTP status of that last failure. `null` when the attempt never reached a response at all — a name that did not resolve, a refused connection, a timeout, or an address we will not dial. - `last_success_at: string` When a delivery to this endpoint last succeeded. `null` if none ever has. - `status: string` `enabled` or `disabled`. A disabled endpoint receives nothing, and events are not queued for it — see the update operation. Values grow additively. - `updated_at: string` - `url: string` Where events are POSTed. `https` only. - `backlog_dropped: optional number` How many undelivered events were dropped by THIS request, present only on the response to a request that disabled or deleted the endpoint. Disabling is a cutoff: everything still queued for this endpoint is dropped then and there rather than waiting to be replayed later. - `backlog_resume_cursor: optional string` Where to pick the dropped events back up: pass it as the `cursor` query parameter to `GET /v1/streams/events` and the first event you receive is the first one dropped. Present alongside `backlog_dropped` and only then. **Keep it if you rely on webhooks alone.** A webhook carries the event's identity but not its position in the stream, so this response is the only place a push-only integration is handed the position of the gap it just created. Reconnecting without a cursor starts at the present moment and skips the gap entirely. It stays valid while the events behind it are retained; past that the stream answers `410 cursor_expired` rather than pretending. - `description: optional string` Your own label for this endpoint. - `phone_number_ids: optional array of string` The phone numbers whose events are delivered here: the exact registered phone-number ids selected for this destination, or `null` for every current and future number (the default). Ids are the ones `GET /v1/phone_numbers` returns for this account and mode, and every one listed was an active number of this account when it was accepted. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/webhook_endpoints/$ENDPOINT \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` #### Response ```json { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "disabled_at": "2019-12-27T18:11:19.117Z", "event_kinds": [ "string" ], "health": { "consecutive_failures": 0, "last_failure_at": "2019-12-27T18:11:19.117Z", "last_failure_reason": "last_failure_reason", "last_failure_status": 0, "last_success_at": "2019-12-27T18:11:19.117Z" }, "status": "status", "updated_at": "2019-12-27T18:11:19.117Z", "url": "url", "backlog_dropped": 0, "backlog_resume_cursor": "backlog_resume_cursor", "description": "description", "phone_number_ids": [ "string" ] } ``` --- # Update a webhook endpoint URL: https://docs.linqapp.com/channel/whatsapp/api/resources/webhook_endpoints/methods/update/ **patch** `/v1/webhook_endpoints/{endpoint}` Updates an endpoint: its destination, its label, which kinds it receives, or whether it is enabled. Read `status` before disabling anything — disabling drops what is queued. While the account has no connected messaging account, an update that leaves a live endpoint enabled — including enabling a disabled one — is refused with `409 webhook_account_not_connected` and nothing is changed; disabling or deleting an endpoint is always accepted. ### Path Parameters - `endpoint: string` ### Body Parameters - `description: optional string` A new label. Text a human reads: control characters are refused. - `event_kinds: optional array of string` Replaces the subscription list outright. An empty array means every kind. - `phone_number_ids: optional array of string` Replaces the phone-number subscription outright. An empty array restores every current and future number; a non-empty list is validated exactly as at registration (HTTP 422 `webhook_phone_number_not_found`, pointered at the list for an id this account cannot use — unknown, another account's, the other mode's, or not active — and at its own index only for a malformed id; the endpoint is unchanged). The change affects only events fanned out after this update: deliveries already queued keep their destination, and a replay accepted earlier keeps the subscription it was accepted under. - `status: optional string` `enabled` or `disabled`. **Disabling is a cutoff, not a pause.** Every event still queued for this endpoint is dropped when you disable it, and while it is disabled no new event is queued for it. Enabling it again resumes with what happens next — there is no backlog to replay, by design: a destination that has just come back up is the worst possible moment to hand it hours of stale events in one burst. **Nothing is lost, and the response tells you how to get it.** `backlog_dropped` says how many events were dropped and `backlog_resume_cursor` says where they start; pass that cursor to `GET /v1/streams/events` to read them. Keep it — a webhook does not carry a stream position, so this response is the only place a push-only integration is handed one. One delivery may still arrive after this call returns: an attempt already on the wire cannot be recalled, and it is counted in `backlog_dropped` even if it lands. The count is an upper bound on what was lost. - `url: optional string` A new destination. Validated exactly as at registration. Events already queued go to the new url — a delivery in flight when you change it re-reads the endpoint before it dials, so it follows the change too. ### Returns - `Endpoint object { id, created_at, disabled_at, 9 more }` A destination this brand's events are delivered to. - `id: string` The endpoint's id. - `created_at: string` - `disabled_at: string` When this endpoint was last disabled. `null` while it is enabled. - `event_kinds: array of string` The event kinds delivered here, or `null` for every kind (including kinds added later). - `health: EndpointHealth` How a destination has been behaving, taken from the deliveries actually attempted against it. Worth reading before assuming an integration is healthy: a destination that has been refusing events shows up here well before anyone notices they are missing. - `consecutive_failures: number` Failed attempts since the last success. Reset to 0 by any success. - `last_failure_at: string` When a delivery to this endpoint last failed. `null` if none ever has. - `last_failure_reason: string` A short reason for the last failure, written for a human reading it. The wording is not stable; do not branch on it. - `last_failure_status: number` The HTTP status of that last failure. `null` when the attempt never reached a response at all — a name that did not resolve, a refused connection, a timeout, or an address we will not dial. - `last_success_at: string` When a delivery to this endpoint last succeeded. `null` if none ever has. - `status: string` `enabled` or `disabled`. A disabled endpoint receives nothing, and events are not queued for it — see the update operation. Values grow additively. - `updated_at: string` - `url: string` Where events are POSTed. `https` only. - `backlog_dropped: optional number` How many undelivered events were dropped by THIS request, present only on the response to a request that disabled or deleted the endpoint. Disabling is a cutoff: everything still queued for this endpoint is dropped then and there rather than waiting to be replayed later. - `backlog_resume_cursor: optional string` Where to pick the dropped events back up: pass it as the `cursor` query parameter to `GET /v1/streams/events` and the first event you receive is the first one dropped. Present alongside `backlog_dropped` and only then. **Keep it if you rely on webhooks alone.** A webhook carries the event's identity but not its position in the stream, so this response is the only place a push-only integration is handed the position of the gap it just created. Reconnecting without a cursor starts at the present moment and skips the gap entirely. It stays valid while the events behind it are retained; past that the stream answers `410 cursor_expired` rather than pretending. - `description: optional string` Your own label for this endpoint. - `phone_number_ids: optional array of string` The phone numbers whose events are delivered here: the exact registered phone-number ids selected for this destination, or `null` for every current and future number (the default). Ids are the ones `GET /v1/phone_numbers` returns for this account and mode, and every one listed was an active number of this account when it was accepted. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/webhook_endpoints/$ENDPOINT \ -X PATCH \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" \ -d '{}' ``` #### Response ```json { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "disabled_at": "2019-12-27T18:11:19.117Z", "event_kinds": [ "string" ], "health": { "consecutive_failures": 0, "last_failure_at": "2019-12-27T18:11:19.117Z", "last_failure_reason": "last_failure_reason", "last_failure_status": 0, "last_success_at": "2019-12-27T18:11:19.117Z" }, "status": "status", "updated_at": "2019-12-27T18:11:19.117Z", "url": "url", "backlog_dropped": 0, "backlog_resume_cursor": "backlog_resume_cursor", "description": "description", "phone_number_ids": [ "string" ] } ``` --- # Replays URL: https://docs.linqapp.com/channel/whatsapp/api/resources/webhook_endpoints/subresources/replays/ ## Replay retained webhook events **post** `/v1/webhook_endpoints/{endpoint}/replays` Accept a bounded replay of events still present in account history. Account-event history has no published minimum retention period yet. Retrying the same acceptance key recovers its response for 24 hours. ### Path Parameters - `endpoint: string` ### Header Parameters - `"Idempotency-Key": string` ### Body Parameters - `after_cursor: optional string` Exclusive event-log cursor. Omit to begin inclusively at retained history. - `through_cursor: optional string` Inclusive event-log cursor. Omit to snapshot the committed tail. ### Returns - `ReplayAcceptance object { id, after_cursor, created_at, 3 more }` - `id: string` - `after_cursor: string` - `created_at: string` - `selected: number` - `state: "pending"` - `"pending"` - `through_cursor: string` ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/webhook_endpoints/$ENDPOINT/replays \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" \ -d '{}' ``` #### Response ```json { "id": "id", "after_cursor": "after_cursor", "created_at": "2019-12-27T18:11:19.117Z", "selected": 0, "state": "pending", "through_cursor": "through_cursor" } ``` ## Get webhook replay status **get** `/v1/webhook_endpoints/{endpoint}/replays/{replay}` Read durable replay progress and its immutable terminal verdict. During ordinary operation, a successfully completed replay remains readable for at least 30 days after `terminal_at`, then returns the same tenant-scoped 404 as an unknown replay. Pending and running replays are never age-swept; failed replay evidence has no scheduled expiry. ### Path Parameters - `endpoint: string` - `replay: string` ### Returns - `Replay object { id, after_cursor, created_at, 12 more }` - `id: string` - `after_cursor: string` - `created_at: string` - `delivered: number` - `delivering: number` - `exhausted: number` - `failure_reason: string` - `materialized: number` - `pending: number` - `selected: number` - `started_at: string` - `state: "pending" or "running" or "completed" or "failed"` - `"pending"` - `"running"` - `"completed"` - `"failed"` - `terminal_at: string` - `through_cursor: string` - `unmaterialized: number` ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/webhook_endpoints/$ENDPOINT/replays/$REPLAY \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` #### Response ```json { "id": "id", "after_cursor": "after_cursor", "created_at": "2019-12-27T18:11:19.117Z", "delivered": 0, "delivering": 0, "exhausted": 0, "failure_reason": "failure_reason", "materialized": 0, "pending": 0, "selected": 0, "started_at": "2019-12-27T18:11:19.117Z", "state": "pending", "terminal_at": "2019-12-27T18:11:19.117Z", "through_cursor": "through_cursor", "unmaterialized": 0 } ``` ## Domain Types ### Replay - `Replay object { id, after_cursor, created_at, 12 more }` - `id: string` - `after_cursor: string` - `created_at: string` - `delivered: number` - `delivering: number` - `exhausted: number` - `failure_reason: string` - `materialized: number` - `pending: number` - `selected: number` - `started_at: string` - `state: "pending" or "running" or "completed" or "failed"` - `"pending"` - `"running"` - `"completed"` - `"failed"` - `terminal_at: string` - `through_cursor: string` - `unmaterialized: number` ### Replay Acceptance - `ReplayAcceptance object { id, after_cursor, created_at, 3 more }` - `id: string` - `after_cursor: string` - `created_at: string` - `selected: number` - `state: "pending"` - `"pending"` - `through_cursor: string` --- # Replay retained webhook events URL: https://docs.linqapp.com/channel/whatsapp/api/resources/webhook_endpoints/subresources/replays/methods/create/ **post** `/v1/webhook_endpoints/{endpoint}/replays` Accept a bounded replay of events still present in account history. Account-event history has no published minimum retention period yet. Retrying the same acceptance key recovers its response for 24 hours. ### Path Parameters - `endpoint: string` ### Header Parameters - `"Idempotency-Key": string` ### Body Parameters - `after_cursor: optional string` Exclusive event-log cursor. Omit to begin inclusively at retained history. - `through_cursor: optional string` Inclusive event-log cursor. Omit to snapshot the committed tail. ### Returns - `ReplayAcceptance object { id, after_cursor, created_at, 3 more }` - `id: string` - `after_cursor: string` - `created_at: string` - `selected: number` - `state: "pending"` - `"pending"` - `through_cursor: string` ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/webhook_endpoints/$ENDPOINT/replays \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" \ -d '{}' ``` #### Response ```json { "id": "id", "after_cursor": "after_cursor", "created_at": "2019-12-27T18:11:19.117Z", "selected": 0, "state": "pending", "through_cursor": "through_cursor" } ``` --- # Get webhook replay status URL: https://docs.linqapp.com/channel/whatsapp/api/resources/webhook_endpoints/subresources/replays/methods/retrieve/ **get** `/v1/webhook_endpoints/{endpoint}/replays/{replay}` Read durable replay progress and its immutable terminal verdict. During ordinary operation, a successfully completed replay remains readable for at least 30 days after `terminal_at`, then returns the same tenant-scoped 404 as an unknown replay. Pending and running replays are never age-swept; failed replay evidence has no scheduled expiry. ### Path Parameters - `endpoint: string` - `replay: string` ### Returns - `Replay object { id, after_cursor, created_at, 12 more }` - `id: string` - `after_cursor: string` - `created_at: string` - `delivered: number` - `delivering: number` - `exhausted: number` - `failure_reason: string` - `materialized: number` - `pending: number` - `selected: number` - `started_at: string` - `state: "pending" or "running" or "completed" or "failed"` - `"pending"` - `"running"` - `"completed"` - `"failed"` - `terminal_at: string` - `through_cursor: string` - `unmaterialized: number` ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/webhook_endpoints/$ENDPOINT/replays/$REPLAY \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` #### Response ```json { "id": "id", "after_cursor": "after_cursor", "created_at": "2019-12-27T18:11:19.117Z", "delivered": 0, "delivering": 0, "exhausted": 0, "failure_reason": "failure_reason", "materialized": 0, "pending": 0, "selected": 0, "started_at": "2019-12-27T18:11:19.117Z", "state": "pending", "terminal_at": "2019-12-27T18:11:19.117Z", "through_cursor": "through_cursor", "unmaterialized": 0 } ``` --- # Secrets URL: https://docs.linqapp.com/channel/whatsapp/api/resources/webhook_endpoints/subresources/secrets/ ## Add a signing secret **post** `/v1/webhook_endpoints/{endpoint}/secrets` Adds a second signing secret to an endpoint — the first half of a rotation. Every ACTIVE secret signs every event, and all of the signatures ride the one `webhook-signature` header (space delimited). A verifier that accepts any one of them — which is what every Standard Webhooks library does — keeps working throughout. So the rotation is: add a secret here, deploy it to your receiver, confirm traffic is verifying against it, then retire the old one. No delivery is dropped at any point. The signing set is read fresh for each delivery, immediately before it is sent. A delivery already on the wire when this call returns may therefore carry the previous set — the overlap is what makes that harmless, and it is why you deploy the new secret before retiring the old one rather than relying on an instant. An endpoint may hold up to five ACTIVE secrets at once; past that the answer is HTTP 409 `too_many_active_secrets` (a 2xxx `error.code`, 2040). Every one of them signs every event, so the header grows with the count — a rotation needs two, and the rest of the room is for one you started and did not finish. The new secret is shown exactly once, in this response. ### Path Parameters - `endpoint: string` ### Returns - `SigningSecretCreated object { id, created_at, retired_at, 2 more }` A newly added signing secret, with its value — shown exactly once. - `id: string` The secret's id. Safe to log: it is a handle, not key material. - `created_at: string` - `retired_at: string` When this secret stopped signing. `null` while it is active. - `secret: string` The signing secret in presentation form (`whsec_` + base64). **Shown exactly once, here.** - `status: string` `active` or `retired`. Values grow additively. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/webhook_endpoints/$ENDPOINT/secrets \ -X POST \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` #### Response ```json { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "retired_at": "2019-12-27T18:11:19.117Z", "secret": "secret", "status": "status" } ``` ## Retire a signing secret **delete** `/v1/webhook_endpoints/{endpoint}/secrets/{secret}` Retires a signing secret — the second half of a rotation. It stops signing immediately; signatures already sent are unaffected. An endpoint's LAST active secret cannot be retired: an endpoint that could not sign would have to stop delivering, and silently unsigned webhooks are indistinguishable from forgeries. Add the replacement first. ### Path Parameters - `endpoint: string` - `secret: string` ### Returns - `SigningSecret object { id, created_at, retired_at, status }` One signing secret. Every ACTIVE secret signs every event, and all of the signatures ride the one `webhook-signature` header — which is what makes a rotation lossless. - `id: string` The secret's id. Safe to log: it is a handle, not key material. - `created_at: string` - `retired_at: string` When this secret stopped signing. `null` while it is active. - `status: string` `active` or `retired`. Values grow additively. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/webhook_endpoints/$ENDPOINT/secrets/$SECRET \ -X DELETE \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` #### Response ```json { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "retired_at": "2019-12-27T18:11:19.117Z", "status": "status" } ``` ## List signing secrets **get** `/v1/webhook_endpoints/{endpoint}/secrets` Lists an endpoint's signing secrets — ids and status only, never the key material. Oldest first, which is the order their signatures appear in the header. ### Path Parameters - `endpoint: string` ### Returns - `SigningSecretList object { data }` An endpoint's signing secrets, oldest first — the order they sign in. - `data: array of SigningSecret` - `id: string` The secret's id. Safe to log: it is a handle, not key material. - `created_at: string` - `retired_at: string` When this secret stopped signing. `null` while it is active. - `status: string` `active` or `retired`. Values grow additively. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/webhook_endpoints/$ENDPOINT/secrets \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` #### Response ```json { "data": [ { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "retired_at": "2019-12-27T18:11:19.117Z", "status": "status" } ] } ``` ## Domain Types ### Signing Secret - `SigningSecret object { id, created_at, retired_at, status }` One signing secret. Every ACTIVE secret signs every event, and all of the signatures ride the one `webhook-signature` header — which is what makes a rotation lossless. - `id: string` The secret's id. Safe to log: it is a handle, not key material. - `created_at: string` - `retired_at: string` When this secret stopped signing. `null` while it is active. - `status: string` `active` or `retired`. Values grow additively. ### Signing Secret Created - `SigningSecretCreated object { id, created_at, retired_at, 2 more }` A newly added signing secret, with its value — shown exactly once. - `id: string` The secret's id. Safe to log: it is a handle, not key material. - `created_at: string` - `retired_at: string` When this secret stopped signing. `null` while it is active. - `secret: string` The signing secret in presentation form (`whsec_` + base64). **Shown exactly once, here.** - `status: string` `active` or `retired`. Values grow additively. ### Signing Secret List - `SigningSecretList object { data }` An endpoint's signing secrets, oldest first — the order they sign in. - `data: array of SigningSecret` - `id: string` The secret's id. Safe to log: it is a handle, not key material. - `created_at: string` - `retired_at: string` When this secret stopped signing. `null` while it is active. - `status: string` `active` or `retired`. Values grow additively. --- # Add a signing secret URL: https://docs.linqapp.com/channel/whatsapp/api/resources/webhook_endpoints/subresources/secrets/methods/create/ **post** `/v1/webhook_endpoints/{endpoint}/secrets` Adds a second signing secret to an endpoint — the first half of a rotation. Every ACTIVE secret signs every event, and all of the signatures ride the one `webhook-signature` header (space delimited). A verifier that accepts any one of them — which is what every Standard Webhooks library does — keeps working throughout. So the rotation is: add a secret here, deploy it to your receiver, confirm traffic is verifying against it, then retire the old one. No delivery is dropped at any point. The signing set is read fresh for each delivery, immediately before it is sent. A delivery already on the wire when this call returns may therefore carry the previous set — the overlap is what makes that harmless, and it is why you deploy the new secret before retiring the old one rather than relying on an instant. An endpoint may hold up to five ACTIVE secrets at once; past that the answer is HTTP 409 `too_many_active_secrets` (a 2xxx `error.code`, 2040). Every one of them signs every event, so the header grows with the count — a rotation needs two, and the rest of the room is for one you started and did not finish. The new secret is shown exactly once, in this response. ### Path Parameters - `endpoint: string` ### Returns - `SigningSecretCreated object { id, created_at, retired_at, 2 more }` A newly added signing secret, with its value — shown exactly once. - `id: string` The secret's id. Safe to log: it is a handle, not key material. - `created_at: string` - `retired_at: string` When this secret stopped signing. `null` while it is active. - `secret: string` The signing secret in presentation form (`whsec_` + base64). **Shown exactly once, here.** - `status: string` `active` or `retired`. Values grow additively. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/webhook_endpoints/$ENDPOINT/secrets \ -X POST \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` #### Response ```json { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "retired_at": "2019-12-27T18:11:19.117Z", "secret": "secret", "status": "status" } ``` --- # Retire a signing secret URL: https://docs.linqapp.com/channel/whatsapp/api/resources/webhook_endpoints/subresources/secrets/methods/delete/ **delete** `/v1/webhook_endpoints/{endpoint}/secrets/{secret}` Retires a signing secret — the second half of a rotation. It stops signing immediately; signatures already sent are unaffected. An endpoint's LAST active secret cannot be retired: an endpoint that could not sign would have to stop delivering, and silently unsigned webhooks are indistinguishable from forgeries. Add the replacement first. ### Path Parameters - `endpoint: string` - `secret: string` ### Returns - `SigningSecret object { id, created_at, retired_at, status }` One signing secret. Every ACTIVE secret signs every event, and all of the signatures ride the one `webhook-signature` header — which is what makes a rotation lossless. - `id: string` The secret's id. Safe to log: it is a handle, not key material. - `created_at: string` - `retired_at: string` When this secret stopped signing. `null` while it is active. - `status: string` `active` or `retired`. Values grow additively. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/webhook_endpoints/$ENDPOINT/secrets/$SECRET \ -X DELETE \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` #### Response ```json { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "retired_at": "2019-12-27T18:11:19.117Z", "status": "status" } ``` --- # List signing secrets URL: https://docs.linqapp.com/channel/whatsapp/api/resources/webhook_endpoints/subresources/secrets/methods/list/ **get** `/v1/webhook_endpoints/{endpoint}/secrets` Lists an endpoint's signing secrets — ids and status only, never the key material. Oldest first, which is the order their signatures appear in the header. ### Path Parameters - `endpoint: string` ### Returns - `SigningSecretList object { data }` An endpoint's signing secrets, oldest first — the order they sign in. - `data: array of SigningSecret` - `id: string` The secret's id. Safe to log: it is a handle, not key material. - `created_at: string` - `retired_at: string` When this secret stopped signing. `null` while it is active. - `status: string` `active` or `retired`. Values grow additively. ### Example ```http curl https://whatsapp.messages.api.linqapp.com/v1/webhook_endpoints/$ENDPOINT/secrets \ -H "Authorization: Bearer $LINQ_WHATSAPP_API_KEY" ``` #### Response ```json { "data": [ { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "retired_at": "2019-12-27T18:11:19.117Z", "status": "status" } ] } ```