API reference
Every operation on the Cosend API, generated from the OpenAPI document the API is validated against, so it always matches the API. Credentials, pagination, idempotency and rate limits apply to every operation and are described in REST API conventions.
Operations are grouped by path. Scopes lists the scopes a key or token needs; some operations accept any credential, and a few need none. Any operation can return the standard error envelope described in the error reference. The Errors line under an operation lists the codes its description mentions, and the error reference lists every code.
/v1/account
GET /v1/account/data-policy
What is kept, in which group, for how long, and any queued erasure
Scopes settings:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "data_policy" | required | |
| groups | object[] | required | |
| groups[].key | "conversation_data" | "operational_records" | "account_activity" | required | |
| groups[].label | string | required | |
| groups[].contains | string[] | required | |
| groups[].adjustable | boolean | required | |
| groups[].retention_months | integer | null | required | |
| groups[].floor_months | integer | null | required | |
| groups[].ceiling_months | integer | null | required | |
| survives_account_deletion | object[] | required | |
| survives_account_deletion[].what | "billing_and_invoices" | "proof_of_erasure" | required | |
| survives_account_deletion[].years | integer | required | |
| survives_account_deletion[].basis | string | required | |
| queued_erasure | object | null | required | |
| queued_erasure.id | string | required | |
| queued_erasure.requested_by | string | required | |
| queued_erasure.requested_by_name | string | null | required | |
| queued_erasure.requested_at | string (date-time) | required | |
| queued_erasure.executes_at | string (date-time) | required | |
| queued_erasure.seconds_remaining | integer | required | |
| queued_erasure.can_i_cancel | boolean | required | |
| transcribe_voice_notes | boolean | required |
PATCH /v1/account/data-policy
Set the two adjustable retention groups
Scopes retention:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| conversation_data_months | integer | optional | |
| operational_records_months | integer | optional | |
| transcribe_voice_notes | boolean | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "data_policy" | required | |
| groups | object[] | required | |
| groups[].key | "conversation_data" | "operational_records" | "account_activity" | required | |
| groups[].label | string | required | |
| groups[].contains | string[] | required | |
| groups[].adjustable | boolean | required | |
| groups[].retention_months | integer | null | required | |
| groups[].floor_months | integer | null | required | |
| groups[].ceiling_months | integer | null | required | |
| survives_account_deletion | object[] | required | |
| survives_account_deletion[].what | "billing_and_invoices" | "proof_of_erasure" | required | |
| survives_account_deletion[].years | integer | required | |
| survives_account_deletion[].basis | string | required | |
| queued_erasure | object | null | required | |
| queued_erasure.id | string | required | |
| queued_erasure.requested_by | string | required | |
| queued_erasure.requested_by_name | string | null | required | |
| queued_erasure.requested_at | string (date-time) | required | |
| queued_erasure.executes_at | string (date-time) | required | |
| queued_erasure.seconds_remaining | integer | required | |
| queued_erasure.can_i_cancel | boolean | required | |
| transcribe_voice_notes | boolean | required |
POST /v1/account/erasure
Queue the whole-workspace erasure. 7-day grace period
Scopes any credential
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| confirm | string | required |
Response 202
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "account_erasure" | required | |
| erasure | object | required | |
| erasure.id | string | required | |
| erasure.requested_by | string | required | |
| erasure.requested_by_name | string | null | required | |
| erasure.requested_at | string (date-time) | required | |
| erasure.executes_at | string (date-time) | required | |
| erasure.seconds_remaining | integer | required | |
| erasure.can_i_cancel | boolean | required |
DELETE /v1/account/erasure
Cancel a queued workspace erasure
Scopes any credential
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "account_erasure" | required | |
| state | "cancelled" | required | |
| cancelled_at | string (date-time) | required |
POST /v1/account/erasure/cancel/{token}
Cancel a queued workspace erasure from the emailed link. Single-use
Scopes none (public endpoint)
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "account_erasure" | required | |
| state | "cancelled" | required | |
| cancelled_at | string (date-time) | required |
/v1/ai
GET /v1/ai/authoring
One WhatsApp number’s AI authoring conversations, the most recently active first, each with its title and the automations it holds
Scopes automations:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| connection_id | query | string | required | The WhatsApp number (connection id) whose AI authoring conversations to list. |
| limit | query | integer | optional | |
| after | query | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].object | "authoring_conversation" | required | |
| data[].title | string | null | required | The owner's first message, cut to 80 characters. Null until the owner has written one. |
| data[].automation_ids | string[] | required | The automations this conversation holds, the one it took on most recently first: each it built or changed, and the one it was started on. No other conversation holds them. |
| data[].created_at | string (date-time) | required | |
| data[].updated_at | string (date-time) | required | When the conversation last changed. The list is newest first by this. |
| has_more | boolean | required | |
| next_cursor | string | null | required |
POST /v1/ai/authoring
Start an AI authoring conversation on one WhatsApp number. It builds and changes that number’s automations only, and never switches one on
Scopes automations:writeautomations:readruns:writeruns:readconnectors:readconnectors:writemessages:read
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| connection_id | string | required | The WhatsApp number (connection id) the conversation builds and changes automations for. It touches no other number’s. |
| automation_id | string | optional | An automation on that number for the conversation to start on, to fix or improve it. Refused when another conversation already holds it (that conversation’s id is named; open it instead), and for an automation made from a recipe, the AI receptionist included. |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "authoring_conversation" | required | |
| connection_id | string | required | |
| automation_ids | string[] | required | The automations this conversation holds, the one it took on most recently first: each it built or changed, and the one it was started on. No other conversation holds them. |
| automations | object[] | required | Each of automation_ids, in the same order, with its name and state. |
| automations[].id | string | required | |
| automations[].name | string | required | |
| automations[].enabled | boolean | required | Whether the owner has switched it on. |
| automations[].has_active_version | boolean | required | Whether a version of it was ever switched on: false until the owner does. |
| messages | object[] | required | |
| messages[].role | "owner" | required | |
| messages[].text | string | required | |
| messages[].created_at | string (date-time) | required | |
| messages[].reply | object | required | |
| messages[].reply.object | "authoring_reply" | required | |
| messages[].reply.conversation_id | string | required | |
| messages[].reply.outcome | "built" | "changed" | "cannot" | "question" | "stopped" | required | built or changed: an automation was made or changed and tested, switched off. cannot: no block does what was asked, and nothing was made. question: it needs an answer from the owner. stopped: it stopped before finishing, and text says why and what still fails. |
| messages[].reply.stop_reason | "credits_used" | "max_test_rounds" | "max_tool_calls" | "model_unavailable" | "model_refused" | "model_cut_off" | "superseded" | null | required | Why it stopped, when outcome is stopped; null for every other outcome. credits_used: the workspace’s AI building credit for the month and its bought credit are used up, so the model was not called again (offer more credit). max_test_rounds: it ran the most Tests one message may run. max_tool_calls: it took the most steps one message may take. model_unavailable: the model did not answer. model_refused: the model declined the request. model_cut_off: the model’s answer was cut off. superseded: a newer message to this conversation took over. Null on a stopped reply kept before this field existed. text says the same in words for the owner. |
| messages[].reply.text | string | required | What the owner is told, in plain words. |
| messages[].reply.summary | string | null | required | The automation in plain words: "when a customer writes X, it does Y, then Z". Null when there is none. |
| messages[].reply.automation_id | string | null | required | The automation this answer built or changed, or null when it built and changed none. Always switched off: the owner switches it on. |
| messages[].reply.test | object | null | required | The last Test this answer read, or null when it read none. |
| messages[].reply.connect_needed | object[] | required | Integrations a step needs, for the owner to connect each one that is not connected for this number. |
| messages[].reply.confirm | object | null | required | What the owner confirms with one tap before this automation can be tested: every step confirmed by name, such as a call that may change something on another server. The tap is POST /v1/automations/{automation_id}/deploy with version_id and confirm_actions set to actions, then a message to this conversation. Only the newest reply’s confirm is current. Null when nothing needs confirming. |
| messages[].reply.created_at | string (date-time) | required | |
| progress | object | null | required | What the builder has done so far for the owner’s newest message: read it while that message is being answered to show its progress. Null before the owner’s first message. |
| progress.answered | boolean | required | Whether the newest message has its answer. While it is false, the builder is still working on it, or its request ended without one. |
| progress.since | string (date-time) | required | When the owner sent the newest message. |
| progress.steps | object[] | required | Each thing it did for that message, in order, as it did it. |
| progress.steps[].step | "thinking" | "reading" | "building" | "saving" | "checking" | "testing" | "reading_test" | "making_sheet" | required | |
| progress.steps[].says | string | required | What it did, in plain words for the owner. |
| progress.steps[].failed | boolean | required | Whether it did not work: the builder then tries another way. |
| progress.steps[].at | string (date-time) | required | |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required |
GET /v1/ai/authoring/{id}
One AI authoring conversation: what the owner said, and each answer
Scopes automations:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "authoring_conversation" | required | |
| connection_id | string | required | |
| automation_ids | string[] | required | The automations this conversation holds, the one it took on most recently first: each it built or changed, and the one it was started on. No other conversation holds them. |
| automations | object[] | required | Each of automation_ids, in the same order, with its name and state. |
| automations[].id | string | required | |
| automations[].name | string | required | |
| automations[].enabled | boolean | required | Whether the owner has switched it on. |
| automations[].has_active_version | boolean | required | Whether a version of it was ever switched on: false until the owner does. |
| messages | object[] | required | |
| messages[].role | "owner" | required | |
| messages[].text | string | required | |
| messages[].created_at | string (date-time) | required | |
| messages[].reply | object | required | |
| messages[].reply.object | "authoring_reply" | required | |
| messages[].reply.conversation_id | string | required | |
| messages[].reply.outcome | "built" | "changed" | "cannot" | "question" | "stopped" | required | built or changed: an automation was made or changed and tested, switched off. cannot: no block does what was asked, and nothing was made. question: it needs an answer from the owner. stopped: it stopped before finishing, and text says why and what still fails. |
| messages[].reply.stop_reason | "credits_used" | "max_test_rounds" | "max_tool_calls" | "model_unavailable" | "model_refused" | "model_cut_off" | "superseded" | null | required | Why it stopped, when outcome is stopped; null for every other outcome. credits_used: the workspace’s AI building credit for the month and its bought credit are used up, so the model was not called again (offer more credit). max_test_rounds: it ran the most Tests one message may run. max_tool_calls: it took the most steps one message may take. model_unavailable: the model did not answer. model_refused: the model declined the request. model_cut_off: the model’s answer was cut off. superseded: a newer message to this conversation took over. Null on a stopped reply kept before this field existed. text says the same in words for the owner. |
| messages[].reply.text | string | required | What the owner is told, in plain words. |
| messages[].reply.summary | string | null | required | The automation in plain words: "when a customer writes X, it does Y, then Z". Null when there is none. |
| messages[].reply.automation_id | string | null | required | The automation this answer built or changed, or null when it built and changed none. Always switched off: the owner switches it on. |
| messages[].reply.test | object | null | required | The last Test this answer read, or null when it read none. |
| messages[].reply.connect_needed | object[] | required | Integrations a step needs, for the owner to connect each one that is not connected for this number. |
| messages[].reply.confirm | object | null | required | What the owner confirms with one tap before this automation can be tested: every step confirmed by name, such as a call that may change something on another server. The tap is POST /v1/automations/{automation_id}/deploy with version_id and confirm_actions set to actions, then a message to this conversation. Only the newest reply’s confirm is current. Null when nothing needs confirming. |
| messages[].reply.created_at | string (date-time) | required | |
| progress | object | null | required | What the builder has done so far for the owner’s newest message: read it while that message is being answered to show its progress. Null before the owner’s first message. |
| progress.answered | boolean | required | Whether the newest message has its answer. While it is false, the builder is still working on it, or its request ended without one. |
| progress.since | string (date-time) | required | When the owner sent the newest message. |
| progress.steps | object[] | required | Each thing it did for that message, in order, as it did it. |
| progress.steps[].step | "thinking" | "reading" | "building" | "saving" | "checking" | "testing" | "reading_test" | "making_sheet" | required | |
| progress.steps[].says | string | required | What it did, in plain words for the owner. |
| progress.steps[].failed | boolean | required | Whether it did not work: the builder then tries another way. |
| progress.steps[].at | string (date-time) | required | |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required |
POST /v1/ai/authoring/{id}/messages
Send the owner’s message. The answer: what it built (switched off), in plain words, its Test result, and what to connect
Scopes automations:writeautomations:readruns:writeruns:readconnectors:readconnectors:writemessages:read
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| message | string | required | What the owner needs, or their answer to a question, in their own words. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "authoring_reply" | required | |
| conversation_id | string | required | |
| outcome | "built" | "changed" | "cannot" | "question" | "stopped" | required | built or changed: an automation was made or changed and tested, switched off. cannot: no block does what was asked, and nothing was made. question: it needs an answer from the owner. stopped: it stopped before finishing, and text says why and what still fails. |
| stop_reason | "credits_used" | "max_test_rounds" | "max_tool_calls" | "model_unavailable" | "model_refused" | "model_cut_off" | "superseded" | null | required | Why it stopped, when outcome is stopped; null for every other outcome. credits_used: the workspace’s AI building credit for the month and its bought credit are used up, so the model was not called again (offer more credit). max_test_rounds: it ran the most Tests one message may run. max_tool_calls: it took the most steps one message may take. model_unavailable: the model did not answer. model_refused: the model declined the request. model_cut_off: the model’s answer was cut off. superseded: a newer message to this conversation took over. Null on a stopped reply kept before this field existed. text says the same in words for the owner. |
| text | string | required | What the owner is told, in plain words. |
| summary | string | null | required | The automation in plain words: "when a customer writes X, it does Y, then Z". Null when there is none. |
| automation_id | string | null | required | The automation this answer built or changed, or null when it built and changed none. Always switched off: the owner switches it on. |
| test | object | null | required | The last Test this answer read, or null when it read none. |
| test.run_id | string | required | |
| test.status | "queued" | "running" | "waiting" | "success" | "failure" | "cancelled" | "timeout" | "skipped" | … | required | |
| test.passed | boolean | required | |
| test.reason | string | null | required | Why it did not pass, in plain words. Null when it passed. |
| test.step_id | string | null | required | The step it stopped at, when one did. |
| test.error_branch_preview | boolean | optional | V4-H2: true when the Test made a step fail on purpose to show the error branch, and the branch ran to its end. It passed as a preview; it does not test the automation’s own steps. |
| connect_needed | object[] | required | Integrations a step needs, for the owner to connect each one that is not connected for this number. |
| connect_needed[].connector | string | required | |
| connect_needed[].why | string | required | |
| connect_needed[].connected | boolean | required | Whether the integration was connected for this number when this answer was made. Read the connector accounts for whether it is now. |
| confirm | object | null | required | What the owner confirms with one tap before this automation can be tested: every step confirmed by name, such as a call that may change something on another server. The tap is POST /v1/automations/{automation_id}/deploy with version_id and confirm_actions set to actions, then a message to this conversation. Only the newest reply’s confirm is current. Null when nothing needs confirming. |
| confirm.automation_id | string | required | |
| confirm.version_id | string | required | |
| confirm.actions | string[] | required | The names the tap confirms, as confirm_actions takes them. |
| created_at | string (date-time) | required |
POST /v1/ai/try
Try an AI assistant (automation_id): its reply from its own persona and knowledge, and what it would do. Nothing is sent; each chat counts as one AI conversation
Scopes automations:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| message | string | required | |
| history | object[] | optional | |
| history[].role | "customer" | "assistant" | required | |
| history[].text | string | required | |
| history[].handed_over | boolean | optional | True on the customer turn after which a person had the chat: its answer was cant_answer, and the automation's steps for that case hand the chat to a person. From then on, as in a real chat, the answer is outcome person_has_chat and the model is not asked. |
| automation_id | string | required | The AI assistant being tried: an automation of this workspace with one AI step. The answer comes from its own persona and knowledge, and from no other assistant’s. Alone, the try also uses the escalate_keywords of the version its conversations run (the switched-on one, else the newest), the first message of its branch for the cant_answer outcome of that step and its cause, and its closed message and opening hours; with connection_id, the set-up’s answers replace those. |
| connection_id | string | optional | For a receptionist that is not switched on: the number it is being set up on. Requires holding_message; escalate_keywords and closed as the set-up has them. They replace the settings of automation_id’s version. |
| holding_message | string | optional | Required with connection_id, and only with it: the message a customer is sent when the assistant cannot answer. |
| escalate_keywords | string[] | optional | With connection_id: the words that pass a chat to a person. |
| closed | object | optional | With connection_id: the set-up's closed message, opening hours (HH:MM, in the workspace's timezone) and closed-hours passing message. While closed, the answer's closed_message is the message with the hours, and a customer_message for a chat passed on is the closed-hours one. |
| closed.message | string | required | |
| closed.open_days | ("mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun")[] | required | |
| closed.opens_at | string | required | |
| closed.closes_at | string | required | |
| closed.weekly_hours | object | optional | The set-up's opening hours per day: each open day (mon to sun) with its own opens and closes, a day not listed closed. When it lists a day, these are the hours and open_days, opens_at and closes_at are not read. |
| closed.weekly_hours.mon | object | optional | |
| closed.weekly_hours.tue | object | optional | |
| closed.weekly_hours.wed | object | optional | |
| closed.weekly_hours.thu | object | optional | |
| closed.weekly_hours.fri | object | optional | |
| closed.weekly_hours.sat | object | optional | |
| closed.weekly_hours.sun | object | optional | |
| closed.holding_message | string | optional | The set-up's message for when the assistant passes the chat on while closed, in place of holding_message: where it says {opens}, the customer reads when the business next opens. The AI receptionist's default when left out. |
| chat_id | string | null | optional | The Try it chat this message continues: the chat_id an earlier answer in it gave. Each chat counts as one AI conversation, billed like a real one, from the first time the assistant is asked in it. Null or left out starts a new chat; a history that already holds an assistant turn needs it, unless a turn in it was handed over. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| reply | string | null | required | |
| decision | object | required | |
| decision.intent | string | null | required | |
| decision.confidence | number | null | required | |
| decision.needs_human | boolean | required | |
| decision.filtered_reason | string | null | required | |
| decision.would_hand_over | boolean | required | True when the assistant would not answer: the automation's own steps for that case would. |
| sources | object[] | required | |
| sources[].source_id | string | required | |
| sources[].title | string | required | |
| sources[].snippet | string | required | |
| outcome | "answered" | "cant_answer" | "person_has_chat" | required | answered: the customer gets the reply. cant_answer: the assistant cannot answer, cant_answer says why, and the automation's own steps for that case run. person_has_chat: an earlier turn was handed to a person, so the assistant would not see this message. |
| cant_answer | object | null | required | Null unless outcome is cant_answer. |
| cant_answer.cause | "harmful" | "prices_off" | "not_known" | "keyword" | "model_down" | required | harmful: a harmful request (the assistant read it so, or the model refused it). prices_off: a price question while the assistant may not give prices. not_known: a question it cannot answer from what it knows, a reply held back, or a message it cannot read. keyword: the customer wrote one of the owner's words, or asked for a person. model_down: no answer could be had from the model, or the AI budget or allowance is spent. |
| cant_answer.reason | string | required | Why, as the owner reads it. |
| cant_answer.filtered_reason | string | null | required | Why the reply was held back, when it was. |
| cant_answer.setting | "may_quote_prices" | "links" | "never_say" | "escalate_keywords" | null | required | The owner's own setting it came from: one of the persona's (may_quote_prices, links, never_say), or the receptionist's escalate_keywords. |
| customer_message | string | null | required | What the customer would receive: the reply, or, when the assistant cannot answer, the message the automation sends then, word for word. While closed, that is its closed-hours message when that is what it sends, with the next opening filled in. Null when nothing would be sent (person_has_chat, or an automation whose branch for that cause sends no message), or when the assistant cannot answer and the request names no automation_id and no connection_id. |
| closed_message | string | null | required | The owner's closed message with the opening hours, sent before the first reply while the automation's hours say closed, whatever that reply is: once per conversation. Null otherwise, and null when customer_message already says the business is closed (the customer gets one such message, not two). |
| chat_id | string | null | required | This Try it chat, one AI conversation: send it back as chat_id with the next message. Null while the assistant has not been asked in the chat (the owner’s keyword asks it nothing). |
/v1/ai-connections
GET /v1/ai-connections
The AI apps connected to the workspace; an owner or admin sees all, a member their own. Dashboard sessions only
Scopes any credential
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].object | "ai_connection" | required | |
| data[].client | object | required | |
| data[].client.id | string | required | The app’s client id as it signed in: the address of its details, or the id Cosend gave it when it registered. |
| data[].client.name | string | required | What the app calls itself. Not verified. |
| data[].connected_by | object | required | |
| data[].connected_by.id | string | required | The person who approved the app (a usr_ id). |
| data[].connected_by.name | string | required | |
| data[].scopes | object[] | required | What the app may do. |
| data[].scopes[].scope | string | required | |
| data[].scopes[].description | string | required | What the scope lets the app do, in plain words. |
| data[].created_at | string (date-time) | required | |
| data[].last_used_at | string (date-time) | null | required | When the app last called Cosend, to the minute. Null until its first call. |
| data[].removed_at | string (date-time) | null | required | When the app was removed and lost its access. Null while it is connected. |
DELETE /v1/ai-connections/{id}
Remove an AI app: its access ends at once. Removing it again answers the same. Dashboard sessions only
Scopes any credential
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "ai_connection" | required | |
| client | object | required | |
| client.id | string | required | The app’s client id as it signed in: the address of its details, or the id Cosend gave it when it registered. |
| client.name | string | required | What the app calls itself. Not verified. |
| connected_by | object | required | |
| connected_by.id | string | required | The person who approved the app (a usr_ id). |
| connected_by.name | string | required | |
| scopes | object[] | required | What the app may do. |
| scopes[].scope | string | required | |
| scopes[].description | string | required | What the scope lets the app do, in plain words. |
| created_at | string (date-time) | required | |
| last_used_at | string (date-time) | null | required | When the app last called Cosend, to the minute. Null until its first call. |
| removed_at | string (date-time) | null | required | When the app was removed and lost its access. Null while it is connected. |
/v1/api-keys
GET /v1/api-keys
The workspace’s keys. The key itself is never in a list response
Scopes keys:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].object | "api_key" | required | |
| data[].name | string | required | |
| data[].kind | "connection" | "organization" | required | |
| data[].connection_id | string | null | required | The first of connection_ids, or null for a workspace key. Read connection_ids: a key may work on several numbers. |
| data[].connection_ids | string[] | required | The WhatsApp numbers (connection ids) this key works on: one or more for a connection key, none for a workspace key, which works on every number. The key is refused on anything of another number. |
| data[].scopes | string[] | required | |
| data[].display_prefix | string | required | |
| data[].last_used_at | string (date-time) | null | required | |
| data[].created_at | string (date-time) | required | |
| data[].expires_at | string (date-time) | null | required | |
| data[].revoked_at | string (date-time) | null | required |
POST /v1/api-keys
Create a key. This is the only response that carries key
Scopes keys:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | required | |
| kind | "connection" | "organization" | required | |
| connection_ids | string[] | optional | For a connection key: the WhatsApp numbers (connection ids) it works on, one or more. Leave it out for a workspace key, which works on every number. |
| connection_id | string | null | optional | One number, read together with connection_ids. Prefer connection_ids. |
| scopes | ("messages:read" | "messages:write" | "contacts:read" | "contacts:write" | "templates:read" | "templates:write" | "notifications:read" | "notifications:write" | …)[] | optional | |
| is_live | boolean | optional |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "api_key" | required | |
| name | string | required | |
| kind | "connection" | "organization" | required | |
| connection_id | string | null | required | The first of connection_ids, or null for a workspace key. Read connection_ids: a key may work on several numbers. |
| connection_ids | string[] | required | The WhatsApp numbers (connection ids) this key works on: one or more for a connection key, none for a workspace key, which works on every number. The key is refused on anything of another number. |
| scopes | string[] | required | |
| display_prefix | string | required | |
| last_used_at | string (date-time) | null | required | |
| created_at | string (date-time) | required | |
| expires_at | string (date-time) | null | required | |
| revoked_at | string (date-time) | null | required | |
| key | string | required | |
| first_use | boolean | required |
DELETE /v1/api-keys/{id}
Immediate revocation
Scopes keys:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "api_key" | required | |
| name | string | required | |
| kind | "connection" | "organization" | required | |
| connection_id | string | null | required | The first of connection_ids, or null for a workspace key. Read connection_ids: a key may work on several numbers. |
| connection_ids | string[] | required | The WhatsApp numbers (connection ids) this key works on: one or more for a connection key, none for a workspace key, which works on every number. The key is refused on anything of another number. |
| scopes | string[] | required | |
| display_prefix | string | required | |
| last_used_at | string (date-time) | null | required | |
| created_at | string (date-time) | required | |
| expires_at | string (date-time) | null | required | |
| revoked_at | string (date-time) | null | required |
POST /v1/api-keys/{id}/rotate
Issue a replacement; the old key expires after grace_hours
Scopes keys:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| grace_hours | integer | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| created | object | required | |
| created.id | string | required | |
| created.object | "api_key" | required | |
| created.name | string | required | |
| created.kind | "connection" | "organization" | required | |
| created.connection_id | string | null | required | The first of connection_ids, or null for a workspace key. Read connection_ids: a key may work on several numbers. |
| created.connection_ids | string[] | required | The WhatsApp numbers (connection ids) this key works on: one or more for a connection key, none for a workspace key, which works on every number. The key is refused on anything of another number. |
| created.scopes | string[] | required | |
| created.display_prefix | string | required | |
| created.last_used_at | string (date-time) | null | required | |
| created.created_at | string (date-time) | required | |
| created.expires_at | string (date-time) | null | required | |
| created.revoked_at | string (date-time) | null | required | |
| created.key | string | required | |
| rotated | object | required | |
| rotated.id | string | required | |
| rotated.object | "api_key" | required | |
| rotated.name | string | required | |
| rotated.kind | "connection" | "organization" | required | |
| rotated.connection_id | string | null | required | The first of connection_ids, or null for a workspace key. Read connection_ids: a key may work on several numbers. |
| rotated.connection_ids | string[] | required | The WhatsApp numbers (connection ids) this key works on: one or more for a connection key, none for a workspace key, which works on every number. The key is refused on anything of another number. |
| rotated.scopes | string[] | required | |
| rotated.display_prefix | string | required | |
| rotated.last_used_at | string (date-time) | null | required | |
| rotated.created_at | string (date-time) | required | |
| rotated.expires_at | string (date-time) | null | required | |
| rotated.revoked_at | string (date-time) | null | required |
/v1/approval-action-types
GET /v1/approval-action-types
Every action type that can require approval. The settings screen renders this
Scopes approvals:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].action_type | string | required | |
| data[].object | "approval_action_type" | required | |
| data[].display_name | string | required | |
| data[].description | string | required | |
| data[].default_risk | "low" | "medium" | "high" | required |
/v1/approval-settings
GET /v1/approval-settings
This workspace’s mode for each action type it sets (refunds and the AI receptionist’s own are set where they run). Admins only
Scopes any credential
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].action_type | string | required | |
| data[].object | "approval_setting" | required | |
| data[].display_name | string | required | |
| data[].description | string | required | |
| data[].default_risk | "low" | "medium" | "high" | required | |
| data[].mode | "ask" | "auto_approve" | "auto_reject" | required | |
| data[].effective_mode | "ask" | "auto_approve" | "auto_reject" | required | |
| data[].consent | object | null | required | |
| data[].consent.mode | "auto_approve" | "auto_reject" | required | |
| data[].consent.by | string | null | required | |
| data[].consent.at | string (date-time) | required | |
| data[].updated_at | string (date-time) | required |
PATCH /v1/approval-settings
Set one type to ask, auto-approve or auto-reject. Admins only; the risk is recorded
Scopes any credential
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| action_type | string | required | |
| mode | "ask" | "auto_approve" | "auto_reject" | required | |
| risk_acknowledged | boolean | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| action_type | string | required | |
| object | "approval_setting" | required | |
| display_name | string | required | |
| description | string | required | |
| default_risk | "low" | "medium" | "high" | required | |
| mode | "ask" | "auto_approve" | "auto_reject" | required | |
| effective_mode | "ask" | "auto_approve" | "auto_reject" | required | |
| consent | object | null | required | |
| consent.mode | "auto_approve" | "auto_reject" | required | |
| consent.by | string | null | required | |
| consent.at | string (date-time) | required | |
| updated_at | string (date-time) | required |
/v1/approvals
GET /v1/approvals
Pending human decisions
Scopes approvals:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| limit | query | integer | optional | |
| after | query | string | optional | |
| before | query | string | optional | |
| state | query | "pending" | "approved" | "rejected" | "expired" | "executed" | "failed" | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].object | "approval" | required | |
| data[].action | string | required | |
| data[].state | "pending" | "approved" | "rejected" | "expired" | "executed" | "failed" | required | |
| data[].risk | "low" | "medium" | "high" | required | |
| data[].preview | string | required | |
| data[].arguments | object | required | |
| data[].requested_by | "user" | "api_key" | "automation" | "system" | required | |
| data[].requester_id | string | null | required | |
| data[].requester | object | null | required | |
| data[].requester.kind | "automation" | "api_key" | "user" | required | |
| data[].requester.id | string | null | required | |
| data[].requester.name | string | null | required | |
| data[].run_id | string | null | required | |
| data[].conversation_id | string | null | required | |
| data[].connection_id | string | null | required | |
| data[].automation_id | string | null | required | |
| data[].decided_via | "human" | "auto_rule" | "expiry" | null | required | |
| data[].decided_by | string | null | required | |
| data[].decided_at | string (date-time) | null | required | |
| data[].decision_note | string | null | required | |
| data[].expires_at | string (date-time) | required | |
| data[].created_at | string (date-time) | required | |
| has_more | boolean | required | |
| next_cursor | string | null | required |
POST /v1/approvals
Hold an action for a human decision. Expires in 24 hours, and an expiry is a rejection
Scopes approvals:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | required |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| action | string | required | |
| arguments | object | optional | |
| preview | string | required | |
| risk | "low" | "medium" | "high" | optional | |
| run_id | string | null | optional |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "approval" | required | |
| action | string | required | |
| state | "pending" | "approved" | "rejected" | "expired" | "executed" | "failed" | required | |
| risk | "low" | "medium" | "high" | required | |
| preview | string | required | |
| arguments | object | required | |
| requested_by | "user" | "api_key" | "automation" | "system" | required | |
| requester_id | string | null | required | |
| requester | object | null | required | |
| requester.kind | "automation" | "api_key" | "user" | required | |
| requester.id | string | null | required | |
| requester.name | string | null | required | |
| run_id | string | null | required | |
| conversation_id | string | null | required | |
| connection_id | string | null | required | |
| automation_id | string | null | required | |
| decided_via | "human" | "auto_rule" | "expiry" | null | required | |
| decided_by | string | null | required | |
| decided_at | string (date-time) | null | required | |
| decision_note | string | null | required | |
| expires_at | string (date-time) | required | |
| created_at | string (date-time) | required |
GET /v1/approvals/{id}
One approval, including preview, exactly what the human is shown
Scopes approvals:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "approval" | required | |
| action | string | required | |
| state | "pending" | "approved" | "rejected" | "expired" | "executed" | "failed" | required | |
| risk | "low" | "medium" | "high" | required | |
| preview | string | required | |
| arguments | object | required | |
| requested_by | "user" | "api_key" | "automation" | "system" | required | |
| requester_id | string | null | required | |
| requester | object | null | required | |
| requester.kind | "automation" | "api_key" | "user" | required | |
| requester.id | string | null | required | |
| requester.name | string | null | required | |
| run_id | string | null | required | |
| conversation_id | string | null | required | |
| connection_id | string | null | required | |
| automation_id | string | null | required | |
| decided_via | "human" | "auto_rule" | "expiry" | null | required | |
| decided_by | string | null | required | |
| decided_at | string (date-time) | null | required | |
| decision_note | string | null | required | |
| expires_at | string (date-time) | required | |
| created_at | string (date-time) | required |
POST /v1/approvals/{id}/approve
Approve the held action. An expired approval is rejected instead, never approved
Scopes approvals:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| note | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "approval" | required | |
| action | string | required | |
| state | "pending" | "approved" | "rejected" | "expired" | "executed" | "failed" | required | |
| risk | "low" | "medium" | "high" | required | |
| preview | string | required | |
| arguments | object | required | |
| requested_by | "user" | "api_key" | "automation" | "system" | required | |
| requester_id | string | null | required | |
| requester | object | null | required | |
| requester.kind | "automation" | "api_key" | "user" | required | |
| requester.id | string | null | required | |
| requester.name | string | null | required | |
| run_id | string | null | required | |
| conversation_id | string | null | required | |
| connection_id | string | null | required | |
| automation_id | string | null | required | |
| decided_via | "human" | "auto_rule" | "expiry" | null | required | |
| decided_by | string | null | required | |
| decided_at | string (date-time) | null | required | |
| decision_note | string | null | required | |
| expires_at | string (date-time) | required | |
| created_at | string (date-time) | required |
POST /v1/approvals/{id}/reject
Reject the held action
Scopes approvals:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| note | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "approval" | required | |
| action | string | required | |
| state | "pending" | "approved" | "rejected" | "expired" | "executed" | "failed" | required | |
| risk | "low" | "medium" | "high" | required | |
| preview | string | required | |
| arguments | object | required | |
| requested_by | "user" | "api_key" | "automation" | "system" | required | |
| requester_id | string | null | required | |
| requester | object | null | required | |
| requester.kind | "automation" | "api_key" | "user" | required | |
| requester.id | string | null | required | |
| requester.name | string | null | required | |
| run_id | string | null | required | |
| conversation_id | string | null | required | |
| connection_id | string | null | required | |
| automation_id | string | null | required | |
| decided_via | "human" | "auto_rule" | "expiry" | null | required | |
| decided_by | string | null | required | |
| decided_at | string (date-time) | null | required | |
| decision_note | string | null | required | |
| expires_at | string (date-time) | required | |
| created_at | string (date-time) | required |
/v1/auth
GET /v1/auth/invitation
Is there a valid invitation for the signed-in address? Workspace and role, or why not
Scopes none (public endpoint)
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "invitation_check" | required | |
| status | "valid" | "expired" | "none" | required | |
| invitations | object[] | required | |
| invitations[].organization_id | string | required | |
| invitations[].organization_name | string | required | |
| invitations[].role | "owner" | "admin" | "member" | required |
POST /v1/auth/join-request
Ask to join the workspace on your email domain. The same 202 whether or not one exists
Scopes none (public endpoint)
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| user_name | string | required |
Response 202
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "join_request" | required | |
| domain | string | required |
POST /v1/auth/provision
Provision a user and workspace, and mint their first dashboard token
Scopes none (public endpoint)
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| user_name | string | required | |
| organization_id | string | optional | |
| organization_name | string | optional | |
| organization_slug | string | optional | |
| timezone | string | optional | |
| from | string | null | optional | |
| utm_source | string | null | optional | |
| utm_medium | string | null | optional | |
| utm_campaign | string | null | optional | |
| utm_term | string | null | optional | |
| utm_content | string | null | optional | |
| landing_path | string | null | optional | |
| referrer | string | null | optional | |
| heard_from | string | null | optional | |
| heard_other | string | null | optional | |
| cta | string | null | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| token | string | required | |
| expires_at | string (date-time) | required | |
| organization_id | string | required | |
| role | "owner" | "admin" | "member" | "support" | required | |
| account_message | string | null | required |
POST /v1/auth/refresh
Re-mint a 15-minute dashboard token for an already-provisioned user
Scopes none (public endpoint)
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| organization_id | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| token | string | required | |
| expires_at | string (date-time) | required | |
| organization_id | string | required | |
| role | "owner" | "admin" | "member" | "support" | required | |
| account_message | string | null | required |
POST /v1/auth/repeated-signup
Tell us a signup came back as a duplicate. Always 204, whatever the address
Scopes none (public endpoint)
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| string (email) | required |
Response 204
No content
POST /v1/auth/workspace-address
Is this workspace address free? One 200 shape for every verdict, shape problems named
Scopes none (public endpoint)
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| slug | string | required |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "workspace_address" | required | |
| slug | string | required | |
| available | boolean | required | |
| problem | "too_short" | "too_long" | "bad_characters" | "hyphen_at_edge" | "taken" | null | required |
/v1/automation-catalogue
GET /v1/automation-catalogue
Every block and trigger an automation is built from, with its inputs and outputs. ?connection_id= lists only what can be built on that number
Scopes automations:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| connection_id | query | string | optional | One WhatsApp number's (connection id). Lists only what can be built and run on it: the blocks the workspace's plan includes, the integrations working for that number and their actions, the triggers something sends there, and the document's schema. Left out, every block and trigger is listed, each marked available or not. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "automation_catalogue" | required | |
| version | string | required | |
| blocks | object[] | required | |
| blocks[].name | string | required | |
| blocks[].node | string | required | |
| blocks[].version | string | required | |
| blocks[].category | string | required | |
| blocks[].display_name | string | required | |
| blocks[].description | string | required | |
| blocks[].input_schema | object | required | The JSON Schema of what the step takes, with the recipe forms’ picker where an input is one (tag, template, language, sheet, account). A send’s to is picker: "recipient", with two choices: customer, “The customer who wrote”, which binds binds ({ "kind": "ref", "path": "contact.id" }) and is offered, and chosen first, on the starts its starts lists; and number, “A fixed number”, typed with its country code as its description says. Validate refuses a send with neither (missing_recipient) and a number the phone rule refuses (unusable_recipient), in plain words naming the step, at <step>/inputs/to. Every other input naming one contact is picker: "contact", with the same two choices, refused as missing_contact and unusable_contact; every input naming a chat is picker: "conversation", with one choice, chat, “This chat”, which binds { "kind": "ref", "path": "conversation.id" } and is offered, and chosen first, on the starts its starts lists, refused left empty as missing_conversation. Each refusal is at <step>/inputs/<input>. |
| blocks[].output_schema | object | required | |
| blocks[].side_effect | "none" | "internal_write" | "external_send" | "money" | required | |
| blocks[].destructive | boolean | required | |
| blocks[].requires_connection | string | null | required | |
| blocks[].available | boolean | required | |
| blocks[].unavailable_reason | string | null | required | Why the block cannot be used, in one plain sentence an owner reads: the sentence validate refuses it with at save. null when available is true. |
| blocks[].outcomes | object[] | required | The named outcomes this block may end with besides working or failing, each with the causes it gives. A split block maps one to a branch ({ "type": "outcome", "step", "is", "cause" }). Empty for a block that only works or fails. |
| blocks[].outcomes[].name | string | required | |
| blocks[].outcomes[].description | string | required | |
| blocks[].outcomes[].causes | object[] | required | |
| blocks[].test_reads_for_real | object[] | required | The integration actions a Test runs for real through this block: reads, each marked so one by one. Every other integration action is held back in a Test, whatever it does. Empty for every block but “Call an integration”; any other block runs in a Test only when its side_effect is none. |
| blocks[].test_reads_for_real[].integration | string | required | |
| blocks[].test_reads_for_real[].action | string | required | |
| blocks[].test_reads_for_real[].title | string | required | |
| triggers | object[] | required | |
| triggers[].name | string | required | |
| triggers[].description | string | required | |
| triggers[].inputs | object | required | |
| triggers[].produced_by | string | null | required | |
| triggers[].available | boolean | required | |
| triggers[].params_schema | object | required | The JSON Schema of the trigger’s params: exactly the ones it accepts, each with a plain description, required naming the ones it needs, and the recipe forms’ picker where a param is one (tag, account, form, sheet, tab). On a start an integration delivers, account also has connectors: the keys of the integrations whose accounts it starts on, the ones switching on binds, listing the integrations this workspace can connect; so do form_id, spreadsheet_id and sheet, with the integrations whose trigger takes that setting. An empty object schema when it takes none. Validate refuses any other param, and a needed one left out, at /trigger/params/<name>. |
| triggers[].answers | boolean | required | Whether the trigger can carry answers (what of a customer’s message the automation claims). Only whatsapp.message_received can. |
| triggers[].filters | object[] | required | The checks on the event a builder offers on this start, each optional (“From contains”). Each is one clause of the trigger’s filters.only_when: clause, with the owner’s value as a lit where the param named name stands. Several are one { "kind": "op", "op": "and", "args": [...] }. They are decided before a run exists: an event they keep out is not run and counts nothing (its run is skipped, filtered). Only email.received has any: from_contains and subject_contains, matched in any case, and label, a Gmail label matched exactly (the owner’s by name, Gmail’s own by id, such as STARRED). Empty on every other trigger. |
| triggers[].filters[].name | string | required | |
| triggers[].filters[].title | string | required | |
| triggers[].filters[].description | string | required | |
| triggers[].filters[].clause | object | required | |
| triggers[].start_if | object[] | optional | The start conditions the trigger takes in filters.start_if: a list of { "type": … }, and it starts if ANY is met. An event that meets none is not run and counts nothing (its run is skipped, filtered). On whatsapp.message_received (five that read the message) and contact.tagged (not_asked_for_review); absent on every other trigger. |
| triggers[].start_if[].type | "first_message" | "own_button_tap" | "while_closed" | "contains_words" | "not_asked_for_review" | "new_ad_chat" | "new_contacts_only" | required | |
| triggers[].start_if[].description | string | required | |
| triggers[].dedupe_keys | string[] | required | The paths the trigger’s dedupe.key can name: the fields of what it carries (contact.id). The automation does not start again for the same value at that path within dedupe.window_s seconds. Validate refuses any other key, at /trigger/dedupe/key. |
| integrations | object[] | required | Every integration that has actions, with them: what a “Call an integration” step can name as its integration and action, and what each takes and answers. |
| integrations[].integration | string | required | The integration’s key: what a “Call an integration” step names as integration. |
| integrations[].actions | object[] | required | |
| integrations[].actions[].action | string | required | The action’s key: what the step names as action. |
| integrations[].actions[].title | string | required | |
| integrations[].actions[].description | string | null | required | What the action does, in plain words. null when it declares none. |
| integrations[].actions[].input_schema | object | required | The JSON Schema of the step’s input: a field with a default may be left out. |
| integrations[].actions[].output_schema | object | null | required | The JSON Schema of what the action answers, which the step returns as result. null when the action does not declare it. |
| integrations[].actions[].side_effect | "none" | "internal_write" | "external_send" | required | |
| integrations[].actions[].destructive | boolean | required | Whether it deletes or cancels something that cannot be got back. A step that calls it is confirmed by the name integration.call:<integration>.<action> before the automation is switched on, and data a stranger controls may not decide whether it runs. |
| integrations[].actions[].test_reads_for_real | boolean | required | Whether a Test runs it for real: a read, marked so. Every other action is held back in a Test. |
| document_schema | object | optional | The JSON Schema of an automation document (ir_version 1.0): what it starts on, its steps (actions, conditions, branches, loops, waits) and the expressions a condition is written in, each operator and function by name. Present when connection_id names a number. |
/v1/automations
GET /v1/automations
The workspace’s automations, with today’s runs and who set each up. ?connection_id= (repeatable) lists those numbers’, ?slug= one kind
Scopes automations:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| limit | query | integer | optional | |
| after | query | string | optional | |
| before | query | string | optional | |
| connection_id | query | string | string[] | optional | WhatsApp numbers (connection ids), repeatable: the rows for any of them. Automations: those on it, and those with no number, which run on every number. Runs: those that ran on it, and those that name no number of their own whose automation is one of these. |
| slug | query | string | optional | Only the automations with this slug, as GET /v1/recipes names a recipe: one per number it is set up on. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].object | "automation" | required | |
| data[].slug | string | required | |
| data[].name | string | required | |
| data[].description | string | null | required | |
| data[].status | "draft" | "enabled" | "disabled" | "archived" | "auto_disabled" | required | |
| data[].trigger_kind | string | required | |
| data[].trigger_config | object | required | |
| data[].connection_id | string | null | required | |
| data[].active_version_id | string | null | required | |
| data[].consecutive_failures | integer | required | |
| data[].last_run_at | string (date-time) | null | required | |
| data[].last_error | string | null | required | |
| data[].auto_disabled_at | string (date-time) | null | required | |
| data[].auto_disabled_reason | string | null | required | |
| data[].refunds | "off" | "ask_first" | "on_its_own" | required | This automation’s own rule for its refund steps (a step whose action a person approves: WooCommerce’s Refund the order, or a payment service’s Refund a payment). ask_first: each refund waits for a person under Approvals (the automation waits for it first). on_its_own: it refunds with no person checking it. off: it does not refund, and saving a version with a refund step is refused. ask_first until set. An owner or an admin changes it. |
| data[].created_at | string (date-time) | required | |
| data[].updated_at | string (date-time) | required | |
| data[].can_run | boolean | required | |
| data[].blocked_reason | string | null | required | |
| data[].activation | object | required | Whether this automation can run, as far as WhatsApp templates go: every template it sends must be approved and not paused on the number it sends from (every number when it names none), in the language the step names, else in any language. A template WhatsApp paused holds the whole automation, as one waiting for approval does. |
| data[].activation.state | "active" | "pending_template_approvals" | required | active: no template this automation sends waits for WhatsApp (or it sends none). pending_template_approvals: one or more is not approved, or is paused by WhatsApp; no step runs for any trigger and nothing is sent. Each trigger ends its run skipped (skip_reason template_pending), which is not a failure, until every one is approved and not paused, and then it runs by itself. Read with status, which says whether it is switched on. |
| data[].activation.message | string | null | required | What it means and what the owner does next, in sentences for the owner. null when active. |
| data[].activation.templates | object[] | required | Every template send that is not approved, not_approved ones first. Empty when active. |
| data[].template_approval | object | null | required | The first entry of activation.templates, kept for older clients: a template not approved is named before a pending one. null when activation.state is active. |
| data[].template_approval.code | "template_pending" | "template_rejected" | required | template_pending: WhatsApp is reviewing the message, or paused it. template_rejected: WhatsApp did not approve it. Either way no step of the automation runs until every template it sends is approved and not paused (see activation). |
| data[].template_approval.template | string | required | The template's system name, as the automation sends it. |
| data[].template_approval.message | string | required | What it means, in a sentence for the owner. |
| data[].active_version | any | optional | |
| data[].latest_version | any | optional | |
| data[].settings | object | optional | |
| data[].settings.version_id | string | required | |
| data[].settings.version_no | integer | required | |
| data[].settings.recipe_slug | string | null | required | The recipe the version was made from (the IR’s recipe_id); null for an automation written by hand. |
| data[].settings.params | object | null | required | The value of each setting the version declares, as chosen. A new value is saved as a new version (POST /v1/automations/{id}/versions) whose document gives it: for a recipe-made automation, the document POST /v1/recipes/{slug}/instantiate makes from the new values, which writes them into its steps; for one written by hand, its own document, whose steps name its settings. Either way the values are checked there against the version’s own settings, the same way. null when the version gives none. |
| data[].settings.inputs_schema | object | null | required | The settings the version declares, as a JSON Schema to draw the form from. For a recipe-made automation it is the same as its card in GET /v1/recipes. required names each one it cannot run without. null when it declares none. |
| data[].authoring_conversation_id | string | null | optional | On GET /v1/automations/{id}: the AI authoring conversation that holds this automation (GET /v1/ai/authoring/{id}), or null when none does. An automation has at most one. |
| data[].conflicts | object[] | optional | On POST /v1/automations/{id}/enable and GET /v1/automations/{id}: every other switched-on automation on its number that starts on the same thing: the same trigger, and the same tag, account, form, sheet, schedule or web address where it has one (one left out is every one); on incoming messages, every other one; on a schedule, also every other one whose steps use the same Google sheet, at whatever time it runs. Empty while this one is off. Only automations the caller can read are named. Nothing is refused or switched off: the owner decides. |
| data[].conflicts[].automation_id | string | required | |
| data[].conflicts[].name | string | required | |
| data[].conflicts[].shares | string | required | What both start on, in words for the owner: "both answer incoming messages", "both start when a contact gets a tag (tag VIP)". |
| data[].conflicts[].answers_first | boolean | null | required | On incoming messages, when both reply: whether this automation answers a customer’s message before that one, by the order the number offers a message in (the one the live order uses): a customer one of them is waiting on, then a keyword or an ad its start names (trigger.answers.starts_when), then one that answers every message; set up first among equals. One whose start claims no message (a keyword checked only inside its flow) comes after one that does. null when one of the two does not reply, or neither claims a message, so both run; and on every other trigger. |
| data[].sheets | object[] | optional | On GET /v1/automations/{id}: each Google Sheet its steps add to, update or find rows in, once each, in step order. Read from the switched-on version, or the newest when none is switched on. Empty when no step uses one. |
| data[].sheets[].spreadsheet_id | string | required | Google’s id for the spreadsheet. |
| data[].sheets[].title | string | null | required | The name Google gave it when Cosend made it. null for a spreadsheet the owner picked, which Cosend did not make. |
| data[].sheets[].tab | string | null | required | The tab its steps’ ranges name before a ! (the first one named). null when none names one: they use the spreadsheet’s first tab. |
| data[].sheets[].url | string | null | required | Google’s link to open it, as Google gave it when Cosend made it. null for a spreadsheet the owner picked. |
| data[].warnings | object[] | optional | Present only on the answer to the call that switched it on, when something about it needs saying. The automation is on: it is a note, never an error. |
| data[].warnings[].code | "catch_all_shadowed" | required | catch_all_shadowed: two automations on this number answer every message. The one set up first answers; the other answers only taps on buttons it sent and customers it is waiting on, while the first is on. |
| data[].warnings[].message | string | required | What it means, in sentences for the owner. |
| data[].runs_today | integer | required | |
| data[].failures_today | integer | required | |
| data[].created_by | object | null | required | |
| data[].created_by.id | string | required | |
| data[].created_by.name | string | required | |
| has_more | boolean | required | |
| next_cursor | string | null | required |
POST /v1/automations
Create an automation from an IR document. The automation is created as a draft
Scopes automations:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | optional |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| slug | string | required | |
| name | string | required | |
| description | string | null | optional | |
| connection_id | string | required | The WhatsApp number (connection id) this automation belongs to: its triggers come from it, its messages go from it, and its templates are read on it. Required, and it cannot be moved afterwards. The same recipe (slug) can be set up once on each number, or once per source on it when the recipe has multiple. |
| ir | object | required | The automation’s flow document (the IR), as a JSON object. ir_version selects the document schema Cosend validates it against. A document that does not match is refused with automation_invalid, whose error.details[] names each failing path as a JSON pointer. |
| ir.ir_version | "1.0" | required | |
| change_note | string | optional |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "automation" | required | |
| slug | string | required | |
| name | string | required | |
| description | string | null | required | |
| status | "draft" | "enabled" | "disabled" | "archived" | "auto_disabled" | required | |
| trigger_kind | string | required | |
| trigger_config | object | required | |
| connection_id | string | null | required | |
| active_version_id | string | null | required | |
| consecutive_failures | integer | required | |
| last_run_at | string (date-time) | null | required | |
| last_error | string | null | required | |
| auto_disabled_at | string (date-time) | null | required | |
| auto_disabled_reason | string | null | required | |
| refunds | "off" | "ask_first" | "on_its_own" | required | This automation’s own rule for its refund steps (a step whose action a person approves: WooCommerce’s Refund the order, or a payment service’s Refund a payment). ask_first: each refund waits for a person under Approvals (the automation waits for it first). on_its_own: it refunds with no person checking it. off: it does not refund, and saving a version with a refund step is refused. ask_first until set. An owner or an admin changes it. |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required | |
| can_run | boolean | required | |
| blocked_reason | string | null | required | |
| activation | object | required | Whether this automation can run, as far as WhatsApp templates go: every template it sends must be approved and not paused on the number it sends from (every number when it names none), in the language the step names, else in any language. A template WhatsApp paused holds the whole automation, as one waiting for approval does. |
| activation.state | "active" | "pending_template_approvals" | required | active: no template this automation sends waits for WhatsApp (or it sends none). pending_template_approvals: one or more is not approved, or is paused by WhatsApp; no step runs for any trigger and nothing is sent. Each trigger ends its run skipped (skip_reason template_pending), which is not a failure, until every one is approved and not paused, and then it runs by itself. Read with status, which says whether it is switched on. |
| activation.message | string | null | required | What it means and what the owner does next, in sentences for the owner. null when active. |
| activation.templates | object[] | required | Every template send that is not approved, not_approved ones first. Empty when active. |
| activation.templates[].name | string | required | The template's system name, as the automation sends it. |
| activation.templates[].language | string | null | required | The language the step names; null when it names none, and any sendable language would do. |
| activation.templates[].display_name | string | required | The name the owner gave it, as the Templates page shows it. |
| activation.templates[].approval | "waiting" | "not_approved" | "paused" | required | waiting: WhatsApp is reviewing it (pending, or in appeal). not_approved: WhatsApp has not approved it (rejected, or any status but pending, in appeal, approved or paused), or the number does not have it; the owner changes it on the Templates page and submits it again, or chooses another. paused: WhatsApp paused it (its quality); the automation runs again by itself once WhatsApp un-pauses it. |
| template_approval | object | null | required | The first entry of activation.templates, kept for older clients: a template not approved is named before a pending one. null when activation.state is active. |
| template_approval.code | "template_pending" | "template_rejected" | required | template_pending: WhatsApp is reviewing the message, or paused it. template_rejected: WhatsApp did not approve it. Either way no step of the automation runs until every template it sends is approved and not paused (see activation). |
| template_approval.template | string | required | The template's system name, as the automation sends it. |
| template_approval.message | string | required | What it means, in a sentence for the owner. |
| active_version | any | optional | |
| latest_version | any | optional | |
| settings | object | optional | |
| settings.version_id | string | required | |
| settings.version_no | integer | required | |
| settings.recipe_slug | string | null | required | The recipe the version was made from (the IR’s recipe_id); null for an automation written by hand. |
| settings.params | object | null | required | The value of each setting the version declares, as chosen. A new value is saved as a new version (POST /v1/automations/{id}/versions) whose document gives it: for a recipe-made automation, the document POST /v1/recipes/{slug}/instantiate makes from the new values, which writes them into its steps; for one written by hand, its own document, whose steps name its settings. Either way the values are checked there against the version’s own settings, the same way. null when the version gives none. |
| settings.inputs_schema | object | null | required | The settings the version declares, as a JSON Schema to draw the form from. For a recipe-made automation it is the same as its card in GET /v1/recipes. required names each one it cannot run without. null when it declares none. |
| settings.inputs_schema.order | string[] | optional | The order the settings are shown in: the name of every setting in properties, first to last, as declared. properties itself comes back in no particular order. Every recipe in the library, and every automation that declares settings, carries it. |
| settings.inputs_schema.properties | object | optional | |
| authoring_conversation_id | string | null | optional | On GET /v1/automations/{id}: the AI authoring conversation that holds this automation (GET /v1/ai/authoring/{id}), or null when none does. An automation has at most one. |
| conflicts | object[] | optional | On POST /v1/automations/{id}/enable and GET /v1/automations/{id}: every other switched-on automation on its number that starts on the same thing: the same trigger, and the same tag, account, form, sheet, schedule or web address where it has one (one left out is every one); on incoming messages, every other one; on a schedule, also every other one whose steps use the same Google sheet, at whatever time it runs. Empty while this one is off. Only automations the caller can read are named. Nothing is refused or switched off: the owner decides. |
| conflicts[].automation_id | string | required | |
| conflicts[].name | string | required | |
| conflicts[].shares | string | required | What both start on, in words for the owner: "both answer incoming messages", "both start when a contact gets a tag (tag VIP)". |
| conflicts[].answers_first | boolean | null | required | On incoming messages, when both reply: whether this automation answers a customer’s message before that one, by the order the number offers a message in (the one the live order uses): a customer one of them is waiting on, then a keyword or an ad its start names (trigger.answers.starts_when), then one that answers every message; set up first among equals. One whose start claims no message (a keyword checked only inside its flow) comes after one that does. null when one of the two does not reply, or neither claims a message, so both run; and on every other trigger. |
| sheets | object[] | optional | On GET /v1/automations/{id}: each Google Sheet its steps add to, update or find rows in, once each, in step order. Read from the switched-on version, or the newest when none is switched on. Empty when no step uses one. |
| sheets[].spreadsheet_id | string | required | Google’s id for the spreadsheet. |
| sheets[].title | string | null | required | The name Google gave it when Cosend made it. null for a spreadsheet the owner picked, which Cosend did not make. |
| sheets[].tab | string | null | required | The tab its steps’ ranges name before a ! (the first one named). null when none names one: they use the spreadsheet’s first tab. |
| sheets[].url | string | null | required | Google’s link to open it, as Google gave it when Cosend made it. null for a spreadsheet the owner picked. |
| warnings | object[] | optional | Present only on the answer to the call that switched it on, when something about it needs saying. The automation is on: it is a note, never an error. |
| warnings[].code | "catch_all_shadowed" | required | catch_all_shadowed: two automations on this number answer every message. The one set up first answers; the other answers only taps on buttons it sent and customers it is waiting on, while the first is on. |
| warnings[].message | string | required | What it means, in sentences for the owner. |
Errors automation_invalid
GET /v1/automations/{id}
One automation. ?expand=active_version includes the deployed version; ?expand=latest_version the newest one; ?expand=settings the newest version’s recipe settings
Scopes automations:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| expand | query | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "automation" | required | |
| slug | string | required | |
| name | string | required | |
| description | string | null | required | |
| status | "draft" | "enabled" | "disabled" | "archived" | "auto_disabled" | required | |
| trigger_kind | string | required | |
| trigger_config | object | required | |
| connection_id | string | null | required | |
| active_version_id | string | null | required | |
| consecutive_failures | integer | required | |
| last_run_at | string (date-time) | null | required | |
| last_error | string | null | required | |
| auto_disabled_at | string (date-time) | null | required | |
| auto_disabled_reason | string | null | required | |
| refunds | "off" | "ask_first" | "on_its_own" | required | This automation’s own rule for its refund steps (a step whose action a person approves: WooCommerce’s Refund the order, or a payment service’s Refund a payment). ask_first: each refund waits for a person under Approvals (the automation waits for it first). on_its_own: it refunds with no person checking it. off: it does not refund, and saving a version with a refund step is refused. ask_first until set. An owner or an admin changes it. |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required | |
| can_run | boolean | required | |
| blocked_reason | string | null | required | |
| activation | object | required | Whether this automation can run, as far as WhatsApp templates go: every template it sends must be approved and not paused on the number it sends from (every number when it names none), in the language the step names, else in any language. A template WhatsApp paused holds the whole automation, as one waiting for approval does. |
| activation.state | "active" | "pending_template_approvals" | required | active: no template this automation sends waits for WhatsApp (or it sends none). pending_template_approvals: one or more is not approved, or is paused by WhatsApp; no step runs for any trigger and nothing is sent. Each trigger ends its run skipped (skip_reason template_pending), which is not a failure, until every one is approved and not paused, and then it runs by itself. Read with status, which says whether it is switched on. |
| activation.message | string | null | required | What it means and what the owner does next, in sentences for the owner. null when active. |
| activation.templates | object[] | required | Every template send that is not approved, not_approved ones first. Empty when active. |
| activation.templates[].name | string | required | The template's system name, as the automation sends it. |
| activation.templates[].language | string | null | required | The language the step names; null when it names none, and any sendable language would do. |
| activation.templates[].display_name | string | required | The name the owner gave it, as the Templates page shows it. |
| activation.templates[].approval | "waiting" | "not_approved" | "paused" | required | waiting: WhatsApp is reviewing it (pending, or in appeal). not_approved: WhatsApp has not approved it (rejected, or any status but pending, in appeal, approved or paused), or the number does not have it; the owner changes it on the Templates page and submits it again, or chooses another. paused: WhatsApp paused it (its quality); the automation runs again by itself once WhatsApp un-pauses it. |
| template_approval | object | null | required | The first entry of activation.templates, kept for older clients: a template not approved is named before a pending one. null when activation.state is active. |
| template_approval.code | "template_pending" | "template_rejected" | required | template_pending: WhatsApp is reviewing the message, or paused it. template_rejected: WhatsApp did not approve it. Either way no step of the automation runs until every template it sends is approved and not paused (see activation). |
| template_approval.template | string | required | The template's system name, as the automation sends it. |
| template_approval.message | string | required | What it means, in a sentence for the owner. |
| active_version | any | optional | |
| latest_version | any | optional | |
| settings | object | optional | |
| settings.version_id | string | required | |
| settings.version_no | integer | required | |
| settings.recipe_slug | string | null | required | The recipe the version was made from (the IR’s recipe_id); null for an automation written by hand. |
| settings.params | object | null | required | The value of each setting the version declares, as chosen. A new value is saved as a new version (POST /v1/automations/{id}/versions) whose document gives it: for a recipe-made automation, the document POST /v1/recipes/{slug}/instantiate makes from the new values, which writes them into its steps; for one written by hand, its own document, whose steps name its settings. Either way the values are checked there against the version’s own settings, the same way. null when the version gives none. |
| settings.inputs_schema | object | null | required | The settings the version declares, as a JSON Schema to draw the form from. For a recipe-made automation it is the same as its card in GET /v1/recipes. required names each one it cannot run without. null when it declares none. |
| settings.inputs_schema.order | string[] | optional | The order the settings are shown in: the name of every setting in properties, first to last, as declared. properties itself comes back in no particular order. Every recipe in the library, and every automation that declares settings, carries it. |
| settings.inputs_schema.properties | object | optional | |
| authoring_conversation_id | string | null | optional | On GET /v1/automations/{id}: the AI authoring conversation that holds this automation (GET /v1/ai/authoring/{id}), or null when none does. An automation has at most one. |
| conflicts | object[] | optional | On POST /v1/automations/{id}/enable and GET /v1/automations/{id}: every other switched-on automation on its number that starts on the same thing: the same trigger, and the same tag, account, form, sheet, schedule or web address where it has one (one left out is every one); on incoming messages, every other one; on a schedule, also every other one whose steps use the same Google sheet, at whatever time it runs. Empty while this one is off. Only automations the caller can read are named. Nothing is refused or switched off: the owner decides. |
| conflicts[].automation_id | string | required | |
| conflicts[].name | string | required | |
| conflicts[].shares | string | required | What both start on, in words for the owner: "both answer incoming messages", "both start when a contact gets a tag (tag VIP)". |
| conflicts[].answers_first | boolean | null | required | On incoming messages, when both reply: whether this automation answers a customer’s message before that one, by the order the number offers a message in (the one the live order uses): a customer one of them is waiting on, then a keyword or an ad its start names (trigger.answers.starts_when), then one that answers every message; set up first among equals. One whose start claims no message (a keyword checked only inside its flow) comes after one that does. null when one of the two does not reply, or neither claims a message, so both run; and on every other trigger. |
| sheets | object[] | optional | On GET /v1/automations/{id}: each Google Sheet its steps add to, update or find rows in, once each, in step order. Read from the switched-on version, or the newest when none is switched on. Empty when no step uses one. |
| sheets[].spreadsheet_id | string | required | Google’s id for the spreadsheet. |
| sheets[].title | string | null | required | The name Google gave it when Cosend made it. null for a spreadsheet the owner picked, which Cosend did not make. |
| sheets[].tab | string | null | required | The tab its steps’ ranges name before a ! (the first one named). null when none names one: they use the spreadsheet’s first tab. |
| sheets[].url | string | null | required | Google’s link to open it, as Google gave it when Cosend made it. null for a spreadsheet the owner picked. |
| warnings | object[] | optional | Present only on the answer to the call that switched it on, when something about it needs saying. The automation is on: it is a note, never an error. |
| warnings[].code | "catch_all_shadowed" | required | catch_all_shadowed: two automations on this number answer every message. The one set up first answers; the other answers only taps on buttons it sent and customers it is waiting on, while the first is on. |
| warnings[].message | string | required | What it means, in sentences for the owner. |
PATCH /v1/automations/{id}
Metadata only. The logic is versioned, so changes to it and to quiet hours go through /versions
Scopes automations:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | optional | |
| description | string | null | optional | |
| connection_id | string | null | optional | The WhatsApp number for an automation that has none and runs on every number. Accepted once; an automation that has a number keeps it, and another one (or null) is refused. The value it already has, null included, changes nothing. |
| refunds | "off" | "ask_first" | "on_its_own" | optional | This automation’s own rule for its refund steps (a step whose action a person approves: WooCommerce’s Refund the order, or a payment service’s Refund a payment). ask_first: each refund waits for a person under Approvals (the automation waits for it first). on_its_own: it refunds with no person checking it. off: it does not refund, and saving a version with a refund step is refused. ask_first until set. An owner or an admin changes it. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "automation" | required | |
| slug | string | required | |
| name | string | required | |
| description | string | null | required | |
| status | "draft" | "enabled" | "disabled" | "archived" | "auto_disabled" | required | |
| trigger_kind | string | required | |
| trigger_config | object | required | |
| connection_id | string | null | required | |
| active_version_id | string | null | required | |
| consecutive_failures | integer | required | |
| last_run_at | string (date-time) | null | required | |
| last_error | string | null | required | |
| auto_disabled_at | string (date-time) | null | required | |
| auto_disabled_reason | string | null | required | |
| refunds | "off" | "ask_first" | "on_its_own" | required | This automation’s own rule for its refund steps (a step whose action a person approves: WooCommerce’s Refund the order, or a payment service’s Refund a payment). ask_first: each refund waits for a person under Approvals (the automation waits for it first). on_its_own: it refunds with no person checking it. off: it does not refund, and saving a version with a refund step is refused. ask_first until set. An owner or an admin changes it. |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required | |
| can_run | boolean | required | |
| blocked_reason | string | null | required | |
| activation | object | required | Whether this automation can run, as far as WhatsApp templates go: every template it sends must be approved and not paused on the number it sends from (every number when it names none), in the language the step names, else in any language. A template WhatsApp paused holds the whole automation, as one waiting for approval does. |
| activation.state | "active" | "pending_template_approvals" | required | active: no template this automation sends waits for WhatsApp (or it sends none). pending_template_approvals: one or more is not approved, or is paused by WhatsApp; no step runs for any trigger and nothing is sent. Each trigger ends its run skipped (skip_reason template_pending), which is not a failure, until every one is approved and not paused, and then it runs by itself. Read with status, which says whether it is switched on. |
| activation.message | string | null | required | What it means and what the owner does next, in sentences for the owner. null when active. |
| activation.templates | object[] | required | Every template send that is not approved, not_approved ones first. Empty when active. |
| activation.templates[].name | string | required | The template's system name, as the automation sends it. |
| activation.templates[].language | string | null | required | The language the step names; null when it names none, and any sendable language would do. |
| activation.templates[].display_name | string | required | The name the owner gave it, as the Templates page shows it. |
| activation.templates[].approval | "waiting" | "not_approved" | "paused" | required | waiting: WhatsApp is reviewing it (pending, or in appeal). not_approved: WhatsApp has not approved it (rejected, or any status but pending, in appeal, approved or paused), or the number does not have it; the owner changes it on the Templates page and submits it again, or chooses another. paused: WhatsApp paused it (its quality); the automation runs again by itself once WhatsApp un-pauses it. |
| template_approval | object | null | required | The first entry of activation.templates, kept for older clients: a template not approved is named before a pending one. null when activation.state is active. |
| template_approval.code | "template_pending" | "template_rejected" | required | template_pending: WhatsApp is reviewing the message, or paused it. template_rejected: WhatsApp did not approve it. Either way no step of the automation runs until every template it sends is approved and not paused (see activation). |
| template_approval.template | string | required | The template's system name, as the automation sends it. |
| template_approval.message | string | required | What it means, in a sentence for the owner. |
| active_version | any | optional | |
| latest_version | any | optional | |
| settings | object | optional | |
| settings.version_id | string | required | |
| settings.version_no | integer | required | |
| settings.recipe_slug | string | null | required | The recipe the version was made from (the IR’s recipe_id); null for an automation written by hand. |
| settings.params | object | null | required | The value of each setting the version declares, as chosen. A new value is saved as a new version (POST /v1/automations/{id}/versions) whose document gives it: for a recipe-made automation, the document POST /v1/recipes/{slug}/instantiate makes from the new values, which writes them into its steps; for one written by hand, its own document, whose steps name its settings. Either way the values are checked there against the version’s own settings, the same way. null when the version gives none. |
| settings.inputs_schema | object | null | required | The settings the version declares, as a JSON Schema to draw the form from. For a recipe-made automation it is the same as its card in GET /v1/recipes. required names each one it cannot run without. null when it declares none. |
| settings.inputs_schema.order | string[] | optional | The order the settings are shown in: the name of every setting in properties, first to last, as declared. properties itself comes back in no particular order. Every recipe in the library, and every automation that declares settings, carries it. |
| settings.inputs_schema.properties | object | optional | |
| authoring_conversation_id | string | null | optional | On GET /v1/automations/{id}: the AI authoring conversation that holds this automation (GET /v1/ai/authoring/{id}), or null when none does. An automation has at most one. |
| conflicts | object[] | optional | On POST /v1/automations/{id}/enable and GET /v1/automations/{id}: every other switched-on automation on its number that starts on the same thing: the same trigger, and the same tag, account, form, sheet, schedule or web address where it has one (one left out is every one); on incoming messages, every other one; on a schedule, also every other one whose steps use the same Google sheet, at whatever time it runs. Empty while this one is off. Only automations the caller can read are named. Nothing is refused or switched off: the owner decides. |
| conflicts[].automation_id | string | required | |
| conflicts[].name | string | required | |
| conflicts[].shares | string | required | What both start on, in words for the owner: "both answer incoming messages", "both start when a contact gets a tag (tag VIP)". |
| conflicts[].answers_first | boolean | null | required | On incoming messages, when both reply: whether this automation answers a customer’s message before that one, by the order the number offers a message in (the one the live order uses): a customer one of them is waiting on, then a keyword or an ad its start names (trigger.answers.starts_when), then one that answers every message; set up first among equals. One whose start claims no message (a keyword checked only inside its flow) comes after one that does. null when one of the two does not reply, or neither claims a message, so both run; and on every other trigger. |
| sheets | object[] | optional | On GET /v1/automations/{id}: each Google Sheet its steps add to, update or find rows in, once each, in step order. Read from the switched-on version, or the newest when none is switched on. Empty when no step uses one. |
| sheets[].spreadsheet_id | string | required | Google’s id for the spreadsheet. |
| sheets[].title | string | null | required | The name Google gave it when Cosend made it. null for a spreadsheet the owner picked, which Cosend did not make. |
| sheets[].tab | string | null | required | The tab its steps’ ranges name before a ! (the first one named). null when none names one: they use the spreadsheet’s first tab. |
| sheets[].url | string | null | required | Google’s link to open it, as Google gave it when Cosend made it. null for a spreadsheet the owner picked. |
| warnings | object[] | optional | Present only on the answer to the call that switched it on, when something about it needs saying. The automation is on: it is a note, never an error. |
| warnings[].code | "catch_all_shadowed" | required | catch_all_shadowed: two automations on this number answer every message. The one set up first answers; the other answers only taps on buttons it sent and customers it is waiting on, while the first is on. |
| warnings[].message | string | required | What it means, in sentences for the owner. |
DELETE /v1/automations/{id}
Delete an automation. No run starts after it, it leaves the list, its id answers 404
Scopes automations:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "automation" | required | |
| deleted | true | required |
POST /v1/automations/{id}/actions/check
Check an actions list as deploy, switch-on and a run check it. It writes nothing
Scopes automations:read
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| version_id | string | optional | |
| actions | string[] | required | Every action the automation’s steps take, and those of a second automation set up with it, each once: what a person approves it doing. A list that leaves one out, or names one the steps do not take, is refused, and the refusal gives the list in error.actions. A version’s actions lists them too. |
| live | true | optional | The live version, as POST /v1/runs checks it. It wins over version_id. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| ok | true | required |
POST /v1/automations/{id}/copy
Make a custom copy of an automation, a recipe’s included: switched off, on the same number, with its own copy of the persona, knowledge and remembered values
Scopes automations:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | optional |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | optional | The copy’s name. Absent: the original’s, followed by “(copy)”. |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "automation" | required | |
| slug | string | required | |
| name | string | required | |
| description | string | null | required | |
| status | "draft" | "enabled" | "disabled" | "archived" | "auto_disabled" | required | |
| trigger_kind | string | required | |
| trigger_config | object | required | |
| connection_id | string | null | required | |
| active_version_id | string | null | required | |
| consecutive_failures | integer | required | |
| last_run_at | string (date-time) | null | required | |
| last_error | string | null | required | |
| auto_disabled_at | string (date-time) | null | required | |
| auto_disabled_reason | string | null | required | |
| refunds | "off" | "ask_first" | "on_its_own" | required | This automation’s own rule for its refund steps (a step whose action a person approves: WooCommerce’s Refund the order, or a payment service’s Refund a payment). ask_first: each refund waits for a person under Approvals (the automation waits for it first). on_its_own: it refunds with no person checking it. off: it does not refund, and saving a version with a refund step is refused. ask_first until set. An owner or an admin changes it. |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required | |
| can_run | boolean | required | |
| blocked_reason | string | null | required | |
| activation | object | required | Whether this automation can run, as far as WhatsApp templates go: every template it sends must be approved and not paused on the number it sends from (every number when it names none), in the language the step names, else in any language. A template WhatsApp paused holds the whole automation, as one waiting for approval does. |
| activation.state | "active" | "pending_template_approvals" | required | active: no template this automation sends waits for WhatsApp (or it sends none). pending_template_approvals: one or more is not approved, or is paused by WhatsApp; no step runs for any trigger and nothing is sent. Each trigger ends its run skipped (skip_reason template_pending), which is not a failure, until every one is approved and not paused, and then it runs by itself. Read with status, which says whether it is switched on. |
| activation.message | string | null | required | What it means and what the owner does next, in sentences for the owner. null when active. |
| activation.templates | object[] | required | Every template send that is not approved, not_approved ones first. Empty when active. |
| activation.templates[].name | string | required | The template's system name, as the automation sends it. |
| activation.templates[].language | string | null | required | The language the step names; null when it names none, and any sendable language would do. |
| activation.templates[].display_name | string | required | The name the owner gave it, as the Templates page shows it. |
| activation.templates[].approval | "waiting" | "not_approved" | "paused" | required | waiting: WhatsApp is reviewing it (pending, or in appeal). not_approved: WhatsApp has not approved it (rejected, or any status but pending, in appeal, approved or paused), or the number does not have it; the owner changes it on the Templates page and submits it again, or chooses another. paused: WhatsApp paused it (its quality); the automation runs again by itself once WhatsApp un-pauses it. |
| template_approval | object | null | required | The first entry of activation.templates, kept for older clients: a template not approved is named before a pending one. null when activation.state is active. |
| template_approval.code | "template_pending" | "template_rejected" | required | template_pending: WhatsApp is reviewing the message, or paused it. template_rejected: WhatsApp did not approve it. Either way no step of the automation runs until every template it sends is approved and not paused (see activation). |
| template_approval.template | string | required | The template's system name, as the automation sends it. |
| template_approval.message | string | required | What it means, in a sentence for the owner. |
| active_version | any | optional | |
| latest_version | any | optional | |
| settings | object | optional | |
| settings.version_id | string | required | |
| settings.version_no | integer | required | |
| settings.recipe_slug | string | null | required | The recipe the version was made from (the IR’s recipe_id); null for an automation written by hand. |
| settings.params | object | null | required | The value of each setting the version declares, as chosen. A new value is saved as a new version (POST /v1/automations/{id}/versions) whose document gives it: for a recipe-made automation, the document POST /v1/recipes/{slug}/instantiate makes from the new values, which writes them into its steps; for one written by hand, its own document, whose steps name its settings. Either way the values are checked there against the version’s own settings, the same way. null when the version gives none. |
| settings.inputs_schema | object | null | required | The settings the version declares, as a JSON Schema to draw the form from. For a recipe-made automation it is the same as its card in GET /v1/recipes. required names each one it cannot run without. null when it declares none. |
| settings.inputs_schema.order | string[] | optional | The order the settings are shown in: the name of every setting in properties, first to last, as declared. properties itself comes back in no particular order. Every recipe in the library, and every automation that declares settings, carries it. |
| settings.inputs_schema.properties | object | optional | |
| authoring_conversation_id | string | null | optional | On GET /v1/automations/{id}: the AI authoring conversation that holds this automation (GET /v1/ai/authoring/{id}), or null when none does. An automation has at most one. |
| conflicts | object[] | optional | On POST /v1/automations/{id}/enable and GET /v1/automations/{id}: every other switched-on automation on its number that starts on the same thing: the same trigger, and the same tag, account, form, sheet, schedule or web address where it has one (one left out is every one); on incoming messages, every other one; on a schedule, also every other one whose steps use the same Google sheet, at whatever time it runs. Empty while this one is off. Only automations the caller can read are named. Nothing is refused or switched off: the owner decides. |
| conflicts[].automation_id | string | required | |
| conflicts[].name | string | required | |
| conflicts[].shares | string | required | What both start on, in words for the owner: "both answer incoming messages", "both start when a contact gets a tag (tag VIP)". |
| conflicts[].answers_first | boolean | null | required | On incoming messages, when both reply: whether this automation answers a customer’s message before that one, by the order the number offers a message in (the one the live order uses): a customer one of them is waiting on, then a keyword or an ad its start names (trigger.answers.starts_when), then one that answers every message; set up first among equals. One whose start claims no message (a keyword checked only inside its flow) comes after one that does. null when one of the two does not reply, or neither claims a message, so both run; and on every other trigger. |
| sheets | object[] | optional | On GET /v1/automations/{id}: each Google Sheet its steps add to, update or find rows in, once each, in step order. Read from the switched-on version, or the newest when none is switched on. Empty when no step uses one. |
| sheets[].spreadsheet_id | string | required | Google’s id for the spreadsheet. |
| sheets[].title | string | null | required | The name Google gave it when Cosend made it. null for a spreadsheet the owner picked, which Cosend did not make. |
| sheets[].tab | string | null | required | The tab its steps’ ranges name before a ! (the first one named). null when none names one: they use the spreadsheet’s first tab. |
| sheets[].url | string | null | required | Google’s link to open it, as Google gave it when Cosend made it. null for a spreadsheet the owner picked. |
| warnings | object[] | optional | Present only on the answer to the call that switched it on, when something about it needs saying. The automation is on: it is a note, never an error. |
| warnings[].code | "catch_all_shadowed" | required | catch_all_shadowed: two automations on this number answer every message. The one set up first answers; the other answers only taps on buttons it sent and customers it is waiting on, while the first is on. |
| warnings[].message | string | required | What it means, in sentences for the owner. |
POST /v1/automations/{id}/deploy
Compile the version, run the safety checks on the result, and store it on the version
Scopes automations:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| version_id | string | optional | |
| confirm_actions | string[] | optional | |
| actions | string[] | optional | Every action the automation’s steps take, and those of a second automation set up with it, each once: what a person approves it doing. A list that leaves one out, or names one the steps do not take, is refused, and the refusal gives the list in error.actions. A version’s actions lists them too. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "automation_version" | required | |
| automation_id | string | required | |
| version_no | integer | required | |
| status | "draft" | "validated" | "deployed" | "superseded" | "rolled_back" | "failed" | required | |
| ir_hash | string | required | |
| ir | object | optional | |
| compiled_hash | string | null | required | |
| catalogue_version | string | required | |
| compiler_version | string | required | |
| derived_acts | string[] | required | |
| derived_budget | object | required | |
| actions | string[] | required | Every action this version’s steps take, with those of a second automation set up with it, each once: the list /deploy, /enable and POST /v1/runs take as actions. An integration call is integration.call:<integration>.<action>, or integration.call when the step works out which while it runs. |
| segment_count | integer | required | |
| quiet_hours | object | null | required | |
| quiet_hours.start | string | required | |
| quiet_hours.end | string | required | |
| quiet_hours.policy | "shift_to_end" | "shift_to_start" | "skip" | "ignore" | "defer_unless_urgent" | required | |
| authored_by | "user" | "ai" | "recipe" | "system" | "import" | required | |
| change_note | string | null | required | |
| created_at | string (date-time) | required | |
| deployed_at | string (date-time) | null | required | |
| warnings | object[] | optional | Present only on the answer to the call that switched it on, when something about it needs saying. The automation is on: it is a note, never an error. |
| warnings[].code | "catch_all_shadowed" | required | catch_all_shadowed: two automations on this number answer every message. The one set up first answers; the other answers only taps on buttons it sent and customers it is waiting on, while the first is on. |
| warnings[].message | string | required | What it means, in sentences for the owner. |
POST /v1/automations/{id}/disable
Stop an automation. Event triggers stop at once
Scopes automations:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "automation" | required | |
| slug | string | required | |
| name | string | required | |
| description | string | null | required | |
| status | "draft" | "enabled" | "disabled" | "archived" | "auto_disabled" | required | |
| trigger_kind | string | required | |
| trigger_config | object | required | |
| connection_id | string | null | required | |
| active_version_id | string | null | required | |
| consecutive_failures | integer | required | |
| last_run_at | string (date-time) | null | required | |
| last_error | string | null | required | |
| auto_disabled_at | string (date-time) | null | required | |
| auto_disabled_reason | string | null | required | |
| refunds | "off" | "ask_first" | "on_its_own" | required | This automation’s own rule for its refund steps (a step whose action a person approves: WooCommerce’s Refund the order, or a payment service’s Refund a payment). ask_first: each refund waits for a person under Approvals (the automation waits for it first). on_its_own: it refunds with no person checking it. off: it does not refund, and saving a version with a refund step is refused. ask_first until set. An owner or an admin changes it. |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required | |
| can_run | boolean | required | |
| blocked_reason | string | null | required | |
| activation | object | required | Whether this automation can run, as far as WhatsApp templates go: every template it sends must be approved and not paused on the number it sends from (every number when it names none), in the language the step names, else in any language. A template WhatsApp paused holds the whole automation, as one waiting for approval does. |
| activation.state | "active" | "pending_template_approvals" | required | active: no template this automation sends waits for WhatsApp (or it sends none). pending_template_approvals: one or more is not approved, or is paused by WhatsApp; no step runs for any trigger and nothing is sent. Each trigger ends its run skipped (skip_reason template_pending), which is not a failure, until every one is approved and not paused, and then it runs by itself. Read with status, which says whether it is switched on. |
| activation.message | string | null | required | What it means and what the owner does next, in sentences for the owner. null when active. |
| activation.templates | object[] | required | Every template send that is not approved, not_approved ones first. Empty when active. |
| activation.templates[].name | string | required | The template's system name, as the automation sends it. |
| activation.templates[].language | string | null | required | The language the step names; null when it names none, and any sendable language would do. |
| activation.templates[].display_name | string | required | The name the owner gave it, as the Templates page shows it. |
| activation.templates[].approval | "waiting" | "not_approved" | "paused" | required | waiting: WhatsApp is reviewing it (pending, or in appeal). not_approved: WhatsApp has not approved it (rejected, or any status but pending, in appeal, approved or paused), or the number does not have it; the owner changes it on the Templates page and submits it again, or chooses another. paused: WhatsApp paused it (its quality); the automation runs again by itself once WhatsApp un-pauses it. |
| template_approval | object | null | required | The first entry of activation.templates, kept for older clients: a template not approved is named before a pending one. null when activation.state is active. |
| template_approval.code | "template_pending" | "template_rejected" | required | template_pending: WhatsApp is reviewing the message, or paused it. template_rejected: WhatsApp did not approve it. Either way no step of the automation runs until every template it sends is approved and not paused (see activation). |
| template_approval.template | string | required | The template's system name, as the automation sends it. |
| template_approval.message | string | required | What it means, in a sentence for the owner. |
| active_version | any | optional | |
| latest_version | any | optional | |
| settings | object | optional | |
| settings.version_id | string | required | |
| settings.version_no | integer | required | |
| settings.recipe_slug | string | null | required | The recipe the version was made from (the IR’s recipe_id); null for an automation written by hand. |
| settings.params | object | null | required | The value of each setting the version declares, as chosen. A new value is saved as a new version (POST /v1/automations/{id}/versions) whose document gives it: for a recipe-made automation, the document POST /v1/recipes/{slug}/instantiate makes from the new values, which writes them into its steps; for one written by hand, its own document, whose steps name its settings. Either way the values are checked there against the version’s own settings, the same way. null when the version gives none. |
| settings.inputs_schema | object | null | required | The settings the version declares, as a JSON Schema to draw the form from. For a recipe-made automation it is the same as its card in GET /v1/recipes. required names each one it cannot run without. null when it declares none. |
| settings.inputs_schema.order | string[] | optional | The order the settings are shown in: the name of every setting in properties, first to last, as declared. properties itself comes back in no particular order. Every recipe in the library, and every automation that declares settings, carries it. |
| settings.inputs_schema.properties | object | optional | |
| authoring_conversation_id | string | null | optional | On GET /v1/automations/{id}: the AI authoring conversation that holds this automation (GET /v1/ai/authoring/{id}), or null when none does. An automation has at most one. |
| conflicts | object[] | optional | On POST /v1/automations/{id}/enable and GET /v1/automations/{id}: every other switched-on automation on its number that starts on the same thing: the same trigger, and the same tag, account, form, sheet, schedule or web address where it has one (one left out is every one); on incoming messages, every other one; on a schedule, also every other one whose steps use the same Google sheet, at whatever time it runs. Empty while this one is off. Only automations the caller can read are named. Nothing is refused or switched off: the owner decides. |
| conflicts[].automation_id | string | required | |
| conflicts[].name | string | required | |
| conflicts[].shares | string | required | What both start on, in words for the owner: "both answer incoming messages", "both start when a contact gets a tag (tag VIP)". |
| conflicts[].answers_first | boolean | null | required | On incoming messages, when both reply: whether this automation answers a customer’s message before that one, by the order the number offers a message in (the one the live order uses): a customer one of them is waiting on, then a keyword or an ad its start names (trigger.answers.starts_when), then one that answers every message; set up first among equals. One whose start claims no message (a keyword checked only inside its flow) comes after one that does. null when one of the two does not reply, or neither claims a message, so both run; and on every other trigger. |
| sheets | object[] | optional | On GET /v1/automations/{id}: each Google Sheet its steps add to, update or find rows in, once each, in step order. Read from the switched-on version, or the newest when none is switched on. Empty when no step uses one. |
| sheets[].spreadsheet_id | string | required | Google’s id for the spreadsheet. |
| sheets[].title | string | null | required | The name Google gave it when Cosend made it. null for a spreadsheet the owner picked, which Cosend did not make. |
| sheets[].tab | string | null | required | The tab its steps’ ranges name before a ! (the first one named). null when none names one: they use the spreadsheet’s first tab. |
| sheets[].url | string | null | required | Google’s link to open it, as Google gave it when Cosend made it. null for a spreadsheet the owner picked. |
| warnings | object[] | optional | Present only on the answer to the call that switched it on, when something about it needs saying. The automation is on: it is a note, never an error. |
| warnings[].code | "catch_all_shadowed" | required | catch_all_shadowed: two automations on this number answer every message. The one set up first answers; the other answers only taps on buttons it sent and customers it is waiting on, while the first is on. |
| warnings[].message | string | required | What it means, in sentences for the owner. |
POST /v1/automations/{id}/enable
Activate a version, getting a version named ready to run first if it is not. For event triggers it takes effect at once
Scopes automations:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| version_id | string | optional | |
| actions | string[] | optional | Every action the automation’s steps take, and those of a second automation set up with it, each once: what a person approves it doing. A list that leaves one out, or names one the steps do not take, is refused, and the refusal gives the list in error.actions. A version’s actions lists them too. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "automation" | required | |
| slug | string | required | |
| name | string | required | |
| description | string | null | required | |
| status | "draft" | "enabled" | "disabled" | "archived" | "auto_disabled" | required | |
| trigger_kind | string | required | |
| trigger_config | object | required | |
| connection_id | string | null | required | |
| active_version_id | string | null | required | |
| consecutive_failures | integer | required | |
| last_run_at | string (date-time) | null | required | |
| last_error | string | null | required | |
| auto_disabled_at | string (date-time) | null | required | |
| auto_disabled_reason | string | null | required | |
| refunds | "off" | "ask_first" | "on_its_own" | required | This automation’s own rule for its refund steps (a step whose action a person approves: WooCommerce’s Refund the order, or a payment service’s Refund a payment). ask_first: each refund waits for a person under Approvals (the automation waits for it first). on_its_own: it refunds with no person checking it. off: it does not refund, and saving a version with a refund step is refused. ask_first until set. An owner or an admin changes it. |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required | |
| can_run | boolean | required | |
| blocked_reason | string | null | required | |
| activation | object | required | Whether this automation can run, as far as WhatsApp templates go: every template it sends must be approved and not paused on the number it sends from (every number when it names none), in the language the step names, else in any language. A template WhatsApp paused holds the whole automation, as one waiting for approval does. |
| activation.state | "active" | "pending_template_approvals" | required | active: no template this automation sends waits for WhatsApp (or it sends none). pending_template_approvals: one or more is not approved, or is paused by WhatsApp; no step runs for any trigger and nothing is sent. Each trigger ends its run skipped (skip_reason template_pending), which is not a failure, until every one is approved and not paused, and then it runs by itself. Read with status, which says whether it is switched on. |
| activation.message | string | null | required | What it means and what the owner does next, in sentences for the owner. null when active. |
| activation.templates | object[] | required | Every template send that is not approved, not_approved ones first. Empty when active. |
| activation.templates[].name | string | required | The template's system name, as the automation sends it. |
| activation.templates[].language | string | null | required | The language the step names; null when it names none, and any sendable language would do. |
| activation.templates[].display_name | string | required | The name the owner gave it, as the Templates page shows it. |
| activation.templates[].approval | "waiting" | "not_approved" | "paused" | required | waiting: WhatsApp is reviewing it (pending, or in appeal). not_approved: WhatsApp has not approved it (rejected, or any status but pending, in appeal, approved or paused), or the number does not have it; the owner changes it on the Templates page and submits it again, or chooses another. paused: WhatsApp paused it (its quality); the automation runs again by itself once WhatsApp un-pauses it. |
| template_approval | object | null | required | The first entry of activation.templates, kept for older clients: a template not approved is named before a pending one. null when activation.state is active. |
| template_approval.code | "template_pending" | "template_rejected" | required | template_pending: WhatsApp is reviewing the message, or paused it. template_rejected: WhatsApp did not approve it. Either way no step of the automation runs until every template it sends is approved and not paused (see activation). |
| template_approval.template | string | required | The template's system name, as the automation sends it. |
| template_approval.message | string | required | What it means, in a sentence for the owner. |
| active_version | any | optional | |
| latest_version | any | optional | |
| settings | object | optional | |
| settings.version_id | string | required | |
| settings.version_no | integer | required | |
| settings.recipe_slug | string | null | required | The recipe the version was made from (the IR’s recipe_id); null for an automation written by hand. |
| settings.params | object | null | required | The value of each setting the version declares, as chosen. A new value is saved as a new version (POST /v1/automations/{id}/versions) whose document gives it: for a recipe-made automation, the document POST /v1/recipes/{slug}/instantiate makes from the new values, which writes them into its steps; for one written by hand, its own document, whose steps name its settings. Either way the values are checked there against the version’s own settings, the same way. null when the version gives none. |
| settings.inputs_schema | object | null | required | The settings the version declares, as a JSON Schema to draw the form from. For a recipe-made automation it is the same as its card in GET /v1/recipes. required names each one it cannot run without. null when it declares none. |
| settings.inputs_schema.order | string[] | optional | The order the settings are shown in: the name of every setting in properties, first to last, as declared. properties itself comes back in no particular order. Every recipe in the library, and every automation that declares settings, carries it. |
| settings.inputs_schema.properties | object | optional | |
| authoring_conversation_id | string | null | optional | On GET /v1/automations/{id}: the AI authoring conversation that holds this automation (GET /v1/ai/authoring/{id}), or null when none does. An automation has at most one. |
| conflicts | object[] | optional | On POST /v1/automations/{id}/enable and GET /v1/automations/{id}: every other switched-on automation on its number that starts on the same thing: the same trigger, and the same tag, account, form, sheet, schedule or web address where it has one (one left out is every one); on incoming messages, every other one; on a schedule, also every other one whose steps use the same Google sheet, at whatever time it runs. Empty while this one is off. Only automations the caller can read are named. Nothing is refused or switched off: the owner decides. |
| conflicts[].automation_id | string | required | |
| conflicts[].name | string | required | |
| conflicts[].shares | string | required | What both start on, in words for the owner: "both answer incoming messages", "both start when a contact gets a tag (tag VIP)". |
| conflicts[].answers_first | boolean | null | required | On incoming messages, when both reply: whether this automation answers a customer’s message before that one, by the order the number offers a message in (the one the live order uses): a customer one of them is waiting on, then a keyword or an ad its start names (trigger.answers.starts_when), then one that answers every message; set up first among equals. One whose start claims no message (a keyword checked only inside its flow) comes after one that does. null when one of the two does not reply, or neither claims a message, so both run; and on every other trigger. |
| sheets | object[] | optional | On GET /v1/automations/{id}: each Google Sheet its steps add to, update or find rows in, once each, in step order. Read from the switched-on version, or the newest when none is switched on. Empty when no step uses one. |
| sheets[].spreadsheet_id | string | required | Google’s id for the spreadsheet. |
| sheets[].title | string | null | required | The name Google gave it when Cosend made it. null for a spreadsheet the owner picked, which Cosend did not make. |
| sheets[].tab | string | null | required | The tab its steps’ ranges name before a ! (the first one named). null when none names one: they use the spreadsheet’s first tab. |
| sheets[].url | string | null | required | Google’s link to open it, as Google gave it when Cosend made it. null for a spreadsheet the owner picked. |
| warnings | object[] | optional | Present only on the answer to the call that switched it on, when something about it needs saying. The automation is on: it is a note, never an error. |
| warnings[].code | "catch_all_shadowed" | required | catch_all_shadowed: two automations on this number answer every message. The one set up first answers; the other answers only taps on buttons it sent and customers it is waiting on, while the first is on. |
| warnings[].message | string | required | What it means, in sentences for the owner. |
| first_use | boolean | required | |
| first_use_feature | "automation_on" | "ai_receptionist_on" | required |
GET /v1/automations/{id}/knowledge
What this AI assistant knows: files, pasted text, websites and Google places. Nothing from another assistant
Scopes automations:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| limit | query | integer | optional | |
| after | query | string | optional | |
| before | query | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].object | "knowledge_source" | required | |
| data[].kind | "file" | "text" | "url" | "place" | required | |
| data[].title | string | required | |
| data[].status | "queued" | "ready" | "failed" | required | |
| data[].error | string | null | required | |
| data[].media_id | string | null | required | |
| data[].url | string | null | required | |
| data[].page_count | integer | null | required | |
| data[].failed_pages | object[] | required | |
| data[].failed_pages[].url | string | required | |
| data[].failed_pages[].reason | string | required | |
| data[].failed_page_count | integer | required | |
| data[].bytes | integer | null | required | |
| data[].refreshed_at | string | null | required | |
| data[].refresh_every | "monthly" | null | required | |
| data[].created_at | string | required | |
| data[].updated_at | string | required | |
| has_more | boolean | required | |
| next_cursor | string | null | required |
POST /v1/automations/{id}/knowledge
Give this AI assistant something to read: a file (med_…), text, a website or a Google Maps link. It is read in the background
Scopes automations:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | optional |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| kind | "file" | required | |
| media_id | string | required | A file uploaded on this automation’s number with POST /v1/media. A file uploaded on another number is refused with media_other_number. |
| text | string | required | |
| title | string | optional | |
| url | string (uri) | required |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "knowledge_source" | required | |
| kind | "file" | "text" | "url" | "place" | required | |
| title | string | required | |
| status | "queued" | "ready" | "failed" | required | |
| error | string | null | required | |
| media_id | string | null | required | |
| url | string | null | required | |
| page_count | integer | null | required | |
| failed_pages | object[] | required | |
| failed_pages[].url | string | required | |
| failed_pages[].reason | string | required | |
| failed_page_count | integer | required | |
| bytes | integer | null | required | |
| refreshed_at | string | null | required | |
| refresh_every | "monthly" | null | required | |
| created_at | string | required | |
| updated_at | string | required |
Errors media_other_number
DELETE /v1/automations/{id}/knowledge/{sourceId}
Forget one of this AI assistant’s knowledge sources, and everything read from it
Scopes automations:write
Response 204
No content
POST /v1/automations/{id}/knowledge/{sourceId}/refresh
Read one of this AI assistant’s knowledge sources again now. A website is also read again every month
Scopes automations:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "knowledge_source" | required | |
| kind | "file" | "text" | "url" | "place" | required | |
| title | string | required | |
| status | "queued" | "ready" | "failed" | required | |
| error | string | null | required | |
| media_id | string | null | required | |
| url | string | null | required | |
| page_count | integer | null | required | |
| failed_pages | object[] | required | |
| failed_pages[].url | string | required | |
| failed_pages[].reason | string | required | |
| failed_page_count | integer | required | |
| bytes | integer | null | required | |
| refreshed_at | string | null | required | |
| refresh_every | "monthly" | null | required | |
| created_at | string | required | |
| updated_at | string | required |
POST /v1/automations/{id}/knowledge/answers
Answer a question this AI assistant could not: the answer joins its knowledge, and the same question is answered from it once it is read
Scopes automations:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | optional |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| question | string | required | |
| answer | string | required |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "knowledge_source" | required | |
| kind | "file" | "text" | "url" | "place" | required | |
| title | string | required | |
| status | "queued" | "ready" | "failed" | required | |
| error | string | null | required | |
| media_id | string | null | required | |
| url | string | null | required | |
| page_count | integer | null | required | |
| failed_pages | object[] | required | |
| failed_pages[].url | string | required | |
| failed_pages[].reason | string | required | |
| failed_page_count | integer | required | |
| bytes | integer | null | required | |
| refreshed_at | string | null | required | |
| refresh_every | "monthly" | null | required | |
| created_at | string | required | |
| updated_at | string | required |
GET /v1/automations/{id}/knowledge/questions
Questions customers asked that this AI assistant could not answer from what it knows, whether or not the chat went to a person. Newest first
Scopes automations:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| connection_id | query | string | optional | Only the questions asked on this number. Every number the assistant answers when not sent. |
| limit | query | integer | optional | |
| after | query | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].object | "unanswered_question" | required | |
| data[].question | string | required | |
| data[].times_asked | integer | required | |
| data[].last_asked_at | string | required | |
| data[].connection_id | string | null | required | |
| data[].conversation_id | string | null | required | |
| has_more | boolean | required | |
| next_cursor | string | null | required |
PATCH /v1/automations/{id}/knowledge/suggestions/{suggestionId}
Accept one of this AI assistant’s suggested questions and answers, with your edits, or reject it. An accepted one becomes its knowledge
Scopes automations:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| accepted | boolean | required | |
| question | string | optional | |
| answer | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "knowledge_suggestion" | required | |
| source_id | string | required | |
| question | string | required | |
| answer | string | required | |
| accepted | boolean | null | required | |
| accepted_source_id | string | null | required | |
| decided_at | string | null | required | |
| created_at | string | required |
GET /v1/automations/{id}/knowledge/summary
“What I learned” for this AI assistant: a short summary and suggested questions and answers to confirm
Scopes automations:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "knowledge_summary" | required | |
| status | "empty" | "learning" | "ready" | "failed" | required | |
| summary | string | null | required | |
| business_name | string | null | required | The business name, read from the material: at most 100 characters. Null when the material did not say. |
| what_you_do | string | null | required | One line about what the business does, read from the material: at most 200 characters. Null when the material did not say. |
| error | string | null | required | |
| generated_at | string | null | required | |
| suggestions | object[] | required | |
| suggestions[].id | string | required | |
| suggestions[].object | "knowledge_suggestion" | required | |
| suggestions[].source_id | string | required | |
| suggestions[].question | string | required | |
| suggestions[].answer | string | required | |
| suggestions[].accepted | boolean | null | required | |
| suggestions[].accepted_source_id | string | null | required | |
| suggestions[].decided_at | string | null | required | |
| suggestions[].created_at | string | required |
GET /v1/automations/{id}/persona
This AI assistant’s persona: the saved one, or the defaults
Scopes automations:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "ai_persona" | required | |
| business_name | string | required | |
| what_you_do | string | required | |
| tone | "friendly" | "neutral" | "formal" | required | |
| may_quote_prices | boolean | required | |
| links | object[] | required | |
| links[].url | string | required | |
| links[].when | string | required | |
| never_say | string[] | required | |
| confidence_threshold | number | required | |
| updated_at | string | null | required |
PATCH /v1/automations/{id}/persona
Change this AI assistant’s persona: send only the fields to change. Typed fields only; there is no free-text prompt
Scopes automations:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| business_name | string | optional | |
| what_you_do | string | optional | |
| tone | "friendly" | "neutral" | "formal" | optional | |
| may_quote_prices | boolean | optional | |
| links | object[] | optional | |
| links[].url | string (uri) | required | |
| links[].when | string | required | |
| never_say | string[] | optional | |
| confidence_threshold | number | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "ai_persona" | required | |
| business_name | string | required | |
| what_you_do | string | required | |
| tone | "friendly" | "neutral" | "formal" | required | |
| may_quote_prices | boolean | required | |
| links | object[] | required | |
| links[].url | string | required | |
| links[].when | string | required | |
| never_say | string[] | required | |
| confidence_threshold | number | required | |
| updated_at | string | null | required |
GET /v1/automations/{id}/procedures
This AI receptionist’s procedures: “when … then …” rules, in order
Scopes automations:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "receptionist_procedures" | required | |
| automation_id | string | required | |
| procedures | object[] | required | |
| procedures[].number | integer | required | |
| procedures[].when | object | required | |
| procedures[].when.kind | "party_size_over" | required | |
| procedures[].when.people | integer | required | |
| procedures[].when.service | string | required | |
| procedures[].steps | object[] | required | |
| procedures[].steps[].kind | "ask" | required | |
| procedures[].steps[].question | string | required | |
| procedures[].steps[].amount | string | required | |
| procedures[].steps[].currency | string | required | |
| procedures[].steps[].ref | string | null | required | What the AI and a payment tool name this deposit by. Its amount is the one stored here, never a number the AI wrote. |
PUT /v1/automations/{id}/procedures
Replace this AI receptionist’s procedures with the list sent. A deposit’s amount is kept as written; the AI never sets one
Scopes automations:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| procedures | object[] | required | The whole list, in order: each a condition (when) and one to four steps (steps) that follow it. It replaces the list there. |
| procedures[].when | object | required | |
| procedures[].when.kind | "party_size_over" | required | |
| procedures[].when.people | integer | required | |
| procedures[].when.service | string | required | |
| procedures[].steps | object[] | required | |
| procedures[].steps[].kind | "ask" | required | |
| procedures[].steps[].question | string | required | |
| procedures[].steps[].amount | string | required | |
| procedures[].steps[].currency | string | required |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "receptionist_procedures" | required | |
| automation_id | string | required | |
| procedures | object[] | required | |
| procedures[].number | integer | required | |
| procedures[].when | object | required | |
| procedures[].when.kind | "party_size_over" | required | |
| procedures[].when.people | integer | required | |
| procedures[].when.service | string | required | |
| procedures[].steps | object[] | required | |
| procedures[].steps[].kind | "ask" | required | |
| procedures[].steps[].question | string | required | |
| procedures[].steps[].amount | string | required | |
| procedures[].steps[].currency | string | required | |
| procedures[].steps[].ref | string | null | required | What the AI and a payment tool name this deposit by. Its amount is the one stored here, never a number the AI wrote. |
GET /v1/automations/{id}/receptionist
This AI receptionist’s settings: what it is (customer service, or customer service and sales), what it may do (bookings, the CRM and payments, each switched on with an account, and their rules; selling the number’s products) and on its own, and the business location it can send as a map pin
Scopes automations:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "receptionist_settings" | required | |
| automation_id | string | required | |
| type | "customer_service" | "sales" | required | customer_service: it answers and helps, and sells nothing (the default). sales: customer service and sales: it takes orders for the number’s products, and takes payments when a payment account is on for it. |
| booking | object | required | |
| booking.customer_confirms | boolean | optional | |
| booking.services | object[] | optional | |
| booking.services[].name | string | required | |
| booking.services[].minutes | integer | required | |
| booking.services[].buffer_minutes | integer | optional | |
| booking.services[].price | object | null | optional | |
| booking.services[].vendor_service_id | string | null | optional | |
| booking.hours | object[] | optional | |
| booking.hours[].days | ("sun" | "mon" | "tue" | "wed" | "thu" | "fri" | "sat")[] | required | |
| booking.hours[].from | string | required | |
| booking.hours[].to | string | required | |
| booking.breaks | object[] | optional | |
| booking.breaks[].from | string | required | |
| booking.breaks[].to | string | required | |
| booking.holidays | object[] | optional | |
| booking.holidays[].from | string (date) | required | |
| booking.holidays[].to | string (date) | required | |
| booking.horizon_days | integer | optional | |
| booking.notice_minutes | integer | optional | |
| booking.cancel_notice_minutes | integer | optional | |
| booking.max_per_day | integer | optional | |
| booking.notify | "every" | "failures" | "none" | optional | |
| booking.on | boolean | required | |
| booking.account_id | string | null | required | |
| crm | object | required | |
| crm.writes | object | optional | |
| crm.writes.note | boolean | required | |
| crm.writes.deal | boolean | required | |
| crm.writes.task | boolean | required | |
| crm.writes.ticket | boolean | required | |
| crm.deal | object | optional | |
| crm.deal.pipeline_id | string | null | required | |
| crm.deal.stage_id | string | null | required | |
| crm.chat_log | "never" | "handover" | "done" | "both" | optional | |
| crm.notify | "every" | "failures" | "none" | optional | |
| crm.on | boolean | required | |
| crm.account_id | string | null | required | |
| payments | object | required | |
| payments.max_link_amount | object | null | optional | |
| payments.max_link_amount.amount_minor | integer | required | |
| payments.max_link_amount.currency | string | required | |
| payments.link_expiry_minutes | integer | null | optional | |
| payments.on | boolean | required | |
| payments.account_id | string | null | required | |
| selling | object | required | Whether it sells the number’s products in the chat and takes their orders. Choosing the type sales switches it on, customer_service off; it can be switched on its own after. |
| selling.on | boolean | required | |
| selling.cash_not_taken | "hand_over" | "payment_link" | required | Ask the owner: "When a customer picks cash on delivery where you don’t take cash: hand the chat to you, or send a payment link?" hand_over: a person takes the chat (the default). payment_link: the order is paid by link and its link sent, as "Send a payment link" allows; with payment links off for the number, a person takes the chat. |
| permissions | object | required | What it may do on its own, per action type: the only place each one is set. Reads and the actions that change nothing a customer has are always on. |
| permissions.destructive | "off" | "ask_first" | "on_its_own" | required | Cancelling or moving a booking, cancelling an order or changing its address. off: it does not do this, and a customer who asks goes to a person. ask_first: an owner or an admin approves each one under Approvals before it runs. on_its_own: it does it, after the customer’s own Confirm tap. |
| permissions.payments | "off" | "ask_first" | "on_its_own" | required | Sending a payment link. off: it does not do this, and a customer who asks goes to a person. ask_first: an owner or an admin approves each one under Approvals before it runs. on_its_own: it does it, after the customer’s own Confirm tap. |
| permissions.refunds | "off" | "ask_first" | "on_its_own" | required | A refund through a payment service or on an order. off: it does not do this, and a customer who asks goes to a person. ask_first: an owner or an admin approves each one under Approvals before it runs. on_its_own: it does it, after the customer’s own Confirm tap. ask_first until set. |
| location | object | null | required | The business location the assistant can send as a map pin, or null when none is set: then it answers with the address in words. |
| location.latitude | number | required | |
| location.longitude | number | required | |
| location.name | string | null | required | |
| location.address | string | null | required | |
| location.maps_link | string | null | required | |
| updated_at | string | null | required |
PATCH /v1/automations/{id}/receptionist
Change this AI receptionist’s settings: send only the fields to change, a list as a whole. The business location is a map pin, or a Google Maps link Cosend reads the position from
Scopes automations:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| type | "customer_service" | "sales" | optional | customer_service: it answers and helps, and sells nothing (the default). sales: customer service and sales: it takes orders for the number’s products, and takes payments when a payment account is on for it. |
| booking | object | optional | Bookings. on: Whether the AI receptionist does this. Off until switched on, with an account. account_id: The integration account it works through (ca_…): one of this workspace’s, used on the receptionist’s WhatsApp number. customer_confirms: the customer confirms a booking or a move with a tap (a cancellation in every case). services: what can be booked, each with its name, minutes, buffer_minutes kept free after it, price and the booking tool’s own service. hours, breaks, holidays, horizon_days (how far ahead), notice_minutes (before a booking), cancel_notice_minutes (before a move or a cancellation), max_per_day (per customer), notify (every, failures or none). |
| booking.on | boolean | optional | |
| booking.account_id | string | null | optional | |
| booking.customer_confirms | boolean | optional | |
| booking.services | object[] | optional | |
| booking.services[].name | string | required | |
| booking.services[].minutes | integer | required | |
| booking.services[].buffer_minutes | integer | optional | |
| booking.services[].price | object | null | optional | |
| booking.services[].vendor_service_id | string | null | optional | |
| booking.hours | object[] | optional | |
| booking.hours[].days | ("sun" | "mon" | "tue" | "wed" | "thu" | "fri" | "sat")[] | required | |
| booking.hours[].from | string | required | |
| booking.hours[].to | string | required | |
| booking.breaks | object[] | optional | |
| booking.breaks[].from | string | required | |
| booking.breaks[].to | string | required | |
| booking.holidays | object[] | optional | |
| booking.holidays[].from | string (date) | required | |
| booking.holidays[].to | string (date) | required | |
| booking.horizon_days | integer | optional | |
| booking.notice_minutes | integer | optional | |
| booking.cancel_notice_minutes | integer | optional | |
| booking.max_per_day | integer | optional | |
| booking.notify | "every" | "failures" | "none" | optional | |
| crm | object | optional | The CRM. on: Whether the AI receptionist does this. Off until switched on, with an account. account_id: The integration account it works through (ca_…): one of this workspace’s, used on the receptionist’s WhatsApp number. writes: beside the contact, a note, a deal, a task or a ticket. deal: the pipeline and stage a deal goes into. chat_log: the chat goes to the CRM at the hand-over, at Done, both, or not at all. notify (every, failures or none). |
| crm.on | boolean | optional | |
| crm.account_id | string | null | optional | |
| crm.writes | object | optional | |
| crm.writes.note | boolean | required | |
| crm.writes.deal | boolean | required | |
| crm.writes.task | boolean | required | |
| crm.writes.ticket | boolean | required | |
| crm.deal | object | optional | |
| crm.deal.pipeline_id | string | null | required | |
| crm.deal.stage_id | string | null | required | |
| crm.chat_log | "never" | "handover" | "done" | "both" | optional | |
| crm.notify | "every" | "failures" | "none" | optional | |
| payments | object | optional | Payments: it sends the customer a link to pay a price the business set. on: Whether the AI receptionist does this. Off until switched on, with an account. account_id: the payment account it uses, such as Stripe or PayPal (ca_…): one of this workspace’s, used on the receptionist’s WhatsApp number. max_link_amount: the most one link may ask for (amount_minor in the currency’s smallest unit, currency in lower case), null for no limit. link_expiry_minutes: how long a link stays open, inside what the payment service allows; null sets none, and the payment service’s own rule applies. |
| payments.on | boolean | optional | |
| payments.account_id | string | null | optional | |
| payments.max_link_amount | object | null | optional | |
| payments.max_link_amount.amount_minor | integer | required | |
| payments.max_link_amount.currency | string | required | |
| payments.link_expiry_minutes | integer | null | optional | |
| selling | object | optional | Selling. on: switch it on or off on its own; sent with type, this one wins. cash_not_taken: Ask the owner: "When a customer picks cash on delivery where you don’t take cash: hand the chat to you, or send a payment link?" hand_over: a person takes the chat (the default). payment_link: the order is paid by link and its link sent, as "Send a payment link" allows; with payment links off for the number, a person takes the chat. |
| selling.on | boolean | optional | |
| selling.cash_not_taken | "hand_over" | "payment_link" | optional | |
| permissions | object | optional | What it may do on its own, per action type: only the types sent change. An owner or an admin only. |
| permissions.destructive | "off" | "ask_first" | "on_its_own" | optional | |
| permissions.payments | "off" | "ask_first" | "on_its_own" | optional | |
| permissions.refunds | "off" | "ask_first" | "on_its_own" | optional | |
| location | object | null | optional | The business location the assistant can send as a map pin: latitude and longitude, or maps_link (the business’s Google Maps link, which Cosend reads the position from), each with an optional name and address. null takes it off. |
| location.latitude | number | required | |
| location.longitude | number | required | |
| location.name | string | optional | |
| location.address | string | optional | |
| location.maps_link | string | required |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "receptionist_settings" | required | |
| automation_id | string | required | |
| type | "customer_service" | "sales" | required | customer_service: it answers and helps, and sells nothing (the default). sales: customer service and sales: it takes orders for the number’s products, and takes payments when a payment account is on for it. |
| booking | object | required | |
| booking.customer_confirms | boolean | optional | |
| booking.services | object[] | optional | |
| booking.services[].name | string | required | |
| booking.services[].minutes | integer | required | |
| booking.services[].buffer_minutes | integer | optional | |
| booking.services[].price | object | null | optional | |
| booking.services[].vendor_service_id | string | null | optional | |
| booking.hours | object[] | optional | |
| booking.hours[].days | ("sun" | "mon" | "tue" | "wed" | "thu" | "fri" | "sat")[] | required | |
| booking.hours[].from | string | required | |
| booking.hours[].to | string | required | |
| booking.breaks | object[] | optional | |
| booking.breaks[].from | string | required | |
| booking.breaks[].to | string | required | |
| booking.holidays | object[] | optional | |
| booking.holidays[].from | string (date) | required | |
| booking.holidays[].to | string (date) | required | |
| booking.horizon_days | integer | optional | |
| booking.notice_minutes | integer | optional | |
| booking.cancel_notice_minutes | integer | optional | |
| booking.max_per_day | integer | optional | |
| booking.notify | "every" | "failures" | "none" | optional | |
| booking.on | boolean | required | |
| booking.account_id | string | null | required | |
| crm | object | required | |
| crm.writes | object | optional | |
| crm.writes.note | boolean | required | |
| crm.writes.deal | boolean | required | |
| crm.writes.task | boolean | required | |
| crm.writes.ticket | boolean | required | |
| crm.deal | object | optional | |
| crm.deal.pipeline_id | string | null | required | |
| crm.deal.stage_id | string | null | required | |
| crm.chat_log | "never" | "handover" | "done" | "both" | optional | |
| crm.notify | "every" | "failures" | "none" | optional | |
| crm.on | boolean | required | |
| crm.account_id | string | null | required | |
| payments | object | required | |
| payments.max_link_amount | object | null | optional | |
| payments.max_link_amount.amount_minor | integer | required | |
| payments.max_link_amount.currency | string | required | |
| payments.link_expiry_minutes | integer | null | optional | |
| payments.on | boolean | required | |
| payments.account_id | string | null | required | |
| selling | object | required | Whether it sells the number’s products in the chat and takes their orders. Choosing the type sales switches it on, customer_service off; it can be switched on its own after. |
| selling.on | boolean | required | |
| selling.cash_not_taken | "hand_over" | "payment_link" | required | Ask the owner: "When a customer picks cash on delivery where you don’t take cash: hand the chat to you, or send a payment link?" hand_over: a person takes the chat (the default). payment_link: the order is paid by link and its link sent, as "Send a payment link" allows; with payment links off for the number, a person takes the chat. |
| permissions | object | required | What it may do on its own, per action type: the only place each one is set. Reads and the actions that change nothing a customer has are always on. |
| permissions.destructive | "off" | "ask_first" | "on_its_own" | required | Cancelling or moving a booking, cancelling an order or changing its address. off: it does not do this, and a customer who asks goes to a person. ask_first: an owner or an admin approves each one under Approvals before it runs. on_its_own: it does it, after the customer’s own Confirm tap. |
| permissions.payments | "off" | "ask_first" | "on_its_own" | required | Sending a payment link. off: it does not do this, and a customer who asks goes to a person. ask_first: an owner or an admin approves each one under Approvals before it runs. on_its_own: it does it, after the customer’s own Confirm tap. |
| permissions.refunds | "off" | "ask_first" | "on_its_own" | required | A refund through a payment service or on an order. off: it does not do this, and a customer who asks goes to a person. ask_first: an owner or an admin approves each one under Approvals before it runs. on_its_own: it does it, after the customer’s own Confirm tap. ask_first until set. |
| location | object | null | required | The business location the assistant can send as a map pin, or null when none is set: then it answers with the address in words. |
| location.latitude | number | required | |
| location.longitude | number | required | |
| location.name | string | null | required | |
| location.address | string | null | required | |
| location.maps_link | string | null | required | |
| updated_at | string | null | required |
POST /v1/automations/{id}/receptionist/setup
Start this AI receptionist from a type of business: it fills the persona’s description, tone and prices, and replaces the procedures. Each stays editable
Scopes automations:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| setup | string | required | A type of business, by its key. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "receptionist_setup_applied" | required | |
| automation_id | string | required | |
| setup | object | required | |
| setup.object | "receptionist_setup" | required | |
| setup.key | string | required | What POST /v1/automations/{id}/receptionist/setup takes. |
| setup.name | string | required | |
| setup.description | string | required | |
| setup.what_you_do | string | required | The persona’s “what you do” it fills. |
| setup.tone | "friendly" | "neutral" | "formal" | required | |
| setup.may_quote_prices | boolean | required | |
| setup.services | object[] | required | Typical services and how long each takes, for the owner’s own list. |
| setup.services[].name | string | required | |
| setup.services[].minutes | integer | required | |
| setup.urgent_words | string[] | required | Words that pass a chat to a person at once: what the receptionist’s own “Words that pass a chat to you” start from. |
| setup.closed_message | string | required | What the receptionist’s own closed message starts from. |
| setup.capabilities | ("booking" | "crm" | "payments" | "orders" | "selling")[] | required | What a receptionist of this type may do once it is switched on and connected. A clinic books and nothing else. |
| setup.procedures | object[] | required | The procedures it fills. |
| setup.procedures[].number | integer | required | |
| setup.procedures[].when | object | required | |
| setup.procedures[].steps | object[] | required | |
| persona | object | required | |
| persona.object | "ai_persona" | required | |
| persona.business_name | string | required | |
| persona.what_you_do | string | required | |
| persona.tone | "friendly" | "neutral" | "formal" | required | |
| persona.may_quote_prices | boolean | required | |
| persona.links | object[] | required | |
| persona.links[].url | string | required | |
| persona.links[].when | string | required | |
| persona.never_say | string[] | required | |
| persona.confidence_threshold | number | required | |
| persona.updated_at | string | null | required | |
| procedures | object[] | required | |
| procedures[].number | integer | required | |
| procedures[].when | object | required | |
| procedures[].when.kind | "party_size_over" | required | |
| procedures[].when.people | integer | required | |
| procedures[].when.service | string | required | |
| procedures[].steps | object[] | required | |
| procedures[].steps[].kind | "ask" | required | |
| procedures[].steps[].question | string | required | |
| procedures[].steps[].amount | string | required | |
| procedures[].steps[].currency | string | required | |
| procedures[].steps[].ref | string | null | required | What the AI and a payment tool name this deposit by. Its amount is the one stored here, never a number the AI wrote. |
| switched_off | ("booking" | "crm" | "payments" | "orders" | "selling")[] | required | What the receptionist was doing that this type of business does not do, switched off now (a clinic books and does nothing else). Empty: nothing changed. |
POST /v1/automations/{id}/rollback
Make a saved version the live one, getting it ready to run first if it is not. Its steps do not change
Scopes automations:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| to_version | integer | required |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "automation" | required | |
| slug | string | required | |
| name | string | required | |
| description | string | null | required | |
| status | "draft" | "enabled" | "disabled" | "archived" | "auto_disabled" | required | |
| trigger_kind | string | required | |
| trigger_config | object | required | |
| connection_id | string | null | required | |
| active_version_id | string | null | required | |
| consecutive_failures | integer | required | |
| last_run_at | string (date-time) | null | required | |
| last_error | string | null | required | |
| auto_disabled_at | string (date-time) | null | required | |
| auto_disabled_reason | string | null | required | |
| refunds | "off" | "ask_first" | "on_its_own" | required | This automation’s own rule for its refund steps (a step whose action a person approves: WooCommerce’s Refund the order, or a payment service’s Refund a payment). ask_first: each refund waits for a person under Approvals (the automation waits for it first). on_its_own: it refunds with no person checking it. off: it does not refund, and saving a version with a refund step is refused. ask_first until set. An owner or an admin changes it. |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required | |
| can_run | boolean | required | |
| blocked_reason | string | null | required | |
| activation | object | required | Whether this automation can run, as far as WhatsApp templates go: every template it sends must be approved and not paused on the number it sends from (every number when it names none), in the language the step names, else in any language. A template WhatsApp paused holds the whole automation, as one waiting for approval does. |
| activation.state | "active" | "pending_template_approvals" | required | active: no template this automation sends waits for WhatsApp (or it sends none). pending_template_approvals: one or more is not approved, or is paused by WhatsApp; no step runs for any trigger and nothing is sent. Each trigger ends its run skipped (skip_reason template_pending), which is not a failure, until every one is approved and not paused, and then it runs by itself. Read with status, which says whether it is switched on. |
| activation.message | string | null | required | What it means and what the owner does next, in sentences for the owner. null when active. |
| activation.templates | object[] | required | Every template send that is not approved, not_approved ones first. Empty when active. |
| activation.templates[].name | string | required | The template's system name, as the automation sends it. |
| activation.templates[].language | string | null | required | The language the step names; null when it names none, and any sendable language would do. |
| activation.templates[].display_name | string | required | The name the owner gave it, as the Templates page shows it. |
| activation.templates[].approval | "waiting" | "not_approved" | "paused" | required | waiting: WhatsApp is reviewing it (pending, or in appeal). not_approved: WhatsApp has not approved it (rejected, or any status but pending, in appeal, approved or paused), or the number does not have it; the owner changes it on the Templates page and submits it again, or chooses another. paused: WhatsApp paused it (its quality); the automation runs again by itself once WhatsApp un-pauses it. |
| template_approval | object | null | required | The first entry of activation.templates, kept for older clients: a template not approved is named before a pending one. null when activation.state is active. |
| template_approval.code | "template_pending" | "template_rejected" | required | template_pending: WhatsApp is reviewing the message, or paused it. template_rejected: WhatsApp did not approve it. Either way no step of the automation runs until every template it sends is approved and not paused (see activation). |
| template_approval.template | string | required | The template's system name, as the automation sends it. |
| template_approval.message | string | required | What it means, in a sentence for the owner. |
| active_version | any | optional | |
| latest_version | any | optional | |
| settings | object | optional | |
| settings.version_id | string | required | |
| settings.version_no | integer | required | |
| settings.recipe_slug | string | null | required | The recipe the version was made from (the IR’s recipe_id); null for an automation written by hand. |
| settings.params | object | null | required | The value of each setting the version declares, as chosen. A new value is saved as a new version (POST /v1/automations/{id}/versions) whose document gives it: for a recipe-made automation, the document POST /v1/recipes/{slug}/instantiate makes from the new values, which writes them into its steps; for one written by hand, its own document, whose steps name its settings. Either way the values are checked there against the version’s own settings, the same way. null when the version gives none. |
| settings.inputs_schema | object | null | required | The settings the version declares, as a JSON Schema to draw the form from. For a recipe-made automation it is the same as its card in GET /v1/recipes. required names each one it cannot run without. null when it declares none. |
| settings.inputs_schema.order | string[] | optional | The order the settings are shown in: the name of every setting in properties, first to last, as declared. properties itself comes back in no particular order. Every recipe in the library, and every automation that declares settings, carries it. |
| settings.inputs_schema.properties | object | optional | |
| authoring_conversation_id | string | null | optional | On GET /v1/automations/{id}: the AI authoring conversation that holds this automation (GET /v1/ai/authoring/{id}), or null when none does. An automation has at most one. |
| conflicts | object[] | optional | On POST /v1/automations/{id}/enable and GET /v1/automations/{id}: every other switched-on automation on its number that starts on the same thing: the same trigger, and the same tag, account, form, sheet, schedule or web address where it has one (one left out is every one); on incoming messages, every other one; on a schedule, also every other one whose steps use the same Google sheet, at whatever time it runs. Empty while this one is off. Only automations the caller can read are named. Nothing is refused or switched off: the owner decides. |
| conflicts[].automation_id | string | required | |
| conflicts[].name | string | required | |
| conflicts[].shares | string | required | What both start on, in words for the owner: "both answer incoming messages", "both start when a contact gets a tag (tag VIP)". |
| conflicts[].answers_first | boolean | null | required | On incoming messages, when both reply: whether this automation answers a customer’s message before that one, by the order the number offers a message in (the one the live order uses): a customer one of them is waiting on, then a keyword or an ad its start names (trigger.answers.starts_when), then one that answers every message; set up first among equals. One whose start claims no message (a keyword checked only inside its flow) comes after one that does. null when one of the two does not reply, or neither claims a message, so both run; and on every other trigger. |
| sheets | object[] | optional | On GET /v1/automations/{id}: each Google Sheet its steps add to, update or find rows in, once each, in step order. Read from the switched-on version, or the newest when none is switched on. Empty when no step uses one. |
| sheets[].spreadsheet_id | string | required | Google’s id for the spreadsheet. |
| sheets[].title | string | null | required | The name Google gave it when Cosend made it. null for a spreadsheet the owner picked, which Cosend did not make. |
| sheets[].tab | string | null | required | The tab its steps’ ranges name before a ! (the first one named). null when none names one: they use the spreadsheet’s first tab. |
| sheets[].url | string | null | required | Google’s link to open it, as Google gave it when Cosend made it. null for a spreadsheet the owner picked. |
| warnings | object[] | optional | Present only on the answer to the call that switched it on, when something about it needs saying. The automation is on: it is a note, never an error. |
| warnings[].code | "catch_all_shadowed" | required | catch_all_shadowed: two automations on this number answer every message. The one set up first answers; the other answers only taps on buttons it sent and customers it is waiting on, while the first is on. |
| warnings[].message | string | required | What it means, in sentences for the owner. |
GET /v1/automations/{id}/stats
How one automation did today or over seven days: chats answered alone, handed over, and why
Scopes automations:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| range | query | "today" | "7d" | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| range | "today" | "7d" | required | |
| answered_alone | integer | required | |
| handed_over | integer | required | |
| days | object[] | required | |
| days[].date | string (date) | required | |
| days[].answered_alone | integer | required | |
| days[].handed_over | integer | required | |
| top_handover_reasons | object[] | required | |
| top_handover_reasons[].code | string | required | |
| top_handover_reasons[].words | string | null | required | Why the chats were handed over, in words, as Reports words it. Null: no words for this code. |
| top_handover_reasons[].n | integer | required |
POST /v1/automations/{id}/test
Run the newest version once on a sample customer, sending to no one; each step is recorded as what it would have done
Scopes runs:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | required |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| payload | object | optional | Optional. Trigger subtrees (message, order, …) laid over the sample's, field by field. |
| fail_step | string | optional | Optional. The id of a step: the test runs the error branch as if that step had failed, and shows what the branch would do. Refused when the automation has no error branch or no such step. |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "run" | required | |
| automation_id | string | required | |
| automation_name | string | required | The name its owner knows the automation by: for one installed with another, that one’s name, and a deleted automation keeps its own. So a run is named even when its automation is not in the automations list. |
| connection_id | string | null | required | |
| version_no | integer | required | |
| status | "queued" | "running" | "waiting" | "success" | "failure" | "cancelled" | "timeout" | "skipped" | … | required | |
| skip_reason | "quota_exceeded" | "ai_capped" | "bot_disabled" | "outside_service_window" | "opted_out" | "connection_not_active" | "concurrency_limit" | "duplicate" | … | null | required | |
| trigger | object | required | |
| trigger.kind | string | required | |
| trigger.message_id | string | null | required | |
| started_at | string (date-time) | null | required | |
| finished_at | string (date-time) | null | required | |
| duration_ms | integer | null | required | |
| steps_failed | integer | required | |
| usage | object | required | |
| usage.run_units | integer | required | |
| usage.ai_conversation_id | string | null | required | |
| usage.external_sends | integer | required | |
| sent_messages | object[] | required | The WhatsApp messages this run sent, in the order sent: the first ten, each with whether WhatsApp accepted it (delivery). Empty for a test run, which sends nothing. |
| sent_messages[].message_id | string | required | |
| sent_messages[].type | "template" | "text" | "interactive" | "image" | "document" | "audio" | "video" | "sticker" | required | What was sent. A template names its template in template; every other kind is a message written in the automation, and its template is null. |
| sent_messages[].template | object | null | required | |
| sent_messages[].template.id | string | required | |
| sent_messages[].template.display_name | string | required | The name the owner gave the template, as the Templates page shows it. |
| sent_messages[].to | object | required | |
| sent_messages[].to.contact_id | string | required | |
| sent_messages[].to.name | string | null | required | The customer's name as the Inbox shows it; null when they have none. |
| sent_messages[].to.phone | string | null | required | Their number in E.164; null when they are known only by their WhatsApp id. |
| sent_messages[].delivery | object | required | |
| sent_messages[].delivery.state | "sending" | "sent" | "not_sent" | required | sent once WhatsApp accepted the message; sending while it is still on its way; not_sent when it was stopped: the customer opted out, the owner answered from the WhatsApp Business app, or WhatsApp refused it. |
| sent_messages[].delivery.reason | string | null | required | Why it was not sent, in plain words. Null unless state is not_sent. |
| sent_messages[].delivery.detail | string | null | required | WhatsApp’s or Cosend’s own text for a message that was not sent, for developers. Null otherwise. |
| result | any | null | required | |
| error | any | null | required | |
| failed_step | object | null | required | |
| failed_step.step_id | string | null | required | |
| failed_step.step_action | string | null | required | |
| failed_step.error | object | null | required | |
| failed_step.error.code | string | required | |
| failed_step.error.message | string | required | What went wrong, in plain words. |
| failed_step.error.detail | string | null | required | The technical text, in full, for Details. Null when the message is all there is, and for an error on our side. |
| failure | object | null | required | |
| failure.reason | string | required | Why the run failed, in plain words. |
| failure.detail | string | null | required | The technical text the reason was said in place of, in full, for Details. Null when the reason is all there is. |
| failure.step_id | string | null | required | The step it stopped at; null when no step failed. |
| failure.step_action | string | null | required | |
| failure.before_first_step | boolean | required | True when the run stopped before it recorded any step. |
| executor_error | object | null | required | The automation engine’s own account of why it failed or cancelled this run: the step, its error and the end of its log. name and message are null when the engine gave no reason. Null for a run the engine did not report failed or cancelled. |
| executor_error.job_id | string | required | The automation engine's job the error was read from: the failed step's, or the run's own. |
| executor_error.step_id | string | null | required | The flow step the automation engine marked failed; null when none did. |
| executor_error.step_action | string | null | required | That step’s catalogue action, when it maps to one. |
| executor_error.name | string | null | required | The automation engine’s error name. |
| executor_error.message | string | null | required | The automation engine’s error message, at most 1000 characters, with secrets removed. |
| executor_error.log_tail | string | null | required | The last lines of that step’s log, at most 20 lines and 2000 characters, with secrets removed. Null when the automation engine gave none. |
| test | object | null | required | |
| test.customer | object | null | required | |
| test.customer.name | string | required | |
| test.customer.phone | string | required | |
| test.trigger_type | string | null | required | |
| test.payload | object | required | |
| test.error_branch_preview | object | null | required | V4-H2: set when this Test made a step fail on purpose (fail_step) and its error branch ran to its end. The run then shows what the error branch would do: nothing failed, and its failure names the step made to fail. Null for every other Test, and for one whose error branch itself failed. |
| test.error_branch_preview.step_id | string | required | The step the Test made fail on purpose. |
| test.error_branch_preview.says | string | required | What the preview is, in plain words. |
POST /v1/automations/{id}/validate
Validate and report every finding, without deploying
Scopes automations:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| ir | object | required |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| valid | boolean | required | |
| compiler_version | string | required | |
| catalogue_version | string | required | |
| errors | object[] | required | |
| errors[].pointer | string | required | |
| errors[].code | string | required | |
| errors[].message | string | required | |
| errors[].fix | object | optional | |
| errors[].fix.action | string | required | |
| errors[].fix.url | string | optional | |
| errors[].detail | string | optional | When message is in plain words for the owner, the technical text it was said in place of, for Details. |
| warnings | object[] | required | |
| warnings[].pointer | string | required | |
| warnings[].code | string | required | |
| warnings[].message | string | required | |
| warnings[].fix | object | optional | |
| warnings[].fix.action | string | required | |
| warnings[].fix.url | string | optional | |
| warnings[].detail | string | optional | When message is in plain words for the owner, the technical text it was said in place of, for Details. |
| derived | object | optional | |
| derived.acts | string[] | required | |
| derived.budget | object | required | |
| derived.budget.actions | integer | required | |
| derived.budget.ai_calls | integer | required | |
| derived.budget.external_sends | integer | required | |
| derived.segment_count | integer | required |
GET /v1/automations/{id}/versions
Every version of an automation, newest first. Append-only
Scopes automations:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| limit | query | integer | optional | |
| after | query | string | optional | |
| before | query | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].object | "automation_version" | required | |
| data[].automation_id | string | required | |
| data[].version_no | integer | required | |
| data[].status | "draft" | "validated" | "deployed" | "superseded" | "rolled_back" | "failed" | required | |
| data[].ir_hash | string | required | |
| data[].ir | object | optional | |
| data[].compiled_hash | string | null | required | |
| data[].catalogue_version | string | required | |
| data[].compiler_version | string | required | |
| data[].derived_acts | string[] | required | |
| data[].derived_budget | object | required | |
| data[].actions | string[] | required | Every action this version’s steps take, with those of a second automation set up with it, each once: the list /deploy, /enable and POST /v1/runs take as actions. An integration call is integration.call:<integration>.<action>, or integration.call when the step works out which while it runs. |
| data[].segment_count | integer | required | |
| data[].quiet_hours | object | null | required | |
| data[].quiet_hours.start | string | required | |
| data[].quiet_hours.end | string | required | |
| data[].quiet_hours.policy | "shift_to_end" | "shift_to_start" | "skip" | "ignore" | "defer_unless_urgent" | required | |
| data[].authored_by | "user" | "ai" | "recipe" | "system" | "import" | required | |
| data[].change_note | string | null | required | |
| data[].created_at | string (date-time) | required | |
| data[].deployed_at | string (date-time) | null | required | |
| data[].warnings | object[] | optional | Present only on the answer to the call that switched it on, when something about it needs saying. The automation is on: it is a note, never an error. |
| data[].warnings[].code | "catch_all_shadowed" | required | catch_all_shadowed: two automations on this number answer every message. The one set up first answers; the other answers only taps on buttons it sent and customers it is waiting on, while the first is on. |
| data[].warnings[].message | string | required | What it means, in sentences for the owner. |
| has_more | boolean | required | |
| next_cursor | string | null | required |
POST /v1/automations/{id}/versions
A new version from an IR document. Validated; new settings for a switched-on automation are also built and switched on
Scopes automations:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | optional |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| ir | object | required | |
| change_note | string | null | optional |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "automation_version" | required | |
| automation_id | string | required | |
| version_no | integer | required | |
| status | "draft" | "validated" | "deployed" | "superseded" | "rolled_back" | "failed" | required | |
| ir_hash | string | required | |
| ir | object | optional | |
| compiled_hash | string | null | required | |
| catalogue_version | string | required | |
| compiler_version | string | required | |
| derived_acts | string[] | required | |
| derived_budget | object | required | |
| actions | string[] | required | Every action this version’s steps take, with those of a second automation set up with it, each once: the list /deploy, /enable and POST /v1/runs take as actions. An integration call is integration.call:<integration>.<action>, or integration.call when the step works out which while it runs. |
| segment_count | integer | required | |
| quiet_hours | object | null | required | |
| quiet_hours.start | string | required | |
| quiet_hours.end | string | required | |
| quiet_hours.policy | "shift_to_end" | "shift_to_start" | "skip" | "ignore" | "defer_unless_urgent" | required | |
| authored_by | "user" | "ai" | "recipe" | "system" | "import" | required | |
| change_note | string | null | required | |
| created_at | string (date-time) | required | |
| deployed_at | string (date-time) | null | required | |
| warnings | object[] | optional | Present only on the answer to the call that switched it on, when something about it needs saying. The automation is on: it is a note, never an error. |
| warnings[].code | "catch_all_shadowed" | required | catch_all_shadowed: two automations on this number answer every message. The one set up first answers; the other answers only taps on buttons it sent and customers it is waiting on, while the first is on. |
| warnings[].message | string | required | What it means, in sentences for the owner. |
/v1/billing
POST /v1/billing/card-setup
On the Free plan, open a Stripe page that saves a card and requires the billing address
Scopes billing:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| return_url | string (uri) | required |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| url | string (uri) | required |
Errors invalid_request
POST /v1/billing/checkout
Start a Stripe Checkout session for a plan change
Scopes billing:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| plan_code | string | required | |
| interval | "month" | "year" | optional | |
| return_url | string (uri) | required |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| url | string (uri) | required |
POST /v1/billing/checkout/embedded
Start a Stripe Checkout session that renders inside the Cosend dashboard
Scopes billing:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| plan_code | string | required | |
| interval | "month" | "year" | optional | |
| return_url | string (uri) | required |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| client_secret | string | required |
POST /v1/billing/credits/checkout
Buy a pack of AI building credit on a Stripe Checkout page
Scopes billing:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| pack_id | string | required | |
| return_url | string (uri) | required |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| url | string (uri) | required |
POST /v1/billing/downgrade-consent
Record a customer’s typed approval of the data loss a downgrade causes
Scopes any credential
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| to_plan_code | string | required | |
| typed_approval | string | required | |
| typed_name | string | required |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| from_plan_code | string | required | |
| to_plan_code | string | required | |
| typed_approval | string | required | |
| typed_name | string | required | |
| actor_user_id | string | null | required | |
| actor_label | string | required | |
| created_at | string | required |
GET /v1/billing/invoices
The workspace’s invoices: when, how much, paid, and Stripe’s own document
Scopes billing:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].number | string | null | required | |
| data[].created_at | string (date-time) | required | |
| data[].status | string | required | |
| data[].paid | boolean | required | |
| data[].amount_due_minor | integer | required | |
| data[].amount_paid_minor | integer | required | |
| data[].currency | string | required | |
| data[].hosted_invoice_url | string (uri) | null | required | |
| data[].invoice_pdf | string (uri) | null | required | |
| next_invoice | object | null | required | |
| next_invoice.amount_due_minor | integer | required | |
| next_invoice.currency | string | required | |
| next_invoice.charged_at | string (date-time) | null | required |
POST /v1/billing/invoices/{id}/pay
Pay one of the workspace’s open invoices now, on the card on file
Scopes billing:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| invoice_id | string | required | |
| status | "paid" | required | |
| subscription_status | "trialing" | "active" | "past_due" | "unpaid" | "canceled" | "incomplete" | required | |
| message | string | required |
Errors invalid_request payment_declined upstream_unavailable
GET /v1/billing/invoices/{invoiceId}
One of the workspace’s own invoices, by Stripe id
Scopes billing:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| number | string | null | required | |
| created_at | string (date-time) | required | |
| status | string | required | |
| paid | boolean | required | |
| amount_due_minor | integer | required | |
| amount_paid_minor | integer | required | |
| currency | string | required | |
| hosted_invoice_url | string (uri) | null | required | |
| invoice_pdf | string (uri) | null | required |
POST /v1/billing/plan-change
Change the plan on the live subscription in place, on the card on file
Scopes billing:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| plan_code | string | required | |
| interval | "month" | "year" | optional | |
| proration_date | string (date-time) | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| plan_code | string | required | |
| plan | object | required | |
| plan.code | string | required | |
| plan.name | string | required | |
| plan.rank | integer | required | |
| interval | "month" | "year" | required | |
| plan_change_mode | "checkout" | "in_place" | required | |
| downgrade_consent_word | string | required | |
| status | "trialing" | "active" | "past_due" | "unpaid" | "canceled" | "incomplete" | required | |
| overdue | boolean | required | |
| overdue_since | string (date-time) | null | required | |
| current_period_end | string (date-time) | required | |
| cancel_at_period_end | boolean | required | |
| cancel_to_plan | "free" | null | required | |
| scheduled_change | object | null | required | |
| scheduled_change.plan_code | string | required | |
| scheduled_change.interval | "month" | "year" | required | |
| scheduled_change.effective_at | string (date-time) | required | |
| scheduled_change.limits_lowered | object[] | required | |
| scheduled_change.limits_lowered[].limit | "history_months" | "team_members" | "connections" | "messages" | "ai_conversations" | "automation_runs" | required | |
| scheduled_change.limits_lowered[].from | integer | null | required | |
| scheduled_change.limits_lowered[].to | integer | null | required | |
| scheduled_change.limits_lowered[].to_basis | "period" | "lifetime" | "concurrent" | null | required | |
| scheduled_change.members_losing_access | integer | null | required | |
| scheduled_change.reminder_due | boolean | required | |
| scheduled_change.created_at | string (date-time) | null | required | |
| canceled_at | string (date-time) | null | required | |
| trial_ends_at | string (date-time) | null | required | |
| effective_plan_code | string | required | |
| trial | object | null | required | |
| trial.state | "eligible" | "not_eligible" | "active" | required | |
| trial.not_eligible_reason | "used" | "paid_before" | "number_used" | "business_used" | null | required | Why no trial can start: used (this workspace had its trial), paid_before (it has been on a paid plan), number_used or business_used (one of its numbers, or its Meta business, already had a trial). Null unless state is not_eligible. |
| trial.started_at | string (date-time) | null | required | |
| trial.ends_at | string (date-time) | null | required | |
| trial.ended_at | string (date-time) | null | required | |
| trial.started_by_connection_id | string | null | required | |
| trial.offer | object | required | |
| trial.offer.keep | object | required | |
| trial.offer.alternative | object | null | required | |
| trial.offer.fallback | object | required | |
| trial.choice | object | null | required | |
| trial.choice.plan_code | string | required | |
| trial.choice.interval | "month" | "year" | null | required | |
| trial.choice.made_at | string (date-time) | required | |
| trial.days_left | integer | null | required | |
| trial.reminder_due | boolean | required | |
| seats_used | integer | required | |
| seats_included | integer | null | required | |
| seats_hard_cap | integer | null | required | |
| billing_information | "unknown" | "present" | "absent" | required | |
| billing_information_updated_at | string (date-time) | null | required | |
| extras_billed | boolean | required | True when use past the plan’s limits is billed. False when it stops at them: on the Free plan, card or no card (a Free workspace that already had a card when this rule began keeps billed extras until extras_billed_until and is true up to that date), on the trial, and on a plan held to the Free plan’s limits after a failed payment. |
| extras_billed_until | string (date-time) | null | required | For a Free workspace that already had a card when this rule began: when its billed extras end and it stops at the Free plan’s limits like every Free workspace. Null for every other workspace. |
| usage_billing_problem | string | null | required |
POST /v1/billing/plan-change/preview
Preview a plan change on the live subscription: the next invoice, and whether a consent is needed
Scopes billing:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| plan_code | string | required | |
| interval | "month" | "year" | optional | |
| proration_date | string (date-time) | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| plan_code | string | required | |
| interval | "month" | "year" | required | |
| current_plan_code | string | required | |
| current_interval | "month" | "year" | required | |
| direction | "upgrade" | "downgrade" | "interval_only" | "same_plan" | required | |
| downgrade_consent | "not_required" | "required" | "recorded" | required | |
| next_invoice | object | required | |
| next_invoice.amount_due_minor | integer | required | |
| next_invoice.currency | string | required | |
| next_invoice.charged_at | string (date-time) | null | required | |
| new_plan | object | required | |
| new_plan.code | string | required | |
| new_plan.interval | "month" | "year" | required | |
| new_plan.price_minor | integer | required | |
| credit_minor | integer | required | |
| charged_today_minor | integer | required | |
| earlier_changes_minor | integer | required | |
| recurring_minor | integer | required | |
| renewal_date | string (date-time) | required | |
| proration_date | string (date-time) | required | |
| lines | object[] | required | |
| lines[].description | string | null | required | |
| lines[].amount_minor | integer | required | |
| lines[].proration | boolean | required | |
| retention_lowered_to_months | integer | null | required | |
| scheduled_end_removed | boolean | required | |
| effective_at | string (date-time) | null | required | |
| scheduled_change_removed | boolean | required | |
| to_free | object | optional | |
| to_free.starts_at | string (date-time) | required | |
| to_free.members_losing_access | integer | required | |
| to_free.ai_conversations_used | integer | required | |
| to_free.cosend_numbers_released | string[] | required |
GET /v1/billing/plans
The plans this account may move to, in ladder order: prices, allowances, seats and features
Scopes billing:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].code | string | required | |
| data[].name | string | required | |
| data[].rank | integer | required | |
| data[].prices | object | required | |
| data[].prices.monthly_minor | integer | required | |
| data[].prices.annual_minor | integer | required | |
| data[].prices.currency | string | required | |
| data[].included | object | required | |
| data[].basis | object | required | |
| data[].overage | object | required | |
| data[].usage_prices_kept_until | string (date-time) | null | required | On the plan this workspace is on, while its current billing period is on its earlier overage prices: when its first billing period on the plan’s prices starts. Null otherwise. |
| data[].hard_caps | object | required | |
| data[].seat_policy | object | required | |
| data[].seat_policy.included | integer | null | required | |
| data[].seat_policy.next_seat_price_minor | string | null | required | |
| data[].features | string[] | required |
POST /v1/billing/portal
Open the Stripe Customer Portal: cards and invoices, without cancellation or plan switching
Scopes billing:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| return_url | string (uri) | required |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| url | string (uri) | required |
GET /v1/billing/subscription
The current plan, status, period and overdue state
Scopes billing:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| plan_code | string | required | |
| plan | object | required | |
| plan.code | string | required | |
| plan.name | string | required | |
| plan.rank | integer | required | |
| interval | "month" | "year" | required | |
| plan_change_mode | "checkout" | "in_place" | required | |
| downgrade_consent_word | string | required | |
| status | "trialing" | "active" | "past_due" | "unpaid" | "canceled" | "incomplete" | required | |
| overdue | boolean | required | |
| overdue_since | string (date-time) | null | required | |
| current_period_end | string (date-time) | required | |
| cancel_at_period_end | boolean | required | |
| cancel_to_plan | "free" | null | required | |
| scheduled_change | object | null | required | |
| scheduled_change.plan_code | string | required | |
| scheduled_change.interval | "month" | "year" | required | |
| scheduled_change.effective_at | string (date-time) | required | |
| scheduled_change.limits_lowered | object[] | required | |
| scheduled_change.limits_lowered[].limit | "history_months" | "team_members" | "connections" | "messages" | "ai_conversations" | "automation_runs" | required | |
| scheduled_change.limits_lowered[].from | integer | null | required | |
| scheduled_change.limits_lowered[].to | integer | null | required | |
| scheduled_change.limits_lowered[].to_basis | "period" | "lifetime" | "concurrent" | null | required | |
| scheduled_change.members_losing_access | integer | null | required | |
| scheduled_change.reminder_due | boolean | required | |
| scheduled_change.created_at | string (date-time) | null | required | |
| canceled_at | string (date-time) | null | required | |
| trial_ends_at | string (date-time) | null | required | |
| effective_plan_code | string | required | |
| trial | object | null | required | |
| trial.state | "eligible" | "not_eligible" | "active" | required | |
| trial.not_eligible_reason | "used" | "paid_before" | "number_used" | "business_used" | null | required | Why no trial can start: used (this workspace had its trial), paid_before (it has been on a paid plan), number_used or business_used (one of its numbers, or its Meta business, already had a trial). Null unless state is not_eligible. |
| trial.started_at | string (date-time) | null | required | |
| trial.ends_at | string (date-time) | null | required | |
| trial.ended_at | string (date-time) | null | required | |
| trial.started_by_connection_id | string | null | required | |
| trial.offer | object | required | |
| trial.offer.keep | object | required | |
| trial.offer.alternative | object | null | required | |
| trial.offer.fallback | object | required | |
| trial.choice | object | null | required | |
| trial.choice.plan_code | string | required | |
| trial.choice.interval | "month" | "year" | null | required | |
| trial.choice.made_at | string (date-time) | required | |
| trial.days_left | integer | null | required | |
| trial.reminder_due | boolean | required | |
| seats_used | integer | required | |
| seats_included | integer | null | required | |
| seats_hard_cap | integer | null | required | |
| billing_information | "unknown" | "present" | "absent" | required | |
| billing_information_updated_at | string (date-time) | null | required | |
| extras_billed | boolean | required | True when use past the plan’s limits is billed. False when it stops at them: on the Free plan, card or no card (a Free workspace that already had a card when this rule began keeps billed extras until extras_billed_until and is true up to that date), on the trial, and on a plan held to the Free plan’s limits after a failed payment. |
| extras_billed_until | string (date-time) | null | required | For a Free workspace that already had a card when this rule began: when its billed extras end and it stops at the Free plan’s limits like every Free workspace. Null for every other workspace. |
| usage_billing_problem | string | null | required |
POST /v1/billing/trial
Start this workspace’s free 14-day trial of the Growth plan
Scopes billing:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| plan_code | string | required | |
| plan | object | required | |
| plan.code | string | required | |
| plan.name | string | required | |
| plan.rank | integer | required | |
| interval | "month" | "year" | required | |
| plan_change_mode | "checkout" | "in_place" | required | |
| downgrade_consent_word | string | required | |
| status | "trialing" | "active" | "past_due" | "unpaid" | "canceled" | "incomplete" | required | |
| overdue | boolean | required | |
| overdue_since | string (date-time) | null | required | |
| current_period_end | string (date-time) | required | |
| cancel_at_period_end | boolean | required | |
| cancel_to_plan | "free" | null | required | |
| scheduled_change | object | null | required | |
| scheduled_change.plan_code | string | required | |
| scheduled_change.interval | "month" | "year" | required | |
| scheduled_change.effective_at | string (date-time) | required | |
| scheduled_change.limits_lowered | object[] | required | |
| scheduled_change.limits_lowered[].limit | "history_months" | "team_members" | "connections" | "messages" | "ai_conversations" | "automation_runs" | required | |
| scheduled_change.limits_lowered[].from | integer | null | required | |
| scheduled_change.limits_lowered[].to | integer | null | required | |
| scheduled_change.limits_lowered[].to_basis | "period" | "lifetime" | "concurrent" | null | required | |
| scheduled_change.members_losing_access | integer | null | required | |
| scheduled_change.reminder_due | boolean | required | |
| scheduled_change.created_at | string (date-time) | null | required | |
| canceled_at | string (date-time) | null | required | |
| trial_ends_at | string (date-time) | null | required | |
| effective_plan_code | string | required | |
| trial | object | null | required | |
| trial.state | "eligible" | "not_eligible" | "active" | required | |
| trial.not_eligible_reason | "used" | "paid_before" | "number_used" | "business_used" | null | required | Why no trial can start: used (this workspace had its trial), paid_before (it has been on a paid plan), number_used or business_used (one of its numbers, or its Meta business, already had a trial). Null unless state is not_eligible. |
| trial.started_at | string (date-time) | null | required | |
| trial.ends_at | string (date-time) | null | required | |
| trial.ended_at | string (date-time) | null | required | |
| trial.started_by_connection_id | string | null | required | |
| trial.offer | object | required | |
| trial.offer.keep | object | required | |
| trial.offer.alternative | object | null | required | |
| trial.offer.fallback | object | required | |
| trial.choice | object | null | required | |
| trial.choice.plan_code | string | required | |
| trial.choice.interval | "month" | "year" | null | required | |
| trial.choice.made_at | string (date-time) | required | |
| trial.days_left | integer | null | required | |
| trial.reminder_due | boolean | required | |
| seats_used | integer | required | |
| seats_included | integer | null | required | |
| seats_hard_cap | integer | null | required | |
| billing_information | "unknown" | "present" | "absent" | required | |
| billing_information_updated_at | string (date-time) | null | required | |
| extras_billed | boolean | required | True when use past the plan’s limits is billed. False when it stops at them: on the Free plan, card or no card (a Free workspace that already had a card when this rule began keeps billed extras until extras_billed_until and is true up to that date), on the trial, and on a plan held to the Free plan’s limits after a failed payment. |
| extras_billed_until | string (date-time) | null | required | For a Free workspace that already had a card when this rule began: when its billed extras end and it stops at the Free plan’s limits like every Free workspace. Null for every other workspace. |
| usage_billing_problem | string | null | required |
Errors trial_not_available
POST /v1/billing/trial/choice
Choose the plan this workspace moves to when its free trial ends
Scopes billing:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| plan_code | string | required | |
| interval | "month" | "year" | optional | |
| return_url | string (uri) | required |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| checkout_url | string | null | required | |
| subscription | object | required | |
| subscription.id | string | required | |
| subscription.plan_code | string | required | |
| subscription.plan | object | required | |
| subscription.plan.code | string | required | |
| subscription.plan.name | string | required | |
| subscription.plan.rank | integer | required | |
| subscription.interval | "month" | "year" | required | |
| subscription.plan_change_mode | "checkout" | "in_place" | required | |
| subscription.downgrade_consent_word | string | required | |
| subscription.status | "trialing" | "active" | "past_due" | "unpaid" | "canceled" | "incomplete" | required | |
| subscription.overdue | boolean | required | |
| subscription.overdue_since | string (date-time) | null | required | |
| subscription.current_period_end | string (date-time) | required | |
| subscription.cancel_at_period_end | boolean | required | |
| subscription.cancel_to_plan | "free" | null | required | |
| subscription.scheduled_change | object | null | required | |
| subscription.scheduled_change.plan_code | string | required | |
| subscription.scheduled_change.interval | "month" | "year" | required | |
| subscription.scheduled_change.effective_at | string (date-time) | required | |
| subscription.scheduled_change.limits_lowered | object[] | required | |
| subscription.scheduled_change.members_losing_access | integer | null | required | |
| subscription.scheduled_change.reminder_due | boolean | required | |
| subscription.scheduled_change.created_at | string (date-time) | null | required | |
| subscription.canceled_at | string (date-time) | null | required | |
| subscription.trial_ends_at | string (date-time) | null | required | |
| subscription.effective_plan_code | string | required | |
| subscription.trial | object | null | required | |
| subscription.trial.state | "eligible" | "not_eligible" | "active" | required | |
| subscription.trial.not_eligible_reason | "used" | "paid_before" | "number_used" | "business_used" | null | required | Why no trial can start: used (this workspace had its trial), paid_before (it has been on a paid plan), number_used or business_used (one of its numbers, or its Meta business, already had a trial). Null unless state is not_eligible. |
| subscription.trial.started_at | string (date-time) | null | required | |
| subscription.trial.ends_at | string (date-time) | null | required | |
| subscription.trial.ended_at | string (date-time) | null | required | |
| subscription.trial.started_by_connection_id | string | null | required | |
| subscription.trial.offer | object | required | |
| subscription.trial.choice | object | null | required | |
| subscription.trial.days_left | integer | null | required | |
| subscription.trial.reminder_due | boolean | required | |
| subscription.seats_used | integer | required | |
| subscription.seats_included | integer | null | required | |
| subscription.seats_hard_cap | integer | null | required | |
| subscription.billing_information | "unknown" | "present" | "absent" | required | |
| subscription.billing_information_updated_at | string (date-time) | null | required | |
| subscription.extras_billed | boolean | required | True when use past the plan’s limits is billed. False when it stops at them: on the Free plan, card or no card (a Free workspace that already had a card when this rule began keeps billed extras until extras_billed_until and is true up to that date), on the trial, and on a plan held to the Free plan’s limits after a failed payment. |
| subscription.extras_billed_until | string (date-time) | null | required | For a Free workspace that already had a card when this rule began: when its billed extras end and it stops at the Free plan’s limits like every Free workspace. Null for every other workspace. |
| subscription.usage_billing_problem | string | null | required |
Errors trial_not_available
/v1/campaigns
GET /v1/campaigns
List campaigns, newest first, with what each sent, delivered, read and got replies
Scopes campaigns:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| limit | query | integer | optional | |
| after | query | string | optional | |
| before | query | string | optional | |
| connection_id | query | string | string[] | optional | |
| status | query | string | string[] | optional | |
| q | query | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].object | "campaign" | required | |
| data[].name | string | required | |
| data[].connection_id | string | null | required | |
| data[].status | "draft" | "scheduled" | "sending" | "paused" | "sent" | "stopped" | "failed" | required | |
| data[].template | object | null | required | |
| data[].template.id | string | null | required | |
| data[].template.name | string | required | |
| data[].template.language | string | required | |
| data[].variable_map | object[] | required | |
| data[].variable_map[].var | string | required | |
| data[].variable_map[].source | string | null | required | |
| data[].variable_map[].fallback | string | null | required | |
| data[].cards | object[] | required | |
| data[].cards[].media_id | string | required | |
| data[].header | object | null | required | |
| data[].header.type | "image" | "video" | "document" | required | |
| data[].header.media_id | string | required | |
| data[].header.from_template | boolean | required | |
| data[].header.latitude | number | required | |
| data[].header.longitude | number | required | |
| data[].header.name | string | required | |
| data[].header.address | string | required | |
| data[].header.variable_map | object[] | required | |
| data[].buttons | object[] | required | |
| data[].buttons[].index | integer | required | |
| data[].buttons[].type | "url" | required | |
| data[].buttons[].variable_map | object[] | required | |
| data[].buttons[].code | string | required | |
| data[].audience | object | required | |
| data[].audience.tags | string[] | required | |
| data[].audience.labels | string[] | required | |
| data[].audience.fields | object[] | required | |
| data[].audience.match | "any" | "all" | required | |
| data[].audience.everyone | boolean | required | |
| data[].audience.smart | "engaged" | "win_back" | "at_risk" | null | required | |
| data[].audience.segment_id | string | null | required | |
| data[].audience.from_campaign | object | null | required | |
| data[].schedule | object | null | required | |
| data[].schedule.local_time | string | required | |
| data[].schedule.tz | string | required | |
| data[].schedule.starts_at_utc | string (date-time) | null | required | |
| data[].quiet_hours | object | required | |
| data[].quiet_hours.on | boolean | required | |
| data[].quiet_hours.from | string | required | |
| data[].quiet_hours.to | string | required | |
| data[].kind | "one" | "sequence" | "ab" | required | |
| data[].steps | object[] | required | |
| data[].steps[].template | object | null | required | |
| data[].steps[].variable_map | object[] | required | |
| data[].steps[].cards | object[] | required | |
| data[].steps[].header | object | null | required | |
| data[].steps[].buttons | object[] | required | |
| data[].steps[].wait_days | integer | required | |
| data[].steps[].to | "no_reply" | "no_read" | "no_click" | required | |
| data[].ab | object | null | required | |
| data[].ab.template | object | null | required | |
| data[].ab.variable_map | object[] | required | |
| data[].ab.cards | object[] | required | |
| data[].ab.header | object | null | required | |
| data[].ab.buttons | object[] | required | |
| data[].ab.test_percent | integer | required | |
| data[].ab.metric | "replies" | "reads" | "clicks" | required | |
| data[].ab.test_hours | integer | required | |
| data[].ab.auto_send | boolean | required | |
| data[].winner | object | null | required | |
| data[].winner.variant | "a" | "b" | required | |
| data[].winner.by | "replies" | "reads" | "clicks" | required | |
| data[].winner.chance | number | required | |
| data[].winner.close | boolean | required | |
| data[].winner.auto | boolean | required | |
| data[].winner.at | string (date-time) | required | |
| data[].reply_rules | object[] | required | |
| data[].reply_rules[].when | object | required | |
| data[].reply_rules[].actions | object[] | required | |
| data[].let_join | boolean | required | |
| data[].n_recipients | integer | required | |
| data[].n_sent | integer | required | |
| data[].n_delivered | integer | required | |
| data[].n_read | integer | required | |
| data[].n_replied | integer | required | |
| data[].n_failed | integer | required | |
| data[].n_clicked | integer | null | required | People who tapped a tracked link at least once, each counted once. null when the campaign counts no clicks. |
| data[].track_clicks | boolean | required | |
| data[].auto_retry | boolean | required | |
| data[].max_per_hour | integer | null | required | |
| data[].pause_reason | string | null | required | |
| data[].end_reason | object | null | required | |
| data[].end_reason.code | string | required | |
| data[].end_reason.words | string | required | |
| data[].end_reason.meta_message | string | null | required | |
| data[].created_by | string | null | required | |
| data[].stopped_by | string | null | required | |
| data[].retarget_of | string | null | required | |
| data[].started_at | string (date-time) | null | required | |
| data[].finished_at | string (date-time) | null | required | |
| data[].stopped_at | string (date-time) | null | required | |
| data[].created_at | string (date-time) | required | |
| data[].updated_at | string (date-time) | required | |
| has_more | boolean | required | |
| next_cursor | string | null | required | |
| status_counts | object | required |
POST /v1/campaigns
Start a campaign as a draft, so each step saves
Scopes campaigns:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | optional | |
| connection_id | string | null | optional | |
| auto_retry | boolean | optional | Retries failed sends by itself: a person not on WhatsApp is not retried, a message WhatsApp held back is retried once, 24 hours later, and any other failure up to 3 more times, 30 minutes, 2 hours and 6 hours after it. Switched off, retries still waiting are not sent. |
| max_per_hour | integer | null | optional | The most messages it sends an hour, from 60 to 100000; null sends as fast as the number allows. |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "campaign" | required | |
| name | string | required | |
| connection_id | string | null | required | |
| status | "draft" | "scheduled" | "sending" | "paused" | "sent" | "stopped" | "failed" | required | |
| template | object | null | required | |
| template.id | string | null | required | |
| template.name | string | required | |
| template.language | string | required | |
| variable_map | object[] | required | |
| variable_map[].var | string | required | |
| variable_map[].source | string | null | required | |
| variable_map[].fallback | string | null | required | |
| cards | object[] | required | |
| cards[].media_id | string | required | |
| header | object | null | required | |
| header.type | "image" | "video" | "document" | required | |
| header.media_id | string | required | |
| header.from_template | boolean | required | |
| header.latitude | number | required | |
| header.longitude | number | required | |
| header.name | string | required | |
| header.address | string | required | |
| header.variable_map | object[] | required | |
| header.variable_map[].var | string | required | |
| header.variable_map[].source | string | null | required | |
| header.variable_map[].fallback | string | null | required | |
| buttons | object[] | required | |
| buttons[].index | integer | required | |
| buttons[].type | "url" | required | |
| buttons[].variable_map | object[] | required | |
| buttons[].variable_map[].var | string | required | |
| buttons[].variable_map[].source | string | null | required | |
| buttons[].variable_map[].fallback | string | null | required | |
| buttons[].code | string | required | |
| audience | object | required | |
| audience.tags | string[] | required | |
| audience.labels | string[] | required | |
| audience.fields | object[] | required | |
| audience.fields[].key | string | required | |
| audience.fields[].op | "is" | "is_not" | "contains" | "gt" | "lt" | "before" | "after" | "on" | … | required | |
| audience.fields[].value | string | number | boolean | null | required | |
| audience.match | "any" | "all" | required | |
| audience.everyone | boolean | required | |
| audience.smart | "engaged" | "win_back" | "at_risk" | null | required | |
| audience.segment_id | string | null | required | |
| audience.from_campaign | object | null | required | |
| audience.from_campaign.id | string | required | |
| audience.from_campaign.kind | string | required | |
| audience.from_campaign.button | string | null | optional | |
| schedule | object | null | required | |
| schedule.local_time | string | required | |
| schedule.tz | string | required | |
| schedule.starts_at_utc | string (date-time) | null | required | |
| quiet_hours | object | required | |
| quiet_hours.on | boolean | required | |
| quiet_hours.from | string | required | |
| quiet_hours.to | string | required | |
| kind | "one" | "sequence" | "ab" | required | |
| steps | object[] | required | |
| steps[].template | object | null | required | |
| steps[].template.id | string | null | required | |
| steps[].template.name | string | required | |
| steps[].template.language | string | required | |
| steps[].variable_map | object[] | required | |
| steps[].variable_map[].var | string | required | |
| steps[].variable_map[].source | string | null | required | |
| steps[].variable_map[].fallback | string | null | required | |
| steps[].cards | object[] | required | |
| steps[].cards[].media_id | string | required | |
| steps[].header | object | null | required | |
| steps[].header.type | "image" | "video" | "document" | required | |
| steps[].header.media_id | string | required | |
| steps[].header.from_template | boolean | required | |
| steps[].header.latitude | number | required | |
| steps[].header.longitude | number | required | |
| steps[].header.name | string | required | |
| steps[].header.address | string | required | |
| steps[].header.variable_map | object[] | required | |
| steps[].buttons | object[] | required | |
| steps[].buttons[].index | integer | required | |
| steps[].buttons[].type | "url" | required | |
| steps[].buttons[].variable_map | object[] | required | |
| steps[].buttons[].code | string | required | |
| steps[].wait_days | integer | required | |
| steps[].to | "no_reply" | "no_read" | "no_click" | required | |
| ab | object | null | required | |
| ab.template | object | null | required | |
| ab.template.id | string | null | required | |
| ab.template.name | string | required | |
| ab.template.language | string | required | |
| ab.variable_map | object[] | required | |
| ab.variable_map[].var | string | required | |
| ab.variable_map[].source | string | null | required | |
| ab.variable_map[].fallback | string | null | required | |
| ab.cards | object[] | required | |
| ab.cards[].media_id | string | required | |
| ab.header | object | null | required | |
| ab.header.type | "image" | "video" | "document" | required | |
| ab.header.media_id | string | required | |
| ab.header.from_template | boolean | required | |
| ab.header.latitude | number | required | |
| ab.header.longitude | number | required | |
| ab.header.name | string | required | |
| ab.header.address | string | required | |
| ab.header.variable_map | object[] | required | |
| ab.buttons | object[] | required | |
| ab.buttons[].index | integer | required | |
| ab.buttons[].type | "url" | required | |
| ab.buttons[].variable_map | object[] | required | |
| ab.buttons[].code | string | required | |
| ab.test_percent | integer | required | |
| ab.metric | "replies" | "reads" | "clicks" | required | |
| ab.test_hours | integer | required | |
| ab.auto_send | boolean | required | |
| winner | object | null | required | |
| winner.variant | "a" | "b" | required | |
| winner.by | "replies" | "reads" | "clicks" | required | |
| winner.chance | number | required | |
| winner.close | boolean | required | |
| winner.auto | boolean | required | |
| winner.at | string (date-time) | required | |
| reply_rules | object[] | required | |
| reply_rules[].when | object | required | |
| reply_rules[].when.type | "button" | required | |
| reply_rules[].when.text | string | required | |
| reply_rules[].when.words | string[] | required | |
| reply_rules[].actions | object[] | required | |
| reply_rules[].actions[].type | "assign" | required | |
| reply_rules[].actions[].user_id | string | required | |
| reply_rules[].actions[].tag | string | required | |
| reply_rules[].actions[].label | string | required | |
| reply_rules[].actions[].text | string | required | |
| reply_rules[].actions[].automation_id | string | required | |
| reply_rules[].actions[].step | integer | required | |
| let_join | boolean | required | |
| n_recipients | integer | required | |
| n_sent | integer | required | |
| n_delivered | integer | required | |
| n_read | integer | required | |
| n_replied | integer | required | |
| n_failed | integer | required | |
| n_clicked | integer | null | required | People who tapped a tracked link at least once, each counted once. null when the campaign counts no clicks. |
| track_clicks | boolean | required | |
| auto_retry | boolean | required | |
| max_per_hour | integer | null | required | |
| pause_reason | string | null | required | |
| end_reason | object | null | required | |
| end_reason.code | string | required | |
| end_reason.words | string | required | |
| end_reason.meta_message | string | null | required | |
| created_by | string | null | required | |
| stopped_by | string | null | required | |
| retarget_of | string | null | required | |
| started_at | string (date-time) | null | required | |
| finished_at | string (date-time) | null | required | |
| stopped_at | string (date-time) | null | required | |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required |
GET /v1/campaigns/{id}
One campaign: its number, audience, template, time, quiet hours and figures
Scopes campaigns:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "campaign" | required | |
| name | string | required | |
| connection_id | string | null | required | |
| status | "draft" | "scheduled" | "sending" | "paused" | "sent" | "stopped" | "failed" | required | |
| template | object | null | required | |
| template.id | string | null | required | |
| template.name | string | required | |
| template.language | string | required | |
| variable_map | object[] | required | |
| variable_map[].var | string | required | |
| variable_map[].source | string | null | required | |
| variable_map[].fallback | string | null | required | |
| cards | object[] | required | |
| cards[].media_id | string | required | |
| header | object | null | required | |
| header.type | "image" | "video" | "document" | required | |
| header.media_id | string | required | |
| header.from_template | boolean | required | |
| header.latitude | number | required | |
| header.longitude | number | required | |
| header.name | string | required | |
| header.address | string | required | |
| header.variable_map | object[] | required | |
| header.variable_map[].var | string | required | |
| header.variable_map[].source | string | null | required | |
| header.variable_map[].fallback | string | null | required | |
| buttons | object[] | required | |
| buttons[].index | integer | required | |
| buttons[].type | "url" | required | |
| buttons[].variable_map | object[] | required | |
| buttons[].variable_map[].var | string | required | |
| buttons[].variable_map[].source | string | null | required | |
| buttons[].variable_map[].fallback | string | null | required | |
| buttons[].code | string | required | |
| audience | object | required | |
| audience.tags | string[] | required | |
| audience.labels | string[] | required | |
| audience.fields | object[] | required | |
| audience.fields[].key | string | required | |
| audience.fields[].op | "is" | "is_not" | "contains" | "gt" | "lt" | "before" | "after" | "on" | … | required | |
| audience.fields[].value | string | number | boolean | null | required | |
| audience.match | "any" | "all" | required | |
| audience.everyone | boolean | required | |
| audience.smart | "engaged" | "win_back" | "at_risk" | null | required | |
| audience.segment_id | string | null | required | |
| audience.from_campaign | object | null | required | |
| audience.from_campaign.id | string | required | |
| audience.from_campaign.kind | string | required | |
| audience.from_campaign.button | string | null | optional | |
| schedule | object | null | required | |
| schedule.local_time | string | required | |
| schedule.tz | string | required | |
| schedule.starts_at_utc | string (date-time) | null | required | |
| quiet_hours | object | required | |
| quiet_hours.on | boolean | required | |
| quiet_hours.from | string | required | |
| quiet_hours.to | string | required | |
| kind | "one" | "sequence" | "ab" | required | |
| steps | object[] | required | |
| steps[].template | object | null | required | |
| steps[].template.id | string | null | required | |
| steps[].template.name | string | required | |
| steps[].template.language | string | required | |
| steps[].variable_map | object[] | required | |
| steps[].variable_map[].var | string | required | |
| steps[].variable_map[].source | string | null | required | |
| steps[].variable_map[].fallback | string | null | required | |
| steps[].cards | object[] | required | |
| steps[].cards[].media_id | string | required | |
| steps[].header | object | null | required | |
| steps[].header.type | "image" | "video" | "document" | required | |
| steps[].header.media_id | string | required | |
| steps[].header.from_template | boolean | required | |
| steps[].header.latitude | number | required | |
| steps[].header.longitude | number | required | |
| steps[].header.name | string | required | |
| steps[].header.address | string | required | |
| steps[].header.variable_map | object[] | required | |
| steps[].buttons | object[] | required | |
| steps[].buttons[].index | integer | required | |
| steps[].buttons[].type | "url" | required | |
| steps[].buttons[].variable_map | object[] | required | |
| steps[].buttons[].code | string | required | |
| steps[].wait_days | integer | required | |
| steps[].to | "no_reply" | "no_read" | "no_click" | required | |
| ab | object | null | required | |
| ab.template | object | null | required | |
| ab.template.id | string | null | required | |
| ab.template.name | string | required | |
| ab.template.language | string | required | |
| ab.variable_map | object[] | required | |
| ab.variable_map[].var | string | required | |
| ab.variable_map[].source | string | null | required | |
| ab.variable_map[].fallback | string | null | required | |
| ab.cards | object[] | required | |
| ab.cards[].media_id | string | required | |
| ab.header | object | null | required | |
| ab.header.type | "image" | "video" | "document" | required | |
| ab.header.media_id | string | required | |
| ab.header.from_template | boolean | required | |
| ab.header.latitude | number | required | |
| ab.header.longitude | number | required | |
| ab.header.name | string | required | |
| ab.header.address | string | required | |
| ab.header.variable_map | object[] | required | |
| ab.buttons | object[] | required | |
| ab.buttons[].index | integer | required | |
| ab.buttons[].type | "url" | required | |
| ab.buttons[].variable_map | object[] | required | |
| ab.buttons[].code | string | required | |
| ab.test_percent | integer | required | |
| ab.metric | "replies" | "reads" | "clicks" | required | |
| ab.test_hours | integer | required | |
| ab.auto_send | boolean | required | |
| winner | object | null | required | |
| winner.variant | "a" | "b" | required | |
| winner.by | "replies" | "reads" | "clicks" | required | |
| winner.chance | number | required | |
| winner.close | boolean | required | |
| winner.auto | boolean | required | |
| winner.at | string (date-time) | required | |
| reply_rules | object[] | required | |
| reply_rules[].when | object | required | |
| reply_rules[].when.type | "button" | required | |
| reply_rules[].when.text | string | required | |
| reply_rules[].when.words | string[] | required | |
| reply_rules[].actions | object[] | required | |
| reply_rules[].actions[].type | "assign" | required | |
| reply_rules[].actions[].user_id | string | required | |
| reply_rules[].actions[].tag | string | required | |
| reply_rules[].actions[].label | string | required | |
| reply_rules[].actions[].text | string | required | |
| reply_rules[].actions[].automation_id | string | required | |
| reply_rules[].actions[].step | integer | required | |
| let_join | boolean | required | |
| n_recipients | integer | required | |
| n_sent | integer | required | |
| n_delivered | integer | required | |
| n_read | integer | required | |
| n_replied | integer | required | |
| n_failed | integer | required | |
| n_clicked | integer | null | required | People who tapped a tracked link at least once, each counted once. null when the campaign counts no clicks. |
| track_clicks | boolean | required | |
| auto_retry | boolean | required | |
| max_per_hour | integer | null | required | |
| pause_reason | string | null | required | |
| end_reason | object | null | required | |
| end_reason.code | string | required | |
| end_reason.words | string | required | |
| end_reason.meta_message | string | null | required | |
| created_by | string | null | required | |
| stopped_by | string | null | required | |
| retarget_of | string | null | required | |
| started_at | string (date-time) | null | required | |
| finished_at | string (date-time) | null | required | |
| stopped_at | string (date-time) | null | required | |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required |
PATCH /v1/campaigns/{id}
Save a step of a draft. A scheduled campaign that is changed is a draft again
Scopes campaigns:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | optional | |
| connection_id | string | optional | |
| template_id | string | null | optional | |
| variable_map | object[] | optional | |
| variable_map[].var | string | required | |
| variable_map[].source | string | null | optional | |
| variable_map[].fallback | string | null | optional | |
| cards | object[] | optional | |
| cards[].media_id | string | required | |
| header | object | null | optional | |
| header.type | "image" | "video" | "document" | required | |
| header.media_id | string | required | |
| header.latitude | number | required | |
| header.longitude | number | required | |
| header.name | string | required | |
| header.address | string | required | |
| header.variable_map | object[] | required | |
| header.variable_map[].var | string | required | |
| header.variable_map[].source | string | null | optional | |
| header.variable_map[].fallback | string | null | optional | |
| buttons | object[] | optional | |
| buttons[].index | integer | required | |
| buttons[].type | "url" | required | |
| buttons[].variable_map | object[] | required | |
| buttons[].variable_map[].var | string | required | |
| buttons[].variable_map[].source | string | null | optional | |
| buttons[].variable_map[].fallback | string | null | optional | |
| buttons[].code | string | required | |
| audience | object | optional | |
| audience.tags | string[] | optional | |
| audience.labels | string[] | optional | |
| audience.fields | object[] | optional | Contact-field conditions, at most 10: key is a contact field of the business, or name, locale or timezone; op is is, is_not or contains for text, is, gt or lt for a number, before, after or on for a date (YYYY-MM-DD), is or is_not for a choice (value one of its choices), is for a yes/no field (value true or false), and is_set or is_not_set for any field. |
| audience.fields[].key | string | required | |
| audience.fields[].op | "is" | "is_not" | "contains" | "gt" | "lt" | "before" | "after" | "on" | … | required | |
| audience.fields[].value | string | number | boolean | null | optional | |
| audience.match | "any" | "all" | optional | |
| audience.everyone | boolean | optional | Every contact of the number’s business. With it, the audience has no tags, labels, fields, smart segment, saved audience or earlier campaign. |
| audience.smart | "engaged" | "win_back" | "at_risk" | null | optional | |
| audience.segment_id | string | null | optional | |
| audience.from_campaign | object | null | optional | |
| audience.from_campaign.id | string | required | |
| audience.from_campaign.kind | "replied" | "read_no_reply" | "delivered_not_read" | "clicked" | "not_clicked" | "tapped" | required | |
| audience.from_campaign.button | string | null | optional | |
| schedule | object | null | optional | |
| schedule.local_time | string | required | |
| schedule.tz | string | required | |
| quiet_hours | object | optional | |
| quiet_hours.on | boolean | required | |
| quiet_hours.from | string | required | |
| quiet_hours.to | string | required | |
| track_clicks | boolean | optional | |
| kind | "one" | "sequence" | "ab" | optional | |
| steps | object[] | optional | |
| steps[].template_id | string | null | required | |
| steps[].variable_map | object[] | optional | |
| steps[].variable_map[].var | string | required | |
| steps[].variable_map[].source | string | null | optional | |
| steps[].variable_map[].fallback | string | null | optional | |
| steps[].cards | object[] | optional | |
| steps[].cards[].media_id | string | required | |
| steps[].header | object | null | optional | |
| steps[].header.type | "image" | "video" | "document" | required | |
| steps[].header.media_id | string | required | |
| steps[].header.latitude | number | required | |
| steps[].header.longitude | number | required | |
| steps[].header.name | string | required | |
| steps[].header.address | string | required | |
| steps[].header.variable_map | object[] | required | |
| steps[].buttons | object[] | optional | |
| steps[].buttons[].index | integer | required | |
| steps[].buttons[].type | "url" | required | |
| steps[].buttons[].variable_map | object[] | required | |
| steps[].buttons[].code | string | required | |
| steps[].wait_days | integer | required | |
| steps[].to | "no_reply" | "no_read" | "no_click" | optional | |
| ab | object | null | optional | |
| ab.template_id | string | null | required | |
| ab.variable_map | object[] | optional | |
| ab.variable_map[].var | string | required | |
| ab.variable_map[].source | string | null | optional | |
| ab.variable_map[].fallback | string | null | optional | |
| ab.cards | object[] | optional | |
| ab.cards[].media_id | string | required | |
| ab.header | object | null | optional | |
| ab.header.type | "image" | "video" | "document" | required | |
| ab.header.media_id | string | required | |
| ab.header.latitude | number | required | |
| ab.header.longitude | number | required | |
| ab.header.name | string | required | |
| ab.header.address | string | required | |
| ab.header.variable_map | object[] | required | |
| ab.buttons | object[] | optional | |
| ab.buttons[].index | integer | required | |
| ab.buttons[].type | "url" | required | |
| ab.buttons[].variable_map | object[] | required | |
| ab.buttons[].code | string | required | |
| ab.test_percent | integer | required | |
| ab.metric | "replies" | "reads" | "clicks" | required | |
| ab.test_hours | 2 | 4 | 12 | 24 | required | |
| ab.auto_send | boolean | required | |
| reply_rules | object[] | optional | |
| reply_rules[].when | object | required | |
| reply_rules[].when.type | "button" | required | |
| reply_rules[].when.text | string | required | |
| reply_rules[].when.words | string[] | required | |
| reply_rules[].actions | object[] | required | |
| reply_rules[].actions[].type | "assign" | required | |
| reply_rules[].actions[].user_id | string | required | |
| reply_rules[].actions[].tag | string | required | |
| reply_rules[].actions[].label | string | required | |
| reply_rules[].actions[].text | string | required | |
| reply_rules[].actions[].automation_id | string | required | |
| reply_rules[].actions[].step | integer | required | |
| let_join | boolean | optional | |
| auto_retry | boolean | optional | Retries failed sends by itself: a person not on WhatsApp is not retried, a message WhatsApp held back is retried once, 24 hours later, and any other failure up to 3 more times, 30 minutes, 2 hours and 6 hours after it. Switched off, retries still waiting are not sent. |
| max_per_hour | integer | null | optional | The most messages it sends an hour, from 60 to 100000; null sends as fast as the number allows. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "campaign" | required | |
| name | string | required | |
| connection_id | string | null | required | |
| status | "draft" | "scheduled" | "sending" | "paused" | "sent" | "stopped" | "failed" | required | |
| template | object | null | required | |
| template.id | string | null | required | |
| template.name | string | required | |
| template.language | string | required | |
| variable_map | object[] | required | |
| variable_map[].var | string | required | |
| variable_map[].source | string | null | required | |
| variable_map[].fallback | string | null | required | |
| cards | object[] | required | |
| cards[].media_id | string | required | |
| header | object | null | required | |
| header.type | "image" | "video" | "document" | required | |
| header.media_id | string | required | |
| header.from_template | boolean | required | |
| header.latitude | number | required | |
| header.longitude | number | required | |
| header.name | string | required | |
| header.address | string | required | |
| header.variable_map | object[] | required | |
| header.variable_map[].var | string | required | |
| header.variable_map[].source | string | null | required | |
| header.variable_map[].fallback | string | null | required | |
| buttons | object[] | required | |
| buttons[].index | integer | required | |
| buttons[].type | "url" | required | |
| buttons[].variable_map | object[] | required | |
| buttons[].variable_map[].var | string | required | |
| buttons[].variable_map[].source | string | null | required | |
| buttons[].variable_map[].fallback | string | null | required | |
| buttons[].code | string | required | |
| audience | object | required | |
| audience.tags | string[] | required | |
| audience.labels | string[] | required | |
| audience.fields | object[] | required | |
| audience.fields[].key | string | required | |
| audience.fields[].op | "is" | "is_not" | "contains" | "gt" | "lt" | "before" | "after" | "on" | … | required | |
| audience.fields[].value | string | number | boolean | null | required | |
| audience.match | "any" | "all" | required | |
| audience.everyone | boolean | required | |
| audience.smart | "engaged" | "win_back" | "at_risk" | null | required | |
| audience.segment_id | string | null | required | |
| audience.from_campaign | object | null | required | |
| audience.from_campaign.id | string | required | |
| audience.from_campaign.kind | string | required | |
| audience.from_campaign.button | string | null | optional | |
| schedule | object | null | required | |
| schedule.local_time | string | required | |
| schedule.tz | string | required | |
| schedule.starts_at_utc | string (date-time) | null | required | |
| quiet_hours | object | required | |
| quiet_hours.on | boolean | required | |
| quiet_hours.from | string | required | |
| quiet_hours.to | string | required | |
| kind | "one" | "sequence" | "ab" | required | |
| steps | object[] | required | |
| steps[].template | object | null | required | |
| steps[].template.id | string | null | required | |
| steps[].template.name | string | required | |
| steps[].template.language | string | required | |
| steps[].variable_map | object[] | required | |
| steps[].variable_map[].var | string | required | |
| steps[].variable_map[].source | string | null | required | |
| steps[].variable_map[].fallback | string | null | required | |
| steps[].cards | object[] | required | |
| steps[].cards[].media_id | string | required | |
| steps[].header | object | null | required | |
| steps[].header.type | "image" | "video" | "document" | required | |
| steps[].header.media_id | string | required | |
| steps[].header.from_template | boolean | required | |
| steps[].header.latitude | number | required | |
| steps[].header.longitude | number | required | |
| steps[].header.name | string | required | |
| steps[].header.address | string | required | |
| steps[].header.variable_map | object[] | required | |
| steps[].buttons | object[] | required | |
| steps[].buttons[].index | integer | required | |
| steps[].buttons[].type | "url" | required | |
| steps[].buttons[].variable_map | object[] | required | |
| steps[].buttons[].code | string | required | |
| steps[].wait_days | integer | required | |
| steps[].to | "no_reply" | "no_read" | "no_click" | required | |
| ab | object | null | required | |
| ab.template | object | null | required | |
| ab.template.id | string | null | required | |
| ab.template.name | string | required | |
| ab.template.language | string | required | |
| ab.variable_map | object[] | required | |
| ab.variable_map[].var | string | required | |
| ab.variable_map[].source | string | null | required | |
| ab.variable_map[].fallback | string | null | required | |
| ab.cards | object[] | required | |
| ab.cards[].media_id | string | required | |
| ab.header | object | null | required | |
| ab.header.type | "image" | "video" | "document" | required | |
| ab.header.media_id | string | required | |
| ab.header.from_template | boolean | required | |
| ab.header.latitude | number | required | |
| ab.header.longitude | number | required | |
| ab.header.name | string | required | |
| ab.header.address | string | required | |
| ab.header.variable_map | object[] | required | |
| ab.buttons | object[] | required | |
| ab.buttons[].index | integer | required | |
| ab.buttons[].type | "url" | required | |
| ab.buttons[].variable_map | object[] | required | |
| ab.buttons[].code | string | required | |
| ab.test_percent | integer | required | |
| ab.metric | "replies" | "reads" | "clicks" | required | |
| ab.test_hours | integer | required | |
| ab.auto_send | boolean | required | |
| winner | object | null | required | |
| winner.variant | "a" | "b" | required | |
| winner.by | "replies" | "reads" | "clicks" | required | |
| winner.chance | number | required | |
| winner.close | boolean | required | |
| winner.auto | boolean | required | |
| winner.at | string (date-time) | required | |
| reply_rules | object[] | required | |
| reply_rules[].when | object | required | |
| reply_rules[].when.type | "button" | required | |
| reply_rules[].when.text | string | required | |
| reply_rules[].when.words | string[] | required | |
| reply_rules[].actions | object[] | required | |
| reply_rules[].actions[].type | "assign" | required | |
| reply_rules[].actions[].user_id | string | required | |
| reply_rules[].actions[].tag | string | required | |
| reply_rules[].actions[].label | string | required | |
| reply_rules[].actions[].text | string | required | |
| reply_rules[].actions[].automation_id | string | required | |
| reply_rules[].actions[].step | integer | required | |
| let_join | boolean | required | |
| n_recipients | integer | required | |
| n_sent | integer | required | |
| n_delivered | integer | required | |
| n_read | integer | required | |
| n_replied | integer | required | |
| n_failed | integer | required | |
| n_clicked | integer | null | required | People who tapped a tracked link at least once, each counted once. null when the campaign counts no clicks. |
| track_clicks | boolean | required | |
| auto_retry | boolean | required | |
| max_per_hour | integer | null | required | |
| pause_reason | string | null | required | |
| end_reason | object | null | required | |
| end_reason.code | string | required | |
| end_reason.words | string | required | |
| end_reason.meta_message | string | null | required | |
| created_by | string | null | required | |
| stopped_by | string | null | required | |
| retarget_of | string | null | required | |
| started_at | string (date-time) | null | required | |
| finished_at | string (date-time) | null | required | |
| stopped_at | string (date-time) | null | required | |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required |
DELETE /v1/campaigns/{id}
Delete a draft
Scopes campaigns:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "campaign" | required | |
| deleted | true | required |
POST /v1/campaigns/{id}/audience/preview
Who will get it, who is left out and why, and Meta’s list price for it. Only people of this number’s business
Scopes campaigns:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| reason | "invalid_number" | "blocked" | "opted_out" | "us_marketing" | "frequency_cap" | "missing_value" | "open_chat" | "eligible" | optional | |
| limit | integer | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "audience_preview" | required | |
| matched | integer | required | |
| eligible | integer | required | |
| recipients_fingerprint | string | required | |
| excluded | object | required | |
| rows | object[] | required | |
| rows[].contact_id | string | required | |
| rows[].display_name | string | null | required | |
| rows[].reason | string | null | required | |
| rows[].reason_words | string | null | required | |
| meta_cost | object | required | |
| meta_cost.currency | string | required | |
| meta_cost.effective_from | string | required | |
| meta_cost.total | number | required | |
| meta_cost.markets | object[] | required | |
| meta_cost.markets[].market | string | required | |
| meta_cost.markets[].recipients | integer | required | |
| meta_cost.markets[].rate | number | required | |
| meta_cost.not_priced | integer | required | |
| meta_cost.notes | string[] | required |
POST /v1/campaigns/{id}/duplicate
A new draft copied from a campaign, with everything it is set to do: its number, audience, messages, blanks, quiet hours, click counting and reply actions. It is named "<name> (copy)", then "(copy 2)", "(copy 3)". Its results start from zero
Scopes campaigns:write
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "campaign" | required | |
| name | string | required | |
| connection_id | string | null | required | |
| status | "draft" | "scheduled" | "sending" | "paused" | "sent" | "stopped" | "failed" | required | |
| template | object | null | required | |
| template.id | string | null | required | |
| template.name | string | required | |
| template.language | string | required | |
| variable_map | object[] | required | |
| variable_map[].var | string | required | |
| variable_map[].source | string | null | required | |
| variable_map[].fallback | string | null | required | |
| cards | object[] | required | |
| cards[].media_id | string | required | |
| header | object | null | required | |
| header.type | "image" | "video" | "document" | required | |
| header.media_id | string | required | |
| header.from_template | boolean | required | |
| header.latitude | number | required | |
| header.longitude | number | required | |
| header.name | string | required | |
| header.address | string | required | |
| header.variable_map | object[] | required | |
| header.variable_map[].var | string | required | |
| header.variable_map[].source | string | null | required | |
| header.variable_map[].fallback | string | null | required | |
| buttons | object[] | required | |
| buttons[].index | integer | required | |
| buttons[].type | "url" | required | |
| buttons[].variable_map | object[] | required | |
| buttons[].variable_map[].var | string | required | |
| buttons[].variable_map[].source | string | null | required | |
| buttons[].variable_map[].fallback | string | null | required | |
| buttons[].code | string | required | |
| audience | object | required | |
| audience.tags | string[] | required | |
| audience.labels | string[] | required | |
| audience.fields | object[] | required | |
| audience.fields[].key | string | required | |
| audience.fields[].op | "is" | "is_not" | "contains" | "gt" | "lt" | "before" | "after" | "on" | … | required | |
| audience.fields[].value | string | number | boolean | null | required | |
| audience.match | "any" | "all" | required | |
| audience.everyone | boolean | required | |
| audience.smart | "engaged" | "win_back" | "at_risk" | null | required | |
| audience.segment_id | string | null | required | |
| audience.from_campaign | object | null | required | |
| audience.from_campaign.id | string | required | |
| audience.from_campaign.kind | string | required | |
| audience.from_campaign.button | string | null | optional | |
| schedule | object | null | required | |
| schedule.local_time | string | required | |
| schedule.tz | string | required | |
| schedule.starts_at_utc | string (date-time) | null | required | |
| quiet_hours | object | required | |
| quiet_hours.on | boolean | required | |
| quiet_hours.from | string | required | |
| quiet_hours.to | string | required | |
| kind | "one" | "sequence" | "ab" | required | |
| steps | object[] | required | |
| steps[].template | object | null | required | |
| steps[].template.id | string | null | required | |
| steps[].template.name | string | required | |
| steps[].template.language | string | required | |
| steps[].variable_map | object[] | required | |
| steps[].variable_map[].var | string | required | |
| steps[].variable_map[].source | string | null | required | |
| steps[].variable_map[].fallback | string | null | required | |
| steps[].cards | object[] | required | |
| steps[].cards[].media_id | string | required | |
| steps[].header | object | null | required | |
| steps[].header.type | "image" | "video" | "document" | required | |
| steps[].header.media_id | string | required | |
| steps[].header.from_template | boolean | required | |
| steps[].header.latitude | number | required | |
| steps[].header.longitude | number | required | |
| steps[].header.name | string | required | |
| steps[].header.address | string | required | |
| steps[].header.variable_map | object[] | required | |
| steps[].buttons | object[] | required | |
| steps[].buttons[].index | integer | required | |
| steps[].buttons[].type | "url" | required | |
| steps[].buttons[].variable_map | object[] | required | |
| steps[].buttons[].code | string | required | |
| steps[].wait_days | integer | required | |
| steps[].to | "no_reply" | "no_read" | "no_click" | required | |
| ab | object | null | required | |
| ab.template | object | null | required | |
| ab.template.id | string | null | required | |
| ab.template.name | string | required | |
| ab.template.language | string | required | |
| ab.variable_map | object[] | required | |
| ab.variable_map[].var | string | required | |
| ab.variable_map[].source | string | null | required | |
| ab.variable_map[].fallback | string | null | required | |
| ab.cards | object[] | required | |
| ab.cards[].media_id | string | required | |
| ab.header | object | null | required | |
| ab.header.type | "image" | "video" | "document" | required | |
| ab.header.media_id | string | required | |
| ab.header.from_template | boolean | required | |
| ab.header.latitude | number | required | |
| ab.header.longitude | number | required | |
| ab.header.name | string | required | |
| ab.header.address | string | required | |
| ab.header.variable_map | object[] | required | |
| ab.buttons | object[] | required | |
| ab.buttons[].index | integer | required | |
| ab.buttons[].type | "url" | required | |
| ab.buttons[].variable_map | object[] | required | |
| ab.buttons[].code | string | required | |
| ab.test_percent | integer | required | |
| ab.metric | "replies" | "reads" | "clicks" | required | |
| ab.test_hours | integer | required | |
| ab.auto_send | boolean | required | |
| winner | object | null | required | |
| winner.variant | "a" | "b" | required | |
| winner.by | "replies" | "reads" | "clicks" | required | |
| winner.chance | number | required | |
| winner.close | boolean | required | |
| winner.auto | boolean | required | |
| winner.at | string (date-time) | required | |
| reply_rules | object[] | required | |
| reply_rules[].when | object | required | |
| reply_rules[].when.type | "button" | required | |
| reply_rules[].when.text | string | required | |
| reply_rules[].when.words | string[] | required | |
| reply_rules[].actions | object[] | required | |
| reply_rules[].actions[].type | "assign" | required | |
| reply_rules[].actions[].user_id | string | required | |
| reply_rules[].actions[].tag | string | required | |
| reply_rules[].actions[].label | string | required | |
| reply_rules[].actions[].text | string | required | |
| reply_rules[].actions[].automation_id | string | required | |
| reply_rules[].actions[].step | integer | required | |
| let_join | boolean | required | |
| n_recipients | integer | required | |
| n_sent | integer | required | |
| n_delivered | integer | required | |
| n_read | integer | required | |
| n_replied | integer | required | |
| n_failed | integer | required | |
| n_clicked | integer | null | required | People who tapped a tracked link at least once, each counted once. null when the campaign counts no clicks. |
| track_clicks | boolean | required | |
| auto_retry | boolean | required | |
| max_per_hour | integer | null | required | |
| pause_reason | string | null | required | |
| end_reason | object | null | required | |
| end_reason.code | string | required | |
| end_reason.words | string | required | |
| end_reason.meta_message | string | null | required | |
| created_by | string | null | required | |
| stopped_by | string | null | required | |
| retarget_of | string | null | required | |
| started_at | string (date-time) | null | required | |
| finished_at | string (date-time) | null | required | |
| stopped_at | string (date-time) | null | required | |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required |
POST /v1/campaigns/{id}/estimate
How many get it, the daily limit and when each part goes out, the plan meter, and whether the count must be typed
Scopes campaigns:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "campaign_estimate" | required | |
| estimate_id | string | required | |
| expires_at | string (date-time) | required | |
| recipients | integer | required | |
| daily_limit | object | required | |
| daily_limit.portfolio_limit | integer | null | required | |
| daily_limit.remaining | integer | null | required | |
| daily_limit.needed | integer | required | |
| daily_limit.plan | object[] | required | |
| daily_limit.plan[].date | string | required | |
| daily_limit.plan[].n | integer | required | |
| quiet_until | string (date-time) | null | required | |
| send_hours | integer | null | required | |
| plan_meter | object | required | |
| plan_meter.meter | "message_sent" | required | |
| plan_meter.remaining | integer | null | required | |
| plan_meter.hard_cap | integer | null | required | |
| confirm_threshold | integer | required | |
| confirm_required | boolean | required | |
| automation_runs | object | required | |
| automation_runs.max | integer | required | |
| automation_runs.parts | ("follow_up_steps" | "winner" | "reply_actions")[] | required | |
| ab_split | object | null | required | |
| ab_split.test | integer | required | |
| ab_split.a | integer | required | |
| ab_split.b | integer | required | |
| ab_split.rest | integer | required |
POST /v1/campaigns/{id}/export
A CSV of the people a campaign is for and what happened to each, read at GET /v1/exports/{id}
Scopes campaigns:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "export" | required | |
| status | string | required |
POST /v1/campaigns/{id}/pause
Pause a campaign that is sending
Scopes campaigns:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "campaign" | required | |
| name | string | required | |
| connection_id | string | null | required | |
| status | "draft" | "scheduled" | "sending" | "paused" | "sent" | "stopped" | "failed" | required | |
| template | object | null | required | |
| template.id | string | null | required | |
| template.name | string | required | |
| template.language | string | required | |
| variable_map | object[] | required | |
| variable_map[].var | string | required | |
| variable_map[].source | string | null | required | |
| variable_map[].fallback | string | null | required | |
| cards | object[] | required | |
| cards[].media_id | string | required | |
| header | object | null | required | |
| header.type | "image" | "video" | "document" | required | |
| header.media_id | string | required | |
| header.from_template | boolean | required | |
| header.latitude | number | required | |
| header.longitude | number | required | |
| header.name | string | required | |
| header.address | string | required | |
| header.variable_map | object[] | required | |
| header.variable_map[].var | string | required | |
| header.variable_map[].source | string | null | required | |
| header.variable_map[].fallback | string | null | required | |
| buttons | object[] | required | |
| buttons[].index | integer | required | |
| buttons[].type | "url" | required | |
| buttons[].variable_map | object[] | required | |
| buttons[].variable_map[].var | string | required | |
| buttons[].variable_map[].source | string | null | required | |
| buttons[].variable_map[].fallback | string | null | required | |
| buttons[].code | string | required | |
| audience | object | required | |
| audience.tags | string[] | required | |
| audience.labels | string[] | required | |
| audience.fields | object[] | required | |
| audience.fields[].key | string | required | |
| audience.fields[].op | "is" | "is_not" | "contains" | "gt" | "lt" | "before" | "after" | "on" | … | required | |
| audience.fields[].value | string | number | boolean | null | required | |
| audience.match | "any" | "all" | required | |
| audience.everyone | boolean | required | |
| audience.smart | "engaged" | "win_back" | "at_risk" | null | required | |
| audience.segment_id | string | null | required | |
| audience.from_campaign | object | null | required | |
| audience.from_campaign.id | string | required | |
| audience.from_campaign.kind | string | required | |
| audience.from_campaign.button | string | null | optional | |
| schedule | object | null | required | |
| schedule.local_time | string | required | |
| schedule.tz | string | required | |
| schedule.starts_at_utc | string (date-time) | null | required | |
| quiet_hours | object | required | |
| quiet_hours.on | boolean | required | |
| quiet_hours.from | string | required | |
| quiet_hours.to | string | required | |
| kind | "one" | "sequence" | "ab" | required | |
| steps | object[] | required | |
| steps[].template | object | null | required | |
| steps[].template.id | string | null | required | |
| steps[].template.name | string | required | |
| steps[].template.language | string | required | |
| steps[].variable_map | object[] | required | |
| steps[].variable_map[].var | string | required | |
| steps[].variable_map[].source | string | null | required | |
| steps[].variable_map[].fallback | string | null | required | |
| steps[].cards | object[] | required | |
| steps[].cards[].media_id | string | required | |
| steps[].header | object | null | required | |
| steps[].header.type | "image" | "video" | "document" | required | |
| steps[].header.media_id | string | required | |
| steps[].header.from_template | boolean | required | |
| steps[].header.latitude | number | required | |
| steps[].header.longitude | number | required | |
| steps[].header.name | string | required | |
| steps[].header.address | string | required | |
| steps[].header.variable_map | object[] | required | |
| steps[].buttons | object[] | required | |
| steps[].buttons[].index | integer | required | |
| steps[].buttons[].type | "url" | required | |
| steps[].buttons[].variable_map | object[] | required | |
| steps[].buttons[].code | string | required | |
| steps[].wait_days | integer | required | |
| steps[].to | "no_reply" | "no_read" | "no_click" | required | |
| ab | object | null | required | |
| ab.template | object | null | required | |
| ab.template.id | string | null | required | |
| ab.template.name | string | required | |
| ab.template.language | string | required | |
| ab.variable_map | object[] | required | |
| ab.variable_map[].var | string | required | |
| ab.variable_map[].source | string | null | required | |
| ab.variable_map[].fallback | string | null | required | |
| ab.cards | object[] | required | |
| ab.cards[].media_id | string | required | |
| ab.header | object | null | required | |
| ab.header.type | "image" | "video" | "document" | required | |
| ab.header.media_id | string | required | |
| ab.header.from_template | boolean | required | |
| ab.header.latitude | number | required | |
| ab.header.longitude | number | required | |
| ab.header.name | string | required | |
| ab.header.address | string | required | |
| ab.header.variable_map | object[] | required | |
| ab.buttons | object[] | required | |
| ab.buttons[].index | integer | required | |
| ab.buttons[].type | "url" | required | |
| ab.buttons[].variable_map | object[] | required | |
| ab.buttons[].code | string | required | |
| ab.test_percent | integer | required | |
| ab.metric | "replies" | "reads" | "clicks" | required | |
| ab.test_hours | integer | required | |
| ab.auto_send | boolean | required | |
| winner | object | null | required | |
| winner.variant | "a" | "b" | required | |
| winner.by | "replies" | "reads" | "clicks" | required | |
| winner.chance | number | required | |
| winner.close | boolean | required | |
| winner.auto | boolean | required | |
| winner.at | string (date-time) | required | |
| reply_rules | object[] | required | |
| reply_rules[].when | object | required | |
| reply_rules[].when.type | "button" | required | |
| reply_rules[].when.text | string | required | |
| reply_rules[].when.words | string[] | required | |
| reply_rules[].actions | object[] | required | |
| reply_rules[].actions[].type | "assign" | required | |
| reply_rules[].actions[].user_id | string | required | |
| reply_rules[].actions[].tag | string | required | |
| reply_rules[].actions[].label | string | required | |
| reply_rules[].actions[].text | string | required | |
| reply_rules[].actions[].automation_id | string | required | |
| reply_rules[].actions[].step | integer | required | |
| let_join | boolean | required | |
| n_recipients | integer | required | |
| n_sent | integer | required | |
| n_delivered | integer | required | |
| n_read | integer | required | |
| n_replied | integer | required | |
| n_failed | integer | required | |
| n_clicked | integer | null | required | People who tapped a tracked link at least once, each counted once. null when the campaign counts no clicks. |
| track_clicks | boolean | required | |
| auto_retry | boolean | required | |
| max_per_hour | integer | null | required | |
| pause_reason | string | null | required | |
| end_reason | object | null | required | |
| end_reason.code | string | required | |
| end_reason.words | string | required | |
| end_reason.meta_message | string | null | required | |
| created_by | string | null | required | |
| stopped_by | string | null | required | |
| retarget_of | string | null | required | |
| started_at | string (date-time) | null | required | |
| finished_at | string (date-time) | null | required | |
| stopped_at | string (date-time) | null | required | |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required |
GET /v1/campaigns/{id}/recipients
The people a campaign is for and what happened to each
Scopes campaigns:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| limit | query | integer | optional | |
| after | query | string | optional | |
| before | query | string | optional | |
| status | query | "pending" | "sent" | "delivered" | "delivered_not_read" | "read" | "clicked" | "replied" | "tapped" | … | optional | |
| error_group | query | "not_on_whatsapp" | "held_back" | "other" | optional | |
| q | query | string | optional | |
| place | query | "replied" | "in_sequence" | "finished" | "failed" | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].contact_id | string | required | |
| data[].display_name | string | null | required | |
| data[].status | string | required | |
| data[].reason | string | null | required | |
| data[].reason_words | string | null | required | |
| data[].notification_id | string | null | required | |
| data[].sent_at | string (date-time) | null | required | |
| data[].delivered_at | string (date-time) | null | required | |
| data[].read_at | string (date-time) | null | required | |
| data[].replied_at | string (date-time) | null | required | |
| data[].error_code | integer | null | required | |
| data[].error_group | string | null | required | |
| data[].phone | string | null | required | |
| data[].clicks | integer | null | required | |
| data[].tapped | string | null | required | |
| data[].step | integer | required | |
| data[].variant | "a" | "b" | "rest" | null | required | |
| data[].sequence_end | "replied" | "done" | "failed" | null | required | |
| data[].place | "replied" | "in_sequence" | "finished" | "failed" | null | required | |
| has_more | boolean | required | |
| next_cursor | string | null | required |
POST /v1/campaigns/{id}/resume
Resume a paused campaign, once its number and template can send
Scopes campaigns:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "campaign" | required | |
| name | string | required | |
| connection_id | string | null | required | |
| status | "draft" | "scheduled" | "sending" | "paused" | "sent" | "stopped" | "failed" | required | |
| template | object | null | required | |
| template.id | string | null | required | |
| template.name | string | required | |
| template.language | string | required | |
| variable_map | object[] | required | |
| variable_map[].var | string | required | |
| variable_map[].source | string | null | required | |
| variable_map[].fallback | string | null | required | |
| cards | object[] | required | |
| cards[].media_id | string | required | |
| header | object | null | required | |
| header.type | "image" | "video" | "document" | required | |
| header.media_id | string | required | |
| header.from_template | boolean | required | |
| header.latitude | number | required | |
| header.longitude | number | required | |
| header.name | string | required | |
| header.address | string | required | |
| header.variable_map | object[] | required | |
| header.variable_map[].var | string | required | |
| header.variable_map[].source | string | null | required | |
| header.variable_map[].fallback | string | null | required | |
| buttons | object[] | required | |
| buttons[].index | integer | required | |
| buttons[].type | "url" | required | |
| buttons[].variable_map | object[] | required | |
| buttons[].variable_map[].var | string | required | |
| buttons[].variable_map[].source | string | null | required | |
| buttons[].variable_map[].fallback | string | null | required | |
| buttons[].code | string | required | |
| audience | object | required | |
| audience.tags | string[] | required | |
| audience.labels | string[] | required | |
| audience.fields | object[] | required | |
| audience.fields[].key | string | required | |
| audience.fields[].op | "is" | "is_not" | "contains" | "gt" | "lt" | "before" | "after" | "on" | … | required | |
| audience.fields[].value | string | number | boolean | null | required | |
| audience.match | "any" | "all" | required | |
| audience.everyone | boolean | required | |
| audience.smart | "engaged" | "win_back" | "at_risk" | null | required | |
| audience.segment_id | string | null | required | |
| audience.from_campaign | object | null | required | |
| audience.from_campaign.id | string | required | |
| audience.from_campaign.kind | string | required | |
| audience.from_campaign.button | string | null | optional | |
| schedule | object | null | required | |
| schedule.local_time | string | required | |
| schedule.tz | string | required | |
| schedule.starts_at_utc | string (date-time) | null | required | |
| quiet_hours | object | required | |
| quiet_hours.on | boolean | required | |
| quiet_hours.from | string | required | |
| quiet_hours.to | string | required | |
| kind | "one" | "sequence" | "ab" | required | |
| steps | object[] | required | |
| steps[].template | object | null | required | |
| steps[].template.id | string | null | required | |
| steps[].template.name | string | required | |
| steps[].template.language | string | required | |
| steps[].variable_map | object[] | required | |
| steps[].variable_map[].var | string | required | |
| steps[].variable_map[].source | string | null | required | |
| steps[].variable_map[].fallback | string | null | required | |
| steps[].cards | object[] | required | |
| steps[].cards[].media_id | string | required | |
| steps[].header | object | null | required | |
| steps[].header.type | "image" | "video" | "document" | required | |
| steps[].header.media_id | string | required | |
| steps[].header.from_template | boolean | required | |
| steps[].header.latitude | number | required | |
| steps[].header.longitude | number | required | |
| steps[].header.name | string | required | |
| steps[].header.address | string | required | |
| steps[].header.variable_map | object[] | required | |
| steps[].buttons | object[] | required | |
| steps[].buttons[].index | integer | required | |
| steps[].buttons[].type | "url" | required | |
| steps[].buttons[].variable_map | object[] | required | |
| steps[].buttons[].code | string | required | |
| steps[].wait_days | integer | required | |
| steps[].to | "no_reply" | "no_read" | "no_click" | required | |
| ab | object | null | required | |
| ab.template | object | null | required | |
| ab.template.id | string | null | required | |
| ab.template.name | string | required | |
| ab.template.language | string | required | |
| ab.variable_map | object[] | required | |
| ab.variable_map[].var | string | required | |
| ab.variable_map[].source | string | null | required | |
| ab.variable_map[].fallback | string | null | required | |
| ab.cards | object[] | required | |
| ab.cards[].media_id | string | required | |
| ab.header | object | null | required | |
| ab.header.type | "image" | "video" | "document" | required | |
| ab.header.media_id | string | required | |
| ab.header.from_template | boolean | required | |
| ab.header.latitude | number | required | |
| ab.header.longitude | number | required | |
| ab.header.name | string | required | |
| ab.header.address | string | required | |
| ab.header.variable_map | object[] | required | |
| ab.buttons | object[] | required | |
| ab.buttons[].index | integer | required | |
| ab.buttons[].type | "url" | required | |
| ab.buttons[].variable_map | object[] | required | |
| ab.buttons[].code | string | required | |
| ab.test_percent | integer | required | |
| ab.metric | "replies" | "reads" | "clicks" | required | |
| ab.test_hours | integer | required | |
| ab.auto_send | boolean | required | |
| winner | object | null | required | |
| winner.variant | "a" | "b" | required | |
| winner.by | "replies" | "reads" | "clicks" | required | |
| winner.chance | number | required | |
| winner.close | boolean | required | |
| winner.auto | boolean | required | |
| winner.at | string (date-time) | required | |
| reply_rules | object[] | required | |
| reply_rules[].when | object | required | |
| reply_rules[].when.type | "button" | required | |
| reply_rules[].when.text | string | required | |
| reply_rules[].when.words | string[] | required | |
| reply_rules[].actions | object[] | required | |
| reply_rules[].actions[].type | "assign" | required | |
| reply_rules[].actions[].user_id | string | required | |
| reply_rules[].actions[].tag | string | required | |
| reply_rules[].actions[].label | string | required | |
| reply_rules[].actions[].text | string | required | |
| reply_rules[].actions[].automation_id | string | required | |
| reply_rules[].actions[].step | integer | required | |
| let_join | boolean | required | |
| n_recipients | integer | required | |
| n_sent | integer | required | |
| n_delivered | integer | required | |
| n_read | integer | required | |
| n_replied | integer | required | |
| n_failed | integer | required | |
| n_clicked | integer | null | required | People who tapped a tracked link at least once, each counted once. null when the campaign counts no clicks. |
| track_clicks | boolean | required | |
| auto_retry | boolean | required | |
| max_per_hour | integer | null | required | |
| pause_reason | string | null | required | |
| end_reason | object | null | required | |
| end_reason.code | string | required | |
| end_reason.words | string | required | |
| end_reason.meta_message | string | null | required | |
| created_by | string | null | required | |
| stopped_by | string | null | required | |
| retarget_of | string | null | required | |
| started_at | string (date-time) | null | required | |
| finished_at | string (date-time) | null | required | |
| stopped_at | string (date-time) | null | required | |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required |
POST /v1/campaigns/{id}/retarget
Follow up: a new draft for the people of a campaign who replied, read it and did not reply, got it and did not read it, tapped its link or did not, or tapped one of its buttons
Scopes campaigns:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| kind | "replied" | "read_no_reply" | "delivered_not_read" | "clicked" | "not_clicked" | "tapped" | required | |
| button | string | optional |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "campaign" | required | |
| name | string | required | |
| connection_id | string | null | required | |
| status | "draft" | "scheduled" | "sending" | "paused" | "sent" | "stopped" | "failed" | required | |
| template | object | null | required | |
| template.id | string | null | required | |
| template.name | string | required | |
| template.language | string | required | |
| variable_map | object[] | required | |
| variable_map[].var | string | required | |
| variable_map[].source | string | null | required | |
| variable_map[].fallback | string | null | required | |
| cards | object[] | required | |
| cards[].media_id | string | required | |
| header | object | null | required | |
| header.type | "image" | "video" | "document" | required | |
| header.media_id | string | required | |
| header.from_template | boolean | required | |
| header.latitude | number | required | |
| header.longitude | number | required | |
| header.name | string | required | |
| header.address | string | required | |
| header.variable_map | object[] | required | |
| header.variable_map[].var | string | required | |
| header.variable_map[].source | string | null | required | |
| header.variable_map[].fallback | string | null | required | |
| buttons | object[] | required | |
| buttons[].index | integer | required | |
| buttons[].type | "url" | required | |
| buttons[].variable_map | object[] | required | |
| buttons[].variable_map[].var | string | required | |
| buttons[].variable_map[].source | string | null | required | |
| buttons[].variable_map[].fallback | string | null | required | |
| buttons[].code | string | required | |
| audience | object | required | |
| audience.tags | string[] | required | |
| audience.labels | string[] | required | |
| audience.fields | object[] | required | |
| audience.fields[].key | string | required | |
| audience.fields[].op | "is" | "is_not" | "contains" | "gt" | "lt" | "before" | "after" | "on" | … | required | |
| audience.fields[].value | string | number | boolean | null | required | |
| audience.match | "any" | "all" | required | |
| audience.everyone | boolean | required | |
| audience.smart | "engaged" | "win_back" | "at_risk" | null | required | |
| audience.segment_id | string | null | required | |
| audience.from_campaign | object | null | required | |
| audience.from_campaign.id | string | required | |
| audience.from_campaign.kind | string | required | |
| audience.from_campaign.button | string | null | optional | |
| schedule | object | null | required | |
| schedule.local_time | string | required | |
| schedule.tz | string | required | |
| schedule.starts_at_utc | string (date-time) | null | required | |
| quiet_hours | object | required | |
| quiet_hours.on | boolean | required | |
| quiet_hours.from | string | required | |
| quiet_hours.to | string | required | |
| kind | "one" | "sequence" | "ab" | required | |
| steps | object[] | required | |
| steps[].template | object | null | required | |
| steps[].template.id | string | null | required | |
| steps[].template.name | string | required | |
| steps[].template.language | string | required | |
| steps[].variable_map | object[] | required | |
| steps[].variable_map[].var | string | required | |
| steps[].variable_map[].source | string | null | required | |
| steps[].variable_map[].fallback | string | null | required | |
| steps[].cards | object[] | required | |
| steps[].cards[].media_id | string | required | |
| steps[].header | object | null | required | |
| steps[].header.type | "image" | "video" | "document" | required | |
| steps[].header.media_id | string | required | |
| steps[].header.from_template | boolean | required | |
| steps[].header.latitude | number | required | |
| steps[].header.longitude | number | required | |
| steps[].header.name | string | required | |
| steps[].header.address | string | required | |
| steps[].header.variable_map | object[] | required | |
| steps[].buttons | object[] | required | |
| steps[].buttons[].index | integer | required | |
| steps[].buttons[].type | "url" | required | |
| steps[].buttons[].variable_map | object[] | required | |
| steps[].buttons[].code | string | required | |
| steps[].wait_days | integer | required | |
| steps[].to | "no_reply" | "no_read" | "no_click" | required | |
| ab | object | null | required | |
| ab.template | object | null | required | |
| ab.template.id | string | null | required | |
| ab.template.name | string | required | |
| ab.template.language | string | required | |
| ab.variable_map | object[] | required | |
| ab.variable_map[].var | string | required | |
| ab.variable_map[].source | string | null | required | |
| ab.variable_map[].fallback | string | null | required | |
| ab.cards | object[] | required | |
| ab.cards[].media_id | string | required | |
| ab.header | object | null | required | |
| ab.header.type | "image" | "video" | "document" | required | |
| ab.header.media_id | string | required | |
| ab.header.from_template | boolean | required | |
| ab.header.latitude | number | required | |
| ab.header.longitude | number | required | |
| ab.header.name | string | required | |
| ab.header.address | string | required | |
| ab.header.variable_map | object[] | required | |
| ab.buttons | object[] | required | |
| ab.buttons[].index | integer | required | |
| ab.buttons[].type | "url" | required | |
| ab.buttons[].variable_map | object[] | required | |
| ab.buttons[].code | string | required | |
| ab.test_percent | integer | required | |
| ab.metric | "replies" | "reads" | "clicks" | required | |
| ab.test_hours | integer | required | |
| ab.auto_send | boolean | required | |
| winner | object | null | required | |
| winner.variant | "a" | "b" | required | |
| winner.by | "replies" | "reads" | "clicks" | required | |
| winner.chance | number | required | |
| winner.close | boolean | required | |
| winner.auto | boolean | required | |
| winner.at | string (date-time) | required | |
| reply_rules | object[] | required | |
| reply_rules[].when | object | required | |
| reply_rules[].when.type | "button" | required | |
| reply_rules[].when.text | string | required | |
| reply_rules[].when.words | string[] | required | |
| reply_rules[].actions | object[] | required | |
| reply_rules[].actions[].type | "assign" | required | |
| reply_rules[].actions[].user_id | string | required | |
| reply_rules[].actions[].tag | string | required | |
| reply_rules[].actions[].label | string | required | |
| reply_rules[].actions[].text | string | required | |
| reply_rules[].actions[].automation_id | string | required | |
| reply_rules[].actions[].step | integer | required | |
| let_join | boolean | required | |
| n_recipients | integer | required | |
| n_sent | integer | required | |
| n_delivered | integer | required | |
| n_read | integer | required | |
| n_replied | integer | required | |
| n_failed | integer | required | |
| n_clicked | integer | null | required | People who tapped a tracked link at least once, each counted once. null when the campaign counts no clicks. |
| track_clicks | boolean | required | |
| auto_retry | boolean | required | |
| max_per_hour | integer | null | required | |
| pause_reason | string | null | required | |
| end_reason | object | null | required | |
| end_reason.code | string | required | |
| end_reason.words | string | required | |
| end_reason.meta_message | string | null | required | |
| created_by | string | null | required | |
| stopped_by | string | null | required | |
| retarget_of | string | null | required | |
| started_at | string (date-time) | null | required | |
| finished_at | string (date-time) | null | required | |
| stopped_at | string (date-time) | null | required | |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required |
POST /v1/campaigns/{id}/retry
Send it again to those it failed for who are on WhatsApp; someone WhatsApp’s marketing limit held back (131049) is sent again only 24 hours after the failure
Scopes campaigns:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "campaign_retry" | required | |
| queued | integer | required | |
| not_retried | integer | required | |
| too_soon | integer | required |
POST /v1/campaigns/{id}/schedule
Schedule a draft for its time
Scopes campaigns:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | required |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| estimate_id | string | required | |
| confirm_text | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "campaign" | required | |
| name | string | required | |
| connection_id | string | null | required | |
| status | "draft" | "scheduled" | "sending" | "paused" | "sent" | "stopped" | "failed" | required | |
| template | object | null | required | |
| template.id | string | null | required | |
| template.name | string | required | |
| template.language | string | required | |
| variable_map | object[] | required | |
| variable_map[].var | string | required | |
| variable_map[].source | string | null | required | |
| variable_map[].fallback | string | null | required | |
| cards | object[] | required | |
| cards[].media_id | string | required | |
| header | object | null | required | |
| header.type | "image" | "video" | "document" | required | |
| header.media_id | string | required | |
| header.from_template | boolean | required | |
| header.latitude | number | required | |
| header.longitude | number | required | |
| header.name | string | required | |
| header.address | string | required | |
| header.variable_map | object[] | required | |
| header.variable_map[].var | string | required | |
| header.variable_map[].source | string | null | required | |
| header.variable_map[].fallback | string | null | required | |
| buttons | object[] | required | |
| buttons[].index | integer | required | |
| buttons[].type | "url" | required | |
| buttons[].variable_map | object[] | required | |
| buttons[].variable_map[].var | string | required | |
| buttons[].variable_map[].source | string | null | required | |
| buttons[].variable_map[].fallback | string | null | required | |
| buttons[].code | string | required | |
| audience | object | required | |
| audience.tags | string[] | required | |
| audience.labels | string[] | required | |
| audience.fields | object[] | required | |
| audience.fields[].key | string | required | |
| audience.fields[].op | "is" | "is_not" | "contains" | "gt" | "lt" | "before" | "after" | "on" | … | required | |
| audience.fields[].value | string | number | boolean | null | required | |
| audience.match | "any" | "all" | required | |
| audience.everyone | boolean | required | |
| audience.smart | "engaged" | "win_back" | "at_risk" | null | required | |
| audience.segment_id | string | null | required | |
| audience.from_campaign | object | null | required | |
| audience.from_campaign.id | string | required | |
| audience.from_campaign.kind | string | required | |
| audience.from_campaign.button | string | null | optional | |
| schedule | object | null | required | |
| schedule.local_time | string | required | |
| schedule.tz | string | required | |
| schedule.starts_at_utc | string (date-time) | null | required | |
| quiet_hours | object | required | |
| quiet_hours.on | boolean | required | |
| quiet_hours.from | string | required | |
| quiet_hours.to | string | required | |
| kind | "one" | "sequence" | "ab" | required | |
| steps | object[] | required | |
| steps[].template | object | null | required | |
| steps[].template.id | string | null | required | |
| steps[].template.name | string | required | |
| steps[].template.language | string | required | |
| steps[].variable_map | object[] | required | |
| steps[].variable_map[].var | string | required | |
| steps[].variable_map[].source | string | null | required | |
| steps[].variable_map[].fallback | string | null | required | |
| steps[].cards | object[] | required | |
| steps[].cards[].media_id | string | required | |
| steps[].header | object | null | required | |
| steps[].header.type | "image" | "video" | "document" | required | |
| steps[].header.media_id | string | required | |
| steps[].header.from_template | boolean | required | |
| steps[].header.latitude | number | required | |
| steps[].header.longitude | number | required | |
| steps[].header.name | string | required | |
| steps[].header.address | string | required | |
| steps[].header.variable_map | object[] | required | |
| steps[].buttons | object[] | required | |
| steps[].buttons[].index | integer | required | |
| steps[].buttons[].type | "url" | required | |
| steps[].buttons[].variable_map | object[] | required | |
| steps[].buttons[].code | string | required | |
| steps[].wait_days | integer | required | |
| steps[].to | "no_reply" | "no_read" | "no_click" | required | |
| ab | object | null | required | |
| ab.template | object | null | required | |
| ab.template.id | string | null | required | |
| ab.template.name | string | required | |
| ab.template.language | string | required | |
| ab.variable_map | object[] | required | |
| ab.variable_map[].var | string | required | |
| ab.variable_map[].source | string | null | required | |
| ab.variable_map[].fallback | string | null | required | |
| ab.cards | object[] | required | |
| ab.cards[].media_id | string | required | |
| ab.header | object | null | required | |
| ab.header.type | "image" | "video" | "document" | required | |
| ab.header.media_id | string | required | |
| ab.header.from_template | boolean | required | |
| ab.header.latitude | number | required | |
| ab.header.longitude | number | required | |
| ab.header.name | string | required | |
| ab.header.address | string | required | |
| ab.header.variable_map | object[] | required | |
| ab.buttons | object[] | required | |
| ab.buttons[].index | integer | required | |
| ab.buttons[].type | "url" | required | |
| ab.buttons[].variable_map | object[] | required | |
| ab.buttons[].code | string | required | |
| ab.test_percent | integer | required | |
| ab.metric | "replies" | "reads" | "clicks" | required | |
| ab.test_hours | integer | required | |
| ab.auto_send | boolean | required | |
| winner | object | null | required | |
| winner.variant | "a" | "b" | required | |
| winner.by | "replies" | "reads" | "clicks" | required | |
| winner.chance | number | required | |
| winner.close | boolean | required | |
| winner.auto | boolean | required | |
| winner.at | string (date-time) | required | |
| reply_rules | object[] | required | |
| reply_rules[].when | object | required | |
| reply_rules[].when.type | "button" | required | |
| reply_rules[].when.text | string | required | |
| reply_rules[].when.words | string[] | required | |
| reply_rules[].actions | object[] | required | |
| reply_rules[].actions[].type | "assign" | required | |
| reply_rules[].actions[].user_id | string | required | |
| reply_rules[].actions[].tag | string | required | |
| reply_rules[].actions[].label | string | required | |
| reply_rules[].actions[].text | string | required | |
| reply_rules[].actions[].automation_id | string | required | |
| reply_rules[].actions[].step | integer | required | |
| let_join | boolean | required | |
| n_recipients | integer | required | |
| n_sent | integer | required | |
| n_delivered | integer | required | |
| n_read | integer | required | |
| n_replied | integer | required | |
| n_failed | integer | required | |
| n_clicked | integer | null | required | People who tapped a tracked link at least once, each counted once. null when the campaign counts no clicks. |
| track_clicks | boolean | required | |
| auto_retry | boolean | required | |
| max_per_hour | integer | null | required | |
| pause_reason | string | null | required | |
| end_reason | object | null | required | |
| end_reason.code | string | required | |
| end_reason.words | string | required | |
| end_reason.meta_message | string | null | required | |
| created_by | string | null | required | |
| stopped_by | string | null | required | |
| retarget_of | string | null | required | |
| started_at | string (date-time) | null | required | |
| finished_at | string (date-time) | null | required | |
| stopped_at | string (date-time) | null | required | |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required | |
| first_use | boolean | required |
POST /v1/campaigns/{id}/send
Send a draft now, to the people the estimate counted
Scopes campaigns:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | required |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| estimate_id | string | required | |
| confirm_text | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "campaign" | required | |
| name | string | required | |
| connection_id | string | null | required | |
| status | "draft" | "scheduled" | "sending" | "paused" | "sent" | "stopped" | "failed" | required | |
| template | object | null | required | |
| template.id | string | null | required | |
| template.name | string | required | |
| template.language | string | required | |
| variable_map | object[] | required | |
| variable_map[].var | string | required | |
| variable_map[].source | string | null | required | |
| variable_map[].fallback | string | null | required | |
| cards | object[] | required | |
| cards[].media_id | string | required | |
| header | object | null | required | |
| header.type | "image" | "video" | "document" | required | |
| header.media_id | string | required | |
| header.from_template | boolean | required | |
| header.latitude | number | required | |
| header.longitude | number | required | |
| header.name | string | required | |
| header.address | string | required | |
| header.variable_map | object[] | required | |
| header.variable_map[].var | string | required | |
| header.variable_map[].source | string | null | required | |
| header.variable_map[].fallback | string | null | required | |
| buttons | object[] | required | |
| buttons[].index | integer | required | |
| buttons[].type | "url" | required | |
| buttons[].variable_map | object[] | required | |
| buttons[].variable_map[].var | string | required | |
| buttons[].variable_map[].source | string | null | required | |
| buttons[].variable_map[].fallback | string | null | required | |
| buttons[].code | string | required | |
| audience | object | required | |
| audience.tags | string[] | required | |
| audience.labels | string[] | required | |
| audience.fields | object[] | required | |
| audience.fields[].key | string | required | |
| audience.fields[].op | "is" | "is_not" | "contains" | "gt" | "lt" | "before" | "after" | "on" | … | required | |
| audience.fields[].value | string | number | boolean | null | required | |
| audience.match | "any" | "all" | required | |
| audience.everyone | boolean | required | |
| audience.smart | "engaged" | "win_back" | "at_risk" | null | required | |
| audience.segment_id | string | null | required | |
| audience.from_campaign | object | null | required | |
| audience.from_campaign.id | string | required | |
| audience.from_campaign.kind | string | required | |
| audience.from_campaign.button | string | null | optional | |
| schedule | object | null | required | |
| schedule.local_time | string | required | |
| schedule.tz | string | required | |
| schedule.starts_at_utc | string (date-time) | null | required | |
| quiet_hours | object | required | |
| quiet_hours.on | boolean | required | |
| quiet_hours.from | string | required | |
| quiet_hours.to | string | required | |
| kind | "one" | "sequence" | "ab" | required | |
| steps | object[] | required | |
| steps[].template | object | null | required | |
| steps[].template.id | string | null | required | |
| steps[].template.name | string | required | |
| steps[].template.language | string | required | |
| steps[].variable_map | object[] | required | |
| steps[].variable_map[].var | string | required | |
| steps[].variable_map[].source | string | null | required | |
| steps[].variable_map[].fallback | string | null | required | |
| steps[].cards | object[] | required | |
| steps[].cards[].media_id | string | required | |
| steps[].header | object | null | required | |
| steps[].header.type | "image" | "video" | "document" | required | |
| steps[].header.media_id | string | required | |
| steps[].header.from_template | boolean | required | |
| steps[].header.latitude | number | required | |
| steps[].header.longitude | number | required | |
| steps[].header.name | string | required | |
| steps[].header.address | string | required | |
| steps[].header.variable_map | object[] | required | |
| steps[].buttons | object[] | required | |
| steps[].buttons[].index | integer | required | |
| steps[].buttons[].type | "url" | required | |
| steps[].buttons[].variable_map | object[] | required | |
| steps[].buttons[].code | string | required | |
| steps[].wait_days | integer | required | |
| steps[].to | "no_reply" | "no_read" | "no_click" | required | |
| ab | object | null | required | |
| ab.template | object | null | required | |
| ab.template.id | string | null | required | |
| ab.template.name | string | required | |
| ab.template.language | string | required | |
| ab.variable_map | object[] | required | |
| ab.variable_map[].var | string | required | |
| ab.variable_map[].source | string | null | required | |
| ab.variable_map[].fallback | string | null | required | |
| ab.cards | object[] | required | |
| ab.cards[].media_id | string | required | |
| ab.header | object | null | required | |
| ab.header.type | "image" | "video" | "document" | required | |
| ab.header.media_id | string | required | |
| ab.header.from_template | boolean | required | |
| ab.header.latitude | number | required | |
| ab.header.longitude | number | required | |
| ab.header.name | string | required | |
| ab.header.address | string | required | |
| ab.header.variable_map | object[] | required | |
| ab.buttons | object[] | required | |
| ab.buttons[].index | integer | required | |
| ab.buttons[].type | "url" | required | |
| ab.buttons[].variable_map | object[] | required | |
| ab.buttons[].code | string | required | |
| ab.test_percent | integer | required | |
| ab.metric | "replies" | "reads" | "clicks" | required | |
| ab.test_hours | integer | required | |
| ab.auto_send | boolean | required | |
| winner | object | null | required | |
| winner.variant | "a" | "b" | required | |
| winner.by | "replies" | "reads" | "clicks" | required | |
| winner.chance | number | required | |
| winner.close | boolean | required | |
| winner.auto | boolean | required | |
| winner.at | string (date-time) | required | |
| reply_rules | object[] | required | |
| reply_rules[].when | object | required | |
| reply_rules[].when.type | "button" | required | |
| reply_rules[].when.text | string | required | |
| reply_rules[].when.words | string[] | required | |
| reply_rules[].actions | object[] | required | |
| reply_rules[].actions[].type | "assign" | required | |
| reply_rules[].actions[].user_id | string | required | |
| reply_rules[].actions[].tag | string | required | |
| reply_rules[].actions[].label | string | required | |
| reply_rules[].actions[].text | string | required | |
| reply_rules[].actions[].automation_id | string | required | |
| reply_rules[].actions[].step | integer | required | |
| let_join | boolean | required | |
| n_recipients | integer | required | |
| n_sent | integer | required | |
| n_delivered | integer | required | |
| n_read | integer | required | |
| n_replied | integer | required | |
| n_failed | integer | required | |
| n_clicked | integer | null | required | People who tapped a tracked link at least once, each counted once. null when the campaign counts no clicks. |
| track_clicks | boolean | required | |
| auto_retry | boolean | required | |
| max_per_hour | integer | null | required | |
| pause_reason | string | null | required | |
| end_reason | object | null | required | |
| end_reason.code | string | required | |
| end_reason.words | string | required | |
| end_reason.meta_message | string | null | required | |
| created_by | string | null | required | |
| stopped_by | string | null | required | |
| retarget_of | string | null | required | |
| started_at | string (date-time) | null | required | |
| finished_at | string (date-time) | null | required | |
| stopped_at | string (date-time) | null | required | |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required | |
| first_use | boolean | required |
POST /v1/campaigns/{id}/send-time
One AI conversation: a time in the next two weeks to send this campaign, and why
Scopes campaigns:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "send_time" | required | |
| local_time | string | required | |
| tz | string | required | |
| why | string | required |
GET /v1/campaigns/{id}/stats
Sent, delivered, read and replied; failures in groups; sends per 10 minutes; what is left by day
Scopes campaigns:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "campaign_stats" | required | |
| id | string | required | |
| status | string | required | |
| counters | object | required | |
| counters.recipients | integer | required | |
| counters.sent | integer | required | |
| counters.delivered | integer | required | |
| counters.read | integer | required | |
| counters.replied | integer | required | |
| counters.failed | integer | required | |
| counters.skipped | integer | required | |
| counters.pending | integer | required | |
| automation_runs | object | required | |
| automation_runs.used | integer | required | |
| automation_runs.by | object[] | required | |
| automation_runs.by[].kind | "step" | "winner" | "reply" | required | |
| automation_runs.by[].step | integer | null | required | |
| automation_runs.by[].n | integer | required | |
| automation_runs.next | object | null | required | |
| automation_runs.next.kind | "step" | "winner" | required | |
| automation_runs.next.step | integer | null | required | |
| automation_runs.next.up_to | integer | required | |
| reply_actions | object | required | |
| reply_actions.rules | object[] | required | |
| reply_actions.rules[].rule | integer | required | |
| reply_actions.rules[].n | integer | required | |
| reply_actions.opted_out | integer | required | |
| reply_actions.latest | object[] | required | |
| reply_actions.latest[].contact_id | string | required | |
| reply_actions.latest[].name | string | null | required | |
| reply_actions.latest[].rule | integer | required | |
| reply_actions.latest[].message_id | string | null | required | |
| reply_actions.latest[].at | string (date-time) | required | |
| sequence | object | null | required | |
| sequence.people | integer | required | |
| sequence.joined | integer | required | |
| sequence.replied | integer | required | |
| sequence.in_sequence | integer | required | |
| sequence.failed | integer | required | |
| sequence.finished | integer | required | |
| sequence.steps | object[] | required | |
| sequence.steps[].step | integer | required | |
| sequence.steps[].template | object | null | required | |
| sequence.steps[].wait_days | integer | null | required | |
| sequence.steps[].to | "no_reply" | "no_read" | "no_click" | null | required | |
| sequence.steps[].state | "sent" | "sending" | "waiting" | required | |
| sequence.steps[].first_sent_at | string (date-time) | null | required | |
| sequence.steps[].due_at | string (date-time) | null | required | |
| sequence.steps[].people | integer | required | |
| sequence.steps[].sent | integer | required | |
| sequence.steps[].delivered | integer | required | |
| sequence.steps[].read | integer | required | |
| sequence.steps[].replied | integer | required | |
| sequence.steps[].failed | integer | required | |
| sequence.steps[].clicked | integer | null | required | |
| sequence.steps[].stopped | integer | required | |
| sequence.steps[].went_on | integer | required | |
| ab | object | null | required | |
| ab.phase | "testing" | "pick_winner" | "sending_winner" | "done" | required | |
| ab.test_ends_at | string (date-time) | null | required | |
| ab.metric | "replies" | "reads" | "clicks" | required | |
| ab.variants | object[] | required | |
| ab.variants[].variant | "a" | "b" | required | |
| ab.variants[].template | object | null | required | |
| ab.variants[].people | integer | required | |
| ab.variants[].sent | integer | required | |
| ab.variants[].delivered | integer | required | |
| ab.variants[].read | integer | required | |
| ab.variants[].replied | integer | required | |
| ab.variants[].failed | integer | required | |
| ab.variants[].clicked | integer | null | required | |
| ab.chance_b_better | number | null | required | |
| ab.chance_b_better_by | object | required | |
| ab.chance_b_better_by.replies | number | null | required | |
| ab.chance_b_better_by.reads | number | null | required | |
| ab.chance_b_better_by.clicks | number | null | required | |
| ab.winner | object | null | required | |
| ab.winner.variant | "a" | "b" | required | |
| ab.winner.by | "replies" | "reads" | "clicks" | required | |
| ab.winner.chance | number | required | |
| ab.winner.close | boolean | required | |
| ab.winner.auto | boolean | required | |
| ab.winner.at | string (date-time) | required | |
| ab.rest | object | required | |
| ab.rest.people | integer | required | |
| ab.rest.waiting | integer | required | |
| ab.rest.sent | integer | required | |
| ab.rest.delivered | integer | required | |
| ab.rest.read | integer | required | |
| ab.rest.replied | integer | required | |
| ab.rest.failed | integer | required | |
| ab.rest.clicked | integer | null | required | |
| failure_groups | object[] | required | |
| failure_groups[].group | "not_on_whatsapp" | "held_back" | "other" | required | |
| failure_groups[].code | integer | null | required | |
| failure_groups[].n | integer | required | |
| failure_groups[].retryable | boolean | required | |
| failure_groups[].retry_after | string (date-time) | null | required | |
| left_out | object | required | |
| end_reason | object | null | required | |
| end_reason.code | string | required | |
| end_reason.words | string | required | |
| end_reason.meta_message | string | null | required | |
| held_until | string (date-time) | null | required | |
| release_plan | object[] | required | |
| release_plan[].date | string | required | |
| release_plan[].n | integer | required | |
| timeline | object[] | required | |
| timeline[].at | string (date-time) | required | |
| timeline[].sent | integer | required | |
| final | boolean | required | |
| clicks | object | required | |
| clicks.tracked | boolean | required | |
| clicks.people | integer | required | People who tapped a tracked link at least once, each counted once. |
| clicks.clicks | integer | required | Every tap on its tracked links: a person who taps twice counts twice. A HEAD request (a link checker) is not a tap. |
| clicks.median_minutes_after_read | integer | null | required | |
| clicks.per_hour | integer[] | required | |
| clicks.links | object[] | required | |
| clicks.links[].index | integer | required | |
| clicks.links[].text | string | required | |
| clicks.links[].url | string | required | |
| clicks.links[].people | integer | required | |
| clicks.links[].clicks | integer | required | |
| follow_up | object | required | |
| follow_up.replied | integer | required | |
| follow_up.read_no_reply | integer | required | |
| follow_up.delivered_not_read | integer | required | |
| follow_up.clicked | integer | null | required | |
| follow_up.not_clicked | integer | null | required | |
| follow_up.buttons | object[] | required | |
| follow_up.buttons[].text | string | required | |
| follow_up.buttons[].people | integer | required | |
| opted_out | integer | required |
POST /v1/campaigns/{id}/stop
Stop a campaign: nothing more goes out
Scopes campaigns:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "campaign" | required | |
| name | string | required | |
| connection_id | string | null | required | |
| status | "draft" | "scheduled" | "sending" | "paused" | "sent" | "stopped" | "failed" | required | |
| template | object | null | required | |
| template.id | string | null | required | |
| template.name | string | required | |
| template.language | string | required | |
| variable_map | object[] | required | |
| variable_map[].var | string | required | |
| variable_map[].source | string | null | required | |
| variable_map[].fallback | string | null | required | |
| cards | object[] | required | |
| cards[].media_id | string | required | |
| header | object | null | required | |
| header.type | "image" | "video" | "document" | required | |
| header.media_id | string | required | |
| header.from_template | boolean | required | |
| header.latitude | number | required | |
| header.longitude | number | required | |
| header.name | string | required | |
| header.address | string | required | |
| header.variable_map | object[] | required | |
| header.variable_map[].var | string | required | |
| header.variable_map[].source | string | null | required | |
| header.variable_map[].fallback | string | null | required | |
| buttons | object[] | required | |
| buttons[].index | integer | required | |
| buttons[].type | "url" | required | |
| buttons[].variable_map | object[] | required | |
| buttons[].variable_map[].var | string | required | |
| buttons[].variable_map[].source | string | null | required | |
| buttons[].variable_map[].fallback | string | null | required | |
| buttons[].code | string | required | |
| audience | object | required | |
| audience.tags | string[] | required | |
| audience.labels | string[] | required | |
| audience.fields | object[] | required | |
| audience.fields[].key | string | required | |
| audience.fields[].op | "is" | "is_not" | "contains" | "gt" | "lt" | "before" | "after" | "on" | … | required | |
| audience.fields[].value | string | number | boolean | null | required | |
| audience.match | "any" | "all" | required | |
| audience.everyone | boolean | required | |
| audience.smart | "engaged" | "win_back" | "at_risk" | null | required | |
| audience.segment_id | string | null | required | |
| audience.from_campaign | object | null | required | |
| audience.from_campaign.id | string | required | |
| audience.from_campaign.kind | string | required | |
| audience.from_campaign.button | string | null | optional | |
| schedule | object | null | required | |
| schedule.local_time | string | required | |
| schedule.tz | string | required | |
| schedule.starts_at_utc | string (date-time) | null | required | |
| quiet_hours | object | required | |
| quiet_hours.on | boolean | required | |
| quiet_hours.from | string | required | |
| quiet_hours.to | string | required | |
| kind | "one" | "sequence" | "ab" | required | |
| steps | object[] | required | |
| steps[].template | object | null | required | |
| steps[].template.id | string | null | required | |
| steps[].template.name | string | required | |
| steps[].template.language | string | required | |
| steps[].variable_map | object[] | required | |
| steps[].variable_map[].var | string | required | |
| steps[].variable_map[].source | string | null | required | |
| steps[].variable_map[].fallback | string | null | required | |
| steps[].cards | object[] | required | |
| steps[].cards[].media_id | string | required | |
| steps[].header | object | null | required | |
| steps[].header.type | "image" | "video" | "document" | required | |
| steps[].header.media_id | string | required | |
| steps[].header.from_template | boolean | required | |
| steps[].header.latitude | number | required | |
| steps[].header.longitude | number | required | |
| steps[].header.name | string | required | |
| steps[].header.address | string | required | |
| steps[].header.variable_map | object[] | required | |
| steps[].buttons | object[] | required | |
| steps[].buttons[].index | integer | required | |
| steps[].buttons[].type | "url" | required | |
| steps[].buttons[].variable_map | object[] | required | |
| steps[].buttons[].code | string | required | |
| steps[].wait_days | integer | required | |
| steps[].to | "no_reply" | "no_read" | "no_click" | required | |
| ab | object | null | required | |
| ab.template | object | null | required | |
| ab.template.id | string | null | required | |
| ab.template.name | string | required | |
| ab.template.language | string | required | |
| ab.variable_map | object[] | required | |
| ab.variable_map[].var | string | required | |
| ab.variable_map[].source | string | null | required | |
| ab.variable_map[].fallback | string | null | required | |
| ab.cards | object[] | required | |
| ab.cards[].media_id | string | required | |
| ab.header | object | null | required | |
| ab.header.type | "image" | "video" | "document" | required | |
| ab.header.media_id | string | required | |
| ab.header.from_template | boolean | required | |
| ab.header.latitude | number | required | |
| ab.header.longitude | number | required | |
| ab.header.name | string | required | |
| ab.header.address | string | required | |
| ab.header.variable_map | object[] | required | |
| ab.buttons | object[] | required | |
| ab.buttons[].index | integer | required | |
| ab.buttons[].type | "url" | required | |
| ab.buttons[].variable_map | object[] | required | |
| ab.buttons[].code | string | required | |
| ab.test_percent | integer | required | |
| ab.metric | "replies" | "reads" | "clicks" | required | |
| ab.test_hours | integer | required | |
| ab.auto_send | boolean | required | |
| winner | object | null | required | |
| winner.variant | "a" | "b" | required | |
| winner.by | "replies" | "reads" | "clicks" | required | |
| winner.chance | number | required | |
| winner.close | boolean | required | |
| winner.auto | boolean | required | |
| winner.at | string (date-time) | required | |
| reply_rules | object[] | required | |
| reply_rules[].when | object | required | |
| reply_rules[].when.type | "button" | required | |
| reply_rules[].when.text | string | required | |
| reply_rules[].when.words | string[] | required | |
| reply_rules[].actions | object[] | required | |
| reply_rules[].actions[].type | "assign" | required | |
| reply_rules[].actions[].user_id | string | required | |
| reply_rules[].actions[].tag | string | required | |
| reply_rules[].actions[].label | string | required | |
| reply_rules[].actions[].text | string | required | |
| reply_rules[].actions[].automation_id | string | required | |
| reply_rules[].actions[].step | integer | required | |
| let_join | boolean | required | |
| n_recipients | integer | required | |
| n_sent | integer | required | |
| n_delivered | integer | required | |
| n_read | integer | required | |
| n_replied | integer | required | |
| n_failed | integer | required | |
| n_clicked | integer | null | required | People who tapped a tracked link at least once, each counted once. null when the campaign counts no clicks. |
| track_clicks | boolean | required | |
| auto_retry | boolean | required | |
| max_per_hour | integer | null | required | |
| pause_reason | string | null | required | |
| end_reason | object | null | required | |
| end_reason.code | string | required | |
| end_reason.words | string | required | |
| end_reason.meta_message | string | null | required | |
| created_by | string | null | required | |
| stopped_by | string | null | required | |
| retarget_of | string | null | required | |
| started_at | string (date-time) | null | required | |
| finished_at | string (date-time) | null | required | |
| stopped_at | string (date-time) | null | required | |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required |
POST /v1/campaigns/{id}/test
Send the campaign’s template once to your own WhatsApp number, with your own blanks. It is not counted in the results
Scopes campaigns:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| to | string | required |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "campaign_test" | required | |
| notification_id | string | required | |
| to | string | required |
POST /v1/campaigns/{id}/unschedule
Put a scheduled campaign back to a draft
Scopes campaigns:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "campaign" | required | |
| name | string | required | |
| connection_id | string | null | required | |
| status | "draft" | "scheduled" | "sending" | "paused" | "sent" | "stopped" | "failed" | required | |
| template | object | null | required | |
| template.id | string | null | required | |
| template.name | string | required | |
| template.language | string | required | |
| variable_map | object[] | required | |
| variable_map[].var | string | required | |
| variable_map[].source | string | null | required | |
| variable_map[].fallback | string | null | required | |
| cards | object[] | required | |
| cards[].media_id | string | required | |
| header | object | null | required | |
| header.type | "image" | "video" | "document" | required | |
| header.media_id | string | required | |
| header.from_template | boolean | required | |
| header.latitude | number | required | |
| header.longitude | number | required | |
| header.name | string | required | |
| header.address | string | required | |
| header.variable_map | object[] | required | |
| header.variable_map[].var | string | required | |
| header.variable_map[].source | string | null | required | |
| header.variable_map[].fallback | string | null | required | |
| buttons | object[] | required | |
| buttons[].index | integer | required | |
| buttons[].type | "url" | required | |
| buttons[].variable_map | object[] | required | |
| buttons[].variable_map[].var | string | required | |
| buttons[].variable_map[].source | string | null | required | |
| buttons[].variable_map[].fallback | string | null | required | |
| buttons[].code | string | required | |
| audience | object | required | |
| audience.tags | string[] | required | |
| audience.labels | string[] | required | |
| audience.fields | object[] | required | |
| audience.fields[].key | string | required | |
| audience.fields[].op | "is" | "is_not" | "contains" | "gt" | "lt" | "before" | "after" | "on" | … | required | |
| audience.fields[].value | string | number | boolean | null | required | |
| audience.match | "any" | "all" | required | |
| audience.everyone | boolean | required | |
| audience.smart | "engaged" | "win_back" | "at_risk" | null | required | |
| audience.segment_id | string | null | required | |
| audience.from_campaign | object | null | required | |
| audience.from_campaign.id | string | required | |
| audience.from_campaign.kind | string | required | |
| audience.from_campaign.button | string | null | optional | |
| schedule | object | null | required | |
| schedule.local_time | string | required | |
| schedule.tz | string | required | |
| schedule.starts_at_utc | string (date-time) | null | required | |
| quiet_hours | object | required | |
| quiet_hours.on | boolean | required | |
| quiet_hours.from | string | required | |
| quiet_hours.to | string | required | |
| kind | "one" | "sequence" | "ab" | required | |
| steps | object[] | required | |
| steps[].template | object | null | required | |
| steps[].template.id | string | null | required | |
| steps[].template.name | string | required | |
| steps[].template.language | string | required | |
| steps[].variable_map | object[] | required | |
| steps[].variable_map[].var | string | required | |
| steps[].variable_map[].source | string | null | required | |
| steps[].variable_map[].fallback | string | null | required | |
| steps[].cards | object[] | required | |
| steps[].cards[].media_id | string | required | |
| steps[].header | object | null | required | |
| steps[].header.type | "image" | "video" | "document" | required | |
| steps[].header.media_id | string | required | |
| steps[].header.from_template | boolean | required | |
| steps[].header.latitude | number | required | |
| steps[].header.longitude | number | required | |
| steps[].header.name | string | required | |
| steps[].header.address | string | required | |
| steps[].header.variable_map | object[] | required | |
| steps[].buttons | object[] | required | |
| steps[].buttons[].index | integer | required | |
| steps[].buttons[].type | "url" | required | |
| steps[].buttons[].variable_map | object[] | required | |
| steps[].buttons[].code | string | required | |
| steps[].wait_days | integer | required | |
| steps[].to | "no_reply" | "no_read" | "no_click" | required | |
| ab | object | null | required | |
| ab.template | object | null | required | |
| ab.template.id | string | null | required | |
| ab.template.name | string | required | |
| ab.template.language | string | required | |
| ab.variable_map | object[] | required | |
| ab.variable_map[].var | string | required | |
| ab.variable_map[].source | string | null | required | |
| ab.variable_map[].fallback | string | null | required | |
| ab.cards | object[] | required | |
| ab.cards[].media_id | string | required | |
| ab.header | object | null | required | |
| ab.header.type | "image" | "video" | "document" | required | |
| ab.header.media_id | string | required | |
| ab.header.from_template | boolean | required | |
| ab.header.latitude | number | required | |
| ab.header.longitude | number | required | |
| ab.header.name | string | required | |
| ab.header.address | string | required | |
| ab.header.variable_map | object[] | required | |
| ab.buttons | object[] | required | |
| ab.buttons[].index | integer | required | |
| ab.buttons[].type | "url" | required | |
| ab.buttons[].variable_map | object[] | required | |
| ab.buttons[].code | string | required | |
| ab.test_percent | integer | required | |
| ab.metric | "replies" | "reads" | "clicks" | required | |
| ab.test_hours | integer | required | |
| ab.auto_send | boolean | required | |
| winner | object | null | required | |
| winner.variant | "a" | "b" | required | |
| winner.by | "replies" | "reads" | "clicks" | required | |
| winner.chance | number | required | |
| winner.close | boolean | required | |
| winner.auto | boolean | required | |
| winner.at | string (date-time) | required | |
| reply_rules | object[] | required | |
| reply_rules[].when | object | required | |
| reply_rules[].when.type | "button" | required | |
| reply_rules[].when.text | string | required | |
| reply_rules[].when.words | string[] | required | |
| reply_rules[].actions | object[] | required | |
| reply_rules[].actions[].type | "assign" | required | |
| reply_rules[].actions[].user_id | string | required | |
| reply_rules[].actions[].tag | string | required | |
| reply_rules[].actions[].label | string | required | |
| reply_rules[].actions[].text | string | required | |
| reply_rules[].actions[].automation_id | string | required | |
| reply_rules[].actions[].step | integer | required | |
| let_join | boolean | required | |
| n_recipients | integer | required | |
| n_sent | integer | required | |
| n_delivered | integer | required | |
| n_read | integer | required | |
| n_replied | integer | required | |
| n_failed | integer | required | |
| n_clicked | integer | null | required | People who tapped a tracked link at least once, each counted once. null when the campaign counts no clicks. |
| track_clicks | boolean | required | |
| auto_retry | boolean | required | |
| max_per_hour | integer | null | required | |
| pause_reason | string | null | required | |
| end_reason | object | null | required | |
| end_reason.code | string | required | |
| end_reason.words | string | required | |
| end_reason.meta_message | string | null | required | |
| created_by | string | null | required | |
| stopped_by | string | null | required | |
| retarget_of | string | null | required | |
| started_at | string (date-time) | null | required | |
| finished_at | string (date-time) | null | required | |
| stopped_at | string (date-time) | null | required | |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required |
POST /v1/campaigns/{id}/winner
Pick the winner of an A/B test once its test ends, and send it to everyone else
Scopes campaigns:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| variant | "a" | "b" | required |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "campaign" | required | |
| name | string | required | |
| connection_id | string | null | required | |
| status | "draft" | "scheduled" | "sending" | "paused" | "sent" | "stopped" | "failed" | required | |
| template | object | null | required | |
| template.id | string | null | required | |
| template.name | string | required | |
| template.language | string | required | |
| variable_map | object[] | required | |
| variable_map[].var | string | required | |
| variable_map[].source | string | null | required | |
| variable_map[].fallback | string | null | required | |
| cards | object[] | required | |
| cards[].media_id | string | required | |
| header | object | null | required | |
| header.type | "image" | "video" | "document" | required | |
| header.media_id | string | required | |
| header.from_template | boolean | required | |
| header.latitude | number | required | |
| header.longitude | number | required | |
| header.name | string | required | |
| header.address | string | required | |
| header.variable_map | object[] | required | |
| header.variable_map[].var | string | required | |
| header.variable_map[].source | string | null | required | |
| header.variable_map[].fallback | string | null | required | |
| buttons | object[] | required | |
| buttons[].index | integer | required | |
| buttons[].type | "url" | required | |
| buttons[].variable_map | object[] | required | |
| buttons[].variable_map[].var | string | required | |
| buttons[].variable_map[].source | string | null | required | |
| buttons[].variable_map[].fallback | string | null | required | |
| buttons[].code | string | required | |
| audience | object | required | |
| audience.tags | string[] | required | |
| audience.labels | string[] | required | |
| audience.fields | object[] | required | |
| audience.fields[].key | string | required | |
| audience.fields[].op | "is" | "is_not" | "contains" | "gt" | "lt" | "before" | "after" | "on" | … | required | |
| audience.fields[].value | string | number | boolean | null | required | |
| audience.match | "any" | "all" | required | |
| audience.everyone | boolean | required | |
| audience.smart | "engaged" | "win_back" | "at_risk" | null | required | |
| audience.segment_id | string | null | required | |
| audience.from_campaign | object | null | required | |
| audience.from_campaign.id | string | required | |
| audience.from_campaign.kind | string | required | |
| audience.from_campaign.button | string | null | optional | |
| schedule | object | null | required | |
| schedule.local_time | string | required | |
| schedule.tz | string | required | |
| schedule.starts_at_utc | string (date-time) | null | required | |
| quiet_hours | object | required | |
| quiet_hours.on | boolean | required | |
| quiet_hours.from | string | required | |
| quiet_hours.to | string | required | |
| kind | "one" | "sequence" | "ab" | required | |
| steps | object[] | required | |
| steps[].template | object | null | required | |
| steps[].template.id | string | null | required | |
| steps[].template.name | string | required | |
| steps[].template.language | string | required | |
| steps[].variable_map | object[] | required | |
| steps[].variable_map[].var | string | required | |
| steps[].variable_map[].source | string | null | required | |
| steps[].variable_map[].fallback | string | null | required | |
| steps[].cards | object[] | required | |
| steps[].cards[].media_id | string | required | |
| steps[].header | object | null | required | |
| steps[].header.type | "image" | "video" | "document" | required | |
| steps[].header.media_id | string | required | |
| steps[].header.from_template | boolean | required | |
| steps[].header.latitude | number | required | |
| steps[].header.longitude | number | required | |
| steps[].header.name | string | required | |
| steps[].header.address | string | required | |
| steps[].header.variable_map | object[] | required | |
| steps[].buttons | object[] | required | |
| steps[].buttons[].index | integer | required | |
| steps[].buttons[].type | "url" | required | |
| steps[].buttons[].variable_map | object[] | required | |
| steps[].buttons[].code | string | required | |
| steps[].wait_days | integer | required | |
| steps[].to | "no_reply" | "no_read" | "no_click" | required | |
| ab | object | null | required | |
| ab.template | object | null | required | |
| ab.template.id | string | null | required | |
| ab.template.name | string | required | |
| ab.template.language | string | required | |
| ab.variable_map | object[] | required | |
| ab.variable_map[].var | string | required | |
| ab.variable_map[].source | string | null | required | |
| ab.variable_map[].fallback | string | null | required | |
| ab.cards | object[] | required | |
| ab.cards[].media_id | string | required | |
| ab.header | object | null | required | |
| ab.header.type | "image" | "video" | "document" | required | |
| ab.header.media_id | string | required | |
| ab.header.from_template | boolean | required | |
| ab.header.latitude | number | required | |
| ab.header.longitude | number | required | |
| ab.header.name | string | required | |
| ab.header.address | string | required | |
| ab.header.variable_map | object[] | required | |
| ab.buttons | object[] | required | |
| ab.buttons[].index | integer | required | |
| ab.buttons[].type | "url" | required | |
| ab.buttons[].variable_map | object[] | required | |
| ab.buttons[].code | string | required | |
| ab.test_percent | integer | required | |
| ab.metric | "replies" | "reads" | "clicks" | required | |
| ab.test_hours | integer | required | |
| ab.auto_send | boolean | required | |
| winner | object | null | required | |
| winner.variant | "a" | "b" | required | |
| winner.by | "replies" | "reads" | "clicks" | required | |
| winner.chance | number | required | |
| winner.close | boolean | required | |
| winner.auto | boolean | required | |
| winner.at | string (date-time) | required | |
| reply_rules | object[] | required | |
| reply_rules[].when | object | required | |
| reply_rules[].when.type | "button" | required | |
| reply_rules[].when.text | string | required | |
| reply_rules[].when.words | string[] | required | |
| reply_rules[].actions | object[] | required | |
| reply_rules[].actions[].type | "assign" | required | |
| reply_rules[].actions[].user_id | string | required | |
| reply_rules[].actions[].tag | string | required | |
| reply_rules[].actions[].label | string | required | |
| reply_rules[].actions[].text | string | required | |
| reply_rules[].actions[].automation_id | string | required | |
| reply_rules[].actions[].step | integer | required | |
| let_join | boolean | required | |
| n_recipients | integer | required | |
| n_sent | integer | required | |
| n_delivered | integer | required | |
| n_read | integer | required | |
| n_replied | integer | required | |
| n_failed | integer | required | |
| n_clicked | integer | null | required | People who tapped a tracked link at least once, each counted once. null when the campaign counts no clicks. |
| track_clicks | boolean | required | |
| auto_retry | boolean | required | |
| max_per_hour | integer | null | required | |
| pause_reason | string | null | required | |
| end_reason | object | null | required | |
| end_reason.code | string | required | |
| end_reason.words | string | required | |
| end_reason.meta_message | string | null | required | |
| created_by | string | null | required | |
| stopped_by | string | null | required | |
| retarget_of | string | null | required | |
| started_at | string (date-time) | null | required | |
| finished_at | string (date-time) | null | required | |
| stopped_at | string (date-time) | null | required | |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required |
GET /v1/campaigns/calendar
The campaigns on each day of a month: sent, running and scheduled, and a sequence’s steps
Scopes campaigns:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| from | query | string | required | |
| to | query | string | required | |
| connection_id | query | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "list" | required | |
| tz | string | required | |
| data | object[] | required | |
| data[].campaign_id | string | required | |
| data[].name | string | required | |
| data[].kind | "one" | "sequence" | "ab" | required | |
| data[].step | integer | null | required | |
| data[].at | string (date-time) | required | |
| data[].state | "sent" | "running" | "scheduled" | required |
POST /v1/campaigns/ideas
One AI conversation: up to four campaigns to plan in a month, from this workspace’s results
Scopes campaigns:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| month | string | required |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "campaign_ideas" | required | |
| tz | string | required | |
| data | object[] | required | |
| data[].title | string | required | |
| data[].date | string | required | |
| data[].time | string | required | |
| data[].why | string | required | |
| data[].audience | "engaged" | "win_back" | "at_risk" | "everyone" | required | |
| data[].kind | "one" | "sequence" | "ab" | required |
GET /v1/campaigns/performance
Campaigns that started sending in the last 7, 30 or 90 days: their figures summed, by day, week or month, against the period before
Scopes campaigns:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| period | query | "7" | "30" | "90" | optional | |
| connection_id | query | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "campaign_performance" | required | |
| from | string | required | |
| to | string | required | |
| tz | string | required | |
| totals | object | required | |
| totals.sent | integer | required | |
| totals.delivered | integer | required | |
| totals.read | integer | required | |
| totals.clicked | integer | required | |
| totals.replied | integer | required | |
| previous | object | required | |
| previous.sent | integer | required | |
| previous.delivered | integer | required | |
| previous.read | integer | required | |
| previous.clicked | integer | required | |
| previous.replied | integer | required | |
| bucket | "day" | "week" | "month" | required | |
| buckets | object[] | required | |
| buckets[].sent | integer | required | |
| buckets[].delivered | integer | required | |
| buckets[].read | integer | required | |
| buckets[].clicked | integer | required | |
| buckets[].replied | integer | required | |
| buckets[].start | string | required | |
| campaigns | object[] | required | |
| campaigns[].sent | integer | required | |
| campaigns[].delivered | integer | required | |
| campaigns[].read | integer | required | |
| campaigns[].clicked | integer | null | required | |
| campaigns[].replied | integer | required | |
| campaigns[].id | string | required | |
| campaigns[].name | string | required | |
| campaigns[].started_at | string (date-time) | required | |
| campaigns[].connection_id | string | null | required | |
| campaigns[].retarget_of | string | null | required |
GET /v1/campaigns/read-times
When people read campaign messages within an hour, by day and hour, over 90 days
Scopes campaigns:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| connection_id | query | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "read_times" | required | |
| tz | string | required | |
| days | 90 | required | |
| cells | object[] | required | |
| cells[].day | integer | required | |
| cells[].hour | integer | required | |
| cells[].sent | integer | required | |
| cells[].read_within_hour | integer | required | |
| best | object | null | required | |
| best.day | integer | required | |
| best.from_hour | integer | required | |
| best.share | number | required |
GET /v1/campaigns/sheet
The Google Sheet each morning’s campaign figures are added to
Scopes campaigns:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "campaign_sheet" | required | |
| connector_account_id | string | required | |
| spreadsheet_id | string | required | |
| tab | string | required | |
| url | string | required | |
| tz | string | required | |
| last_day | string | null | required | |
| created_at | string (date-time) | required |
PUT /v1/campaigns/sheet
Keep a Google Sheet updated: each morning the day before’s figures are added, one row per campaign
Scopes campaigns:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| connector_account_id | string | required | |
| spreadsheet_id | string | required | |
| tab | string | required | |
| url | string (uri) | required |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "campaign_sheet" | required | |
| connector_account_id | string | required | |
| spreadsheet_id | string | required | |
| tab | string | required | |
| url | string | required | |
| tz | string | required | |
| last_day | string | null | required | |
| created_at | string (date-time) | required |
DELETE /v1/campaigns/sheet
Stop adding campaign figures to the Google Sheet. The Sheet stays in Google Drive
Scopes campaigns:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "campaign_sheet" | required | |
| deleted | true | required |
POST /v1/campaigns/template-draft
One AI conversation: a marketing template drafted from a description, to send for approval
Scopes campaigns:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| connection_id | string | required | |
| description | string | required | |
| language | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "template_draft" | required | |
| name | string | required | |
| language | string | required | |
| category | "marketing" | required | |
| body | string | required | |
| footer | string | null | required | |
| buttons | object[] | required | |
| buttons[].type | "QUICK_REPLY" | required | |
| buttons[].text | string | required | |
| sample_values | string[] | required |
/v1/connections
GET /v1/connections
List connections, with health at a glance
Scopes connections:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| limit | query | integer | optional | |
| after | query | string | optional | |
| before | query | string | optional | |
| status | query | string | optional | |
| mode | query | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].object | "connection" | required | |
| data[].phone_number_id | string | required | |
| data[].waba_id | string | required | The WhatsApp Business Account this number is on, as Cosend's wab_ id: the waba_id templates carry, and what GET /v1/templates?waba_id= and POST /v1/templates/{id}/copy take. Meta's id for it is meta_waba_id. |
| data[].meta_waba_id | string | required | Meta's id for the WhatsApp Business Account this number is on, as Meta's Graph API and WhatsApp Manager show it. Cosend's id for it is waba_id. |
| data[].display_phone_number | string | required | |
| data[].phone_e164 | string | required | |
| data[].verified_name | string | null | required | |
| data[].mode | "coexistence" | "cloud_api" | required | |
| data[].status | "pending" | "active" | "needs_reauth" | "payment_blocked" | "restricted" | "disconnected" | "offboarded" | required | |
| data[].status_reason | string | null | required | |
| data[].status_message | string | null | required | |
| data[].token_verification | "verified" | "stale" | "never" | "invalid" | required | |
| data[].throughput_mps | integer | required | |
| data[].quality_rating | string | null | required | |
| data[].quality_rating_previous | string | null | required | |
| data[].quality_changed_at | string (date-time) | null | required | |
| data[].messaging_limit | string | null | required | |
| data[].meta_business_id | string | null | required | |
| data[].last_app_activity_at | string (date-time) | null | required | |
| data[].delivery_mode | "stored" | "direct" | required | |
| data[].import_contacts | boolean | required | Whether Cosend imports contacts from the phone's address book, as chosen when the number was connected. Read-only. |
| data[].override_callback_url | string | null | required | Your endpoint for Meta’s webhooks for this number. On a direct number Cosend sets it as the number’s webhook override at Meta, and Meta sends the number’s messages, echoes, calls and history to it itself; Meta checks it first with webhook.verify_token, and keeps template and account webhooks on Cosend. On a stored number Cosend receives and keeps every change and relays each one to it in Meta’s envelope, signed X-Cosend-Signature-256: sha256=<HMAC-SHA256 of the body with webhook.relay_secret>, retried with back-off until a 2xx. null clears it. |
| data[].orders_and_bookings | "ask_me_first" | "send_right_away" | required | Before your customer gets an order or booking the AI receptionist made. ask_me_first (the default): it waits for a person to check it and tap Send (POST /v1/receptionist-actions/{id}/send), then the customer gets it and taps Confirm. send_right_away: the customer gets it at once and taps Confirm. Cancellations, payment links, refunds and order changes go straight to the customer’s Confirm either way. |
| data[].webhook | object | required | |
| data[].webhook.meta | object | null | required | |
| data[].webhook.verify_token | string | null | required | |
| data[].webhook.relay_secret | string | null | required | |
| data[].webhook.relay | object | required | |
| data[].is_test | boolean | required | |
| data[].connected_at | string (date-time) | null | required | |
| data[].paused | object | null | required | Set when this number is paused because the plan includes fewer numbers than are connected: since when, and how many numbers the plan includes. A paused number sends nothing through Cosend and starts no automation, AI receptionist or recipe, and every send from it is refused with plan_does_not_include. It still receives and stores messages, keeps its history, contacts, templates and settings, stays connected at Meta, and counts as a connected number. Upgrading, or removing another number, brings it back at once. null when the number is not paused. |
| data[].paused.reason | "plan_limit" | required | |
| data[].paused.since | string (date-time) | required | |
| data[].paused.plan_includes | integer | required | |
| data[].registered_at | string (date-time) | null | required | |
| data[].register_deadline_at | string (date-time) | null | required | |
| data[].register_blocked_until | string (date-time) | null | required | |
| data[].display_name_status | string | null | required | |
| data[].display_name | object | required | |
| data[].display_name.current | string | null | required | |
| data[].display_name.requested | string | null | required | |
| data[].display_name.status | "approved" | "not_reviewed" | "pending_review" | "declined" | "not_set" | required | |
| data[].display_name.applied | boolean | null | required | |
| data[].display_name.reason | string | null | required | |
| data[].display_name.updated_at | string (date-time) | null | required | |
| data[].display_name.meta_status | string | null | required | |
| data[].display_name.meta_status_since | string (date-time) | null | required | |
| data[].display_name.meta_review | string | null | required | |
| data[].display_name.meta_review_since | string (date-time) | null | required | |
| data[].display_name.read_at | string (date-time) | null | required | |
| data[].display_name.decision | object | null | required | |
| data[].display_name.refusal | object | null | required | |
| data[].display_name.applied_at | string (date-time) | null | required | |
| data[].display_name.apply_by | string (date-time) | null | required | |
| data[].display_name.submitted | object | null | required | |
| data[].display_name.submissions_in_30_days | integer | required | |
| data[].display_name.next | object | required | |
| data[].templates_synced_at | string (date-time) | null | required | |
| data[].health | object | null | required | |
| data[].health.checked_at | string (date-time) | required | |
| data[].health.can_send_message | string | null | required | |
| data[].health.read_at | string (date-time) | null | required | |
| data[].health.entities | object[] | required | |
| data[].health.token | object | null | required | |
| data[].health.subscription | object | null | required | |
| data[].health.can_send | object | null | required | |
| data[].sending | object | required | |
| data[].sending.status | "can_send" | "limited" | "cannot_send" | "unknown" | required | |
| data[].sending.checked_at | string (date-time) | null | required | |
| data[].sending.problems | object[] | required | |
| data[].business_verification | object | required | |
| data[].business_verification.status | string | null | required | |
| data[].business_verification.since | string (date-time) | null | required | |
| data[].business_verification.checked_at | string (date-time) | null | required | |
| data[].business_verification.business_id | string | null | required | |
| data[].business_verification.business_name | string | null | required | |
| data[].business_verification.messaging_limit | string | null | required | |
| data[].business_verification.messaging_limit_read_at | string (date-time) | null | required | |
| data[].business_verification.meta | object | null | required | |
| data[].business_verification.alerts | object[] | required | |
| data[].business_verification.delay | string | null | required | |
| data[].onboarding | object | null | required | |
| data[].onboarding.status | "pending" | "syncing" | "complete" | "expired" | "failed" | "offboarded" | required | |
| data[].onboarding.history_state | "NOT_REQUESTED" | "REQUESTED" | "STREAMING" | "COMPLETE" | "DECLINED" | "MISSED_WINDOW" | "FAILED" | "SKIPPED" | required | |
| data[].onboarding.progress_pct | integer | required | |
| data[].onboarding.messages_synced | integer | required | |
| data[].onboarding.contacts_synced | integer | required | |
| data[].onboarding.sync_deadline_at | string (date-time) | required | |
| has_more | boolean | required | |
| next_cursor | string | null | required |
Errors plan_does_not_include
GET /v1/connections/{id}
One connection, with its onboarding summary
Scopes connections:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "connection" | required | |
| phone_number_id | string | required | |
| waba_id | string | required | The WhatsApp Business Account this number is on, as Cosend's wab_ id: the waba_id templates carry, and what GET /v1/templates?waba_id= and POST /v1/templates/{id}/copy take. Meta's id for it is meta_waba_id. |
| meta_waba_id | string | required | Meta's id for the WhatsApp Business Account this number is on, as Meta's Graph API and WhatsApp Manager show it. Cosend's id for it is waba_id. |
| display_phone_number | string | required | |
| phone_e164 | string | required | |
| verified_name | string | null | required | |
| mode | "coexistence" | "cloud_api" | required | |
| status | "pending" | "active" | "needs_reauth" | "payment_blocked" | "restricted" | "disconnected" | "offboarded" | required | |
| status_reason | string | null | required | |
| status_message | string | null | required | |
| token_verification | "verified" | "stale" | "never" | "invalid" | required | |
| throughput_mps | integer | required | |
| quality_rating | string | null | required | |
| quality_rating_previous | string | null | required | |
| quality_changed_at | string (date-time) | null | required | |
| messaging_limit | string | null | required | |
| meta_business_id | string | null | required | |
| last_app_activity_at | string (date-time) | null | required | |
| delivery_mode | "stored" | "direct" | required | |
| import_contacts | boolean | required | Whether Cosend imports contacts from the phone's address book, as chosen when the number was connected. Read-only. |
| override_callback_url | string | null | required | Your endpoint for Meta’s webhooks for this number. On a direct number Cosend sets it as the number’s webhook override at Meta, and Meta sends the number’s messages, echoes, calls and history to it itself; Meta checks it first with webhook.verify_token, and keeps template and account webhooks on Cosend. On a stored number Cosend receives and keeps every change and relays each one to it in Meta’s envelope, signed X-Cosend-Signature-256: sha256=<HMAC-SHA256 of the body with webhook.relay_secret>, retried with back-off until a 2xx. null clears it. |
| orders_and_bookings | "ask_me_first" | "send_right_away" | required | Before your customer gets an order or booking the AI receptionist made. ask_me_first (the default): it waits for a person to check it and tap Send (POST /v1/receptionist-actions/{id}/send), then the customer gets it and taps Confirm. send_right_away: the customer gets it at once and taps Confirm. Cancellations, payment links, refunds and order changes go straight to the customer’s Confirm either way. |
| webhook | object | required | |
| webhook.meta | object | null | required | |
| webhook.meta.phone_number | string | null | required | |
| webhook.meta.whatsapp_business_account | string | null | required | |
| webhook.meta.application | string | null | required | |
| webhook.meta.read_at | string (date-time) | required | |
| webhook.verify_token | string | null | required | |
| webhook.relay_secret | string | null | required | |
| webhook.relay | object | required | |
| webhook.relay.last_delivered_at | string (date-time) | null | required | |
| webhook.relay.last_failure | object | null | required | |
| is_test | boolean | required | |
| connected_at | string (date-time) | null | required | |
| paused | object | null | required | Set when this number is paused because the plan includes fewer numbers than are connected: since when, and how many numbers the plan includes. A paused number sends nothing through Cosend and starts no automation, AI receptionist or recipe, and every send from it is refused with plan_does_not_include. It still receives and stores messages, keeps its history, contacts, templates and settings, stays connected at Meta, and counts as a connected number. Upgrading, or removing another number, brings it back at once. null when the number is not paused. |
| paused.reason | "plan_limit" | required | |
| paused.since | string (date-time) | required | |
| paused.plan_includes | integer | required | |
| registered_at | string (date-time) | null | required | |
| register_deadline_at | string (date-time) | null | required | |
| register_blocked_until | string (date-time) | null | required | |
| display_name_status | string | null | required | |
| display_name | object | required | |
| display_name.current | string | null | required | |
| display_name.requested | string | null | required | |
| display_name.status | "approved" | "not_reviewed" | "pending_review" | "declined" | "not_set" | required | |
| display_name.applied | boolean | null | required | |
| display_name.reason | string | null | required | |
| display_name.updated_at | string (date-time) | null | required | |
| display_name.meta_status | string | null | required | |
| display_name.meta_status_since | string (date-time) | null | required | |
| display_name.meta_review | string | null | required | |
| display_name.meta_review_since | string (date-time) | null | required | |
| display_name.read_at | string (date-time) | null | required | |
| display_name.decision | object | null | required | |
| display_name.decision.value | string | required | |
| display_name.decision.name | string | null | required | |
| display_name.decision.reason_code | string | null | required | |
| display_name.decision.reason | string | null | required | |
| display_name.decision.at | string (date-time) | required | |
| display_name.refusal | object | null | required | |
| display_name.refusal.message | string | null | required | |
| display_name.refusal.at | string (date-time) | required | |
| display_name.applied_at | string (date-time) | null | required | |
| display_name.apply_by | string (date-time) | null | required | |
| display_name.submitted | object | null | required | |
| display_name.submitted.name | string | required | |
| display_name.submitted.at | string (date-time) | required | |
| display_name.submitted.by | "owner" | "cosend" | required | |
| display_name.submitted.refusal | string | null | required | |
| display_name.submissions_in_30_days | integer | required | |
| display_name.next | object | required | |
| display_name.next.action | "none" | "applying" | "waiting" | "asking" | "verify_business" | "submit_name" | "submit_different_name" | "submit_by_hand" | … | required | |
| display_name.next.owner | boolean | required | |
| display_name.next.sentence | string | null | required | |
| display_name.next.until | string (date-time) | null | required | |
| templates_synced_at | string (date-time) | null | required | |
| health | object | null | required | |
| health.checked_at | string (date-time) | required | |
| health.can_send_message | string | null | required | |
| health.read_at | string (date-time) | null | required | |
| health.entities | object[] | required | |
| health.entities[].entity_type | string | null | required | |
| health.entities[].id | string | null | required | |
| health.entities[].can_send_message | string | null | required | |
| health.entities[].can_receive_call_sip | string | null | required | |
| health.entities[].additional_info | string[] | required | |
| health.entities[].errors | object[] | required | |
| health.token | object | null | required | |
| health.token.status | "valid" | "invalid" | "missing_permissions" | "unreachable" | required | |
| health.token.missing_scopes | string[] | required | |
| health.token.expires_at | string (date-time) | null | required | |
| health.token.reason | string | null | required | |
| health.token.action | string | null | required | |
| health.subscription | object | null | required | |
| health.subscription.status | "subscribed" | "not_subscribed" | "unreachable" | required | |
| health.subscription.reason | string | null | required | |
| health.subscription.action | string | null | required | |
| health.can_send | object | null | required | |
| health.can_send.status | "available" | "limited" | "blocked" | "unreachable" | required | |
| health.can_send.reason | string | null | required | |
| health.can_send.action | string | null | required | |
| sending | object | required | |
| sending.status | "can_send" | "limited" | "cannot_send" | "unknown" | required | |
| sending.checked_at | string (date-time) | null | required | |
| sending.problems | object[] | required | |
| sending.problems[].code | string | required | |
| sending.problems[].entity | "number" | "whatsapp_account" | "business" | "app" | "token" | "subscription" | required | |
| sending.problems[].severity | "blocks" | "limits" | "info" | required | |
| sending.problems[].meta | object | required | |
| sending.problems[].title | string | null | required | |
| sending.problems[].sentence | string | null | required | |
| sending.problems[].limit | string | null | required | |
| sending.problems[].causes | object[] | null | required | |
| sending.problems[].fix | object | required | |
| business_verification | object | required | |
| business_verification.status | string | null | required | |
| business_verification.since | string (date-time) | null | required | |
| business_verification.checked_at | string (date-time) | null | required | |
| business_verification.business_id | string | null | required | |
| business_verification.business_name | string | null | required | |
| business_verification.messaging_limit | string | null | required | |
| business_verification.messaging_limit_read_at | string (date-time) | null | required | |
| business_verification.meta | object | null | required | |
| business_verification.meta.description | string | null | required | |
| business_verification.meta.solution | string | null | required | |
| business_verification.alerts | object[] | required | |
| business_verification.alerts[].type | string | required | |
| business_verification.alerts[].severity | string | null | required | |
| business_verification.alerts[].status | string | null | required | |
| business_verification.alerts[].description | string | null | required | |
| business_verification.alerts[].entity_type | string | null | required | |
| business_verification.alerts[].entity_id | string | null | required | |
| business_verification.alerts[].received_at | string (date-time) | required | |
| business_verification.delay | string | null | required | |
| onboarding | object | null | required | |
| onboarding.status | "pending" | "syncing" | "complete" | "expired" | "failed" | "offboarded" | required | |
| onboarding.history_state | "NOT_REQUESTED" | "REQUESTED" | "STREAMING" | "COMPLETE" | "DECLINED" | "MISSED_WINDOW" | "FAILED" | "SKIPPED" | required | |
| onboarding.progress_pct | integer | required | |
| onboarding.messages_synced | integer | required | |
| onboarding.contacts_synced | integer | required | |
| onboarding.sync_deadline_at | string (date-time) | required |
Errors plan_does_not_include
PATCH /v1/connections/{id}
The settings that change behaviour: where messages are kept and delivered, and whether a person checks an order or booking the AI receptionist made before the customer gets it
Scopes connections:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| delivery_mode | "stored" | "direct" | optional | |
| retention_months | any | optional | Retention is set once for the whole account, not per connection. Set it with PATCH /v1/account/data-policy. |
| override_callback_url | string (uri) | null | optional | Your endpoint for Meta’s webhooks for this number. On a direct number Cosend sets it as the number’s webhook override at Meta, and Meta sends the number’s messages, echoes, calls and history to it itself; Meta checks it first with webhook.verify_token, and keeps template and account webhooks on Cosend. On a stored number Cosend receives and keeps every change and relays each one to it in Meta’s envelope, signed X-Cosend-Signature-256: sha256=<HMAC-SHA256 of the body with webhook.relay_secret>, retried with back-off until a 2xx. null clears it. |
| orders_and_bookings | "ask_me_first" | "send_right_away" | optional | Before your customer gets an order or booking the AI receptionist made. ask_me_first (the default): it waits for a person to check it and tap Send (POST /v1/receptionist-actions/{id}/send), then the customer gets it and taps Confirm. send_right_away: the customer gets it at once and taps Confirm. Cancellations, payment links, refunds and order changes go straight to the customer’s Confirm either way. |
| switch_off_conflicts | boolean | optional | With delivery_mode direct: true switches off what a 409 direct_mode_conflicts lists for this number, then switches it, all in one step. Automations are switched off, AI conversations ended and open chats marked Done; what is in the way is read again, not taken from the request. Absent or false, a switch with anything in the way is refused with that list. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "connection" | required | |
| phone_number_id | string | required | |
| waba_id | string | required | The WhatsApp Business Account this number is on, as Cosend's wab_ id: the waba_id templates carry, and what GET /v1/templates?waba_id= and POST /v1/templates/{id}/copy take. Meta's id for it is meta_waba_id. |
| meta_waba_id | string | required | Meta's id for the WhatsApp Business Account this number is on, as Meta's Graph API and WhatsApp Manager show it. Cosend's id for it is waba_id. |
| display_phone_number | string | required | |
| phone_e164 | string | required | |
| verified_name | string | null | required | |
| mode | "coexistence" | "cloud_api" | required | |
| status | "pending" | "active" | "needs_reauth" | "payment_blocked" | "restricted" | "disconnected" | "offboarded" | required | |
| status_reason | string | null | required | |
| status_message | string | null | required | |
| token_verification | "verified" | "stale" | "never" | "invalid" | required | |
| throughput_mps | integer | required | |
| quality_rating | string | null | required | |
| quality_rating_previous | string | null | required | |
| quality_changed_at | string (date-time) | null | required | |
| messaging_limit | string | null | required | |
| meta_business_id | string | null | required | |
| last_app_activity_at | string (date-time) | null | required | |
| delivery_mode | "stored" | "direct" | required | |
| import_contacts | boolean | required | Whether Cosend imports contacts from the phone's address book, as chosen when the number was connected. Read-only. |
| override_callback_url | string | null | required | Your endpoint for Meta’s webhooks for this number. On a direct number Cosend sets it as the number’s webhook override at Meta, and Meta sends the number’s messages, echoes, calls and history to it itself; Meta checks it first with webhook.verify_token, and keeps template and account webhooks on Cosend. On a stored number Cosend receives and keeps every change and relays each one to it in Meta’s envelope, signed X-Cosend-Signature-256: sha256=<HMAC-SHA256 of the body with webhook.relay_secret>, retried with back-off until a 2xx. null clears it. |
| orders_and_bookings | "ask_me_first" | "send_right_away" | required | Before your customer gets an order or booking the AI receptionist made. ask_me_first (the default): it waits for a person to check it and tap Send (POST /v1/receptionist-actions/{id}/send), then the customer gets it and taps Confirm. send_right_away: the customer gets it at once and taps Confirm. Cancellations, payment links, refunds and order changes go straight to the customer’s Confirm either way. |
| webhook | object | required | |
| webhook.meta | object | null | required | |
| webhook.meta.phone_number | string | null | required | |
| webhook.meta.whatsapp_business_account | string | null | required | |
| webhook.meta.application | string | null | required | |
| webhook.meta.read_at | string (date-time) | required | |
| webhook.verify_token | string | null | required | |
| webhook.relay_secret | string | null | required | |
| webhook.relay | object | required | |
| webhook.relay.last_delivered_at | string (date-time) | null | required | |
| webhook.relay.last_failure | object | null | required | |
| is_test | boolean | required | |
| connected_at | string (date-time) | null | required | |
| paused | object | null | required | Set when this number is paused because the plan includes fewer numbers than are connected: since when, and how many numbers the plan includes. A paused number sends nothing through Cosend and starts no automation, AI receptionist or recipe, and every send from it is refused with plan_does_not_include. It still receives and stores messages, keeps its history, contacts, templates and settings, stays connected at Meta, and counts as a connected number. Upgrading, or removing another number, brings it back at once. null when the number is not paused. |
| paused.reason | "plan_limit" | required | |
| paused.since | string (date-time) | required | |
| paused.plan_includes | integer | required | |
| registered_at | string (date-time) | null | required | |
| register_deadline_at | string (date-time) | null | required | |
| register_blocked_until | string (date-time) | null | required | |
| display_name_status | string | null | required | |
| display_name | object | required | |
| display_name.current | string | null | required | |
| display_name.requested | string | null | required | |
| display_name.status | "approved" | "not_reviewed" | "pending_review" | "declined" | "not_set" | required | |
| display_name.applied | boolean | null | required | |
| display_name.reason | string | null | required | |
| display_name.updated_at | string (date-time) | null | required | |
| display_name.meta_status | string | null | required | |
| display_name.meta_status_since | string (date-time) | null | required | |
| display_name.meta_review | string | null | required | |
| display_name.meta_review_since | string (date-time) | null | required | |
| display_name.read_at | string (date-time) | null | required | |
| display_name.decision | object | null | required | |
| display_name.decision.value | string | required | |
| display_name.decision.name | string | null | required | |
| display_name.decision.reason_code | string | null | required | |
| display_name.decision.reason | string | null | required | |
| display_name.decision.at | string (date-time) | required | |
| display_name.refusal | object | null | required | |
| display_name.refusal.message | string | null | required | |
| display_name.refusal.at | string (date-time) | required | |
| display_name.applied_at | string (date-time) | null | required | |
| display_name.apply_by | string (date-time) | null | required | |
| display_name.submitted | object | null | required | |
| display_name.submitted.name | string | required | |
| display_name.submitted.at | string (date-time) | required | |
| display_name.submitted.by | "owner" | "cosend" | required | |
| display_name.submitted.refusal | string | null | required | |
| display_name.submissions_in_30_days | integer | required | |
| display_name.next | object | required | |
| display_name.next.action | "none" | "applying" | "waiting" | "asking" | "verify_business" | "submit_name" | "submit_different_name" | "submit_by_hand" | … | required | |
| display_name.next.owner | boolean | required | |
| display_name.next.sentence | string | null | required | |
| display_name.next.until | string (date-time) | null | required | |
| templates_synced_at | string (date-time) | null | required | |
| health | object | null | required | |
| health.checked_at | string (date-time) | required | |
| health.can_send_message | string | null | required | |
| health.read_at | string (date-time) | null | required | |
| health.entities | object[] | required | |
| health.entities[].entity_type | string | null | required | |
| health.entities[].id | string | null | required | |
| health.entities[].can_send_message | string | null | required | |
| health.entities[].can_receive_call_sip | string | null | required | |
| health.entities[].additional_info | string[] | required | |
| health.entities[].errors | object[] | required | |
| health.token | object | null | required | |
| health.token.status | "valid" | "invalid" | "missing_permissions" | "unreachable" | required | |
| health.token.missing_scopes | string[] | required | |
| health.token.expires_at | string (date-time) | null | required | |
| health.token.reason | string | null | required | |
| health.token.action | string | null | required | |
| health.subscription | object | null | required | |
| health.subscription.status | "subscribed" | "not_subscribed" | "unreachable" | required | |
| health.subscription.reason | string | null | required | |
| health.subscription.action | string | null | required | |
| health.can_send | object | null | required | |
| health.can_send.status | "available" | "limited" | "blocked" | "unreachable" | required | |
| health.can_send.reason | string | null | required | |
| health.can_send.action | string | null | required | |
| sending | object | required | |
| sending.status | "can_send" | "limited" | "cannot_send" | "unknown" | required | |
| sending.checked_at | string (date-time) | null | required | |
| sending.problems | object[] | required | |
| sending.problems[].code | string | required | |
| sending.problems[].entity | "number" | "whatsapp_account" | "business" | "app" | "token" | "subscription" | required | |
| sending.problems[].severity | "blocks" | "limits" | "info" | required | |
| sending.problems[].meta | object | required | |
| sending.problems[].title | string | null | required | |
| sending.problems[].sentence | string | null | required | |
| sending.problems[].limit | string | null | required | |
| sending.problems[].causes | object[] | null | required | |
| sending.problems[].fix | object | required | |
| business_verification | object | required | |
| business_verification.status | string | null | required | |
| business_verification.since | string (date-time) | null | required | |
| business_verification.checked_at | string (date-time) | null | required | |
| business_verification.business_id | string | null | required | |
| business_verification.business_name | string | null | required | |
| business_verification.messaging_limit | string | null | required | |
| business_verification.messaging_limit_read_at | string (date-time) | null | required | |
| business_verification.meta | object | null | required | |
| business_verification.meta.description | string | null | required | |
| business_verification.meta.solution | string | null | required | |
| business_verification.alerts | object[] | required | |
| business_verification.alerts[].type | string | required | |
| business_verification.alerts[].severity | string | null | required | |
| business_verification.alerts[].status | string | null | required | |
| business_verification.alerts[].description | string | null | required | |
| business_verification.alerts[].entity_type | string | null | required | |
| business_verification.alerts[].entity_id | string | null | required | |
| business_verification.alerts[].received_at | string (date-time) | required | |
| business_verification.delay | string | null | required | |
| onboarding | object | null | required | |
| onboarding.status | "pending" | "syncing" | "complete" | "expired" | "failed" | "offboarded" | required | |
| onboarding.history_state | "NOT_REQUESTED" | "REQUESTED" | "STREAMING" | "COMPLETE" | "DECLINED" | "MISSED_WINDOW" | "FAILED" | "SKIPPED" | required | |
| onboarding.progress_pct | integer | required | |
| onboarding.messages_synced | integer | required | |
| onboarding.contacts_synced | integer | required | |
| onboarding.sync_deadline_at | string (date-time) | required | |
| switched_off | object[] | required | |
| switched_off[].id | string | required | |
| switched_off[].object | "automation" | "ai_session" | "conversation" | required | |
| switched_off[].name | string | required | |
| switched_off[].scope | "this_connection" | "all_connections" | required |
DELETE /v1/connections/{id}
Disconnect the number: offboard it at Meta, then remove it from Cosend
Scopes connections:disconnect
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "connection" | required | |
| status | "offboarded" | required | |
| deleted_at | string (date-time) | required | |
| waba_unsubscribed | boolean | required | |
| meta_cleanup | "done" | "not_needed" | "skipped_access_lost" | required |
GET /v1/connections/{id}/ad-replies
A WhatsApp number’s replies to new chats from its Click-to-WhatsApp ads: who answers, the product each ad sells, the wait, the hours and the follow-up
Scopes automations:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "ad_replies" | required | |
| connection_id | string | required | |
| automation_id | string | null | required | |
| on | boolean | required | |
| who_answers | "card_then_ai" | "ai_first" | "card_then_you" | required | |
| delay_seconds | 0 | 20 | 30 | 45 | 60 | required | |
| hours | "always" | "outside_business_hours" | required | |
| opening_hours | object | required | |
| opening_hours.days | ("mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun")[] | required | |
| opening_hours.opens | string | required | |
| opening_hours.closes | string | required | |
| weekly_hours | object | required | |
| weekly_hours.mon | object | optional | |
| weekly_hours.mon.opens | string | required | |
| weekly_hours.mon.closes | string | required | |
| weekly_hours.tue | object | optional | |
| weekly_hours.tue.opens | string | required | |
| weekly_hours.tue.closes | string | required | |
| weekly_hours.wed | object | optional | |
| weekly_hours.wed.opens | string | required | |
| weekly_hours.wed.closes | string | required | |
| weekly_hours.thu | object | optional | |
| weekly_hours.thu.opens | string | required | |
| weekly_hours.thu.closes | string | required | |
| weekly_hours.fri | object | optional | |
| weekly_hours.fri.opens | string | required | |
| weekly_hours.fri.closes | string | required | |
| weekly_hours.sat | object | optional | |
| weekly_hours.sat.opens | string | required | |
| weekly_hours.sat.closes | string | required | |
| weekly_hours.sun | object | optional | |
| weekly_hours.sun.opens | string | required | |
| weekly_hours.sun.closes | string | required | |
| greeting_id | string | null | required | |
| product_id | string | null | required | |
| question | string | required | |
| ads | object[] | required | |
| ads[].ad_id | string | required | |
| ads[].headline | string | null | required | |
| ads[].product_id | string | null | required | |
| ads[].saved_reply_id | string | null | required | |
| ads[].question | string | null | required | |
| ads[].suggested_product_id | string | null | required | |
| follow_up | object | required | |
| follow_up.after_days | integer | required | |
| follow_up.saved_reply_id | string | null | required | |
| follow_up.template | string | null | required | |
| follow_up.nudge | boolean | required | |
| follow_up.nudge_saved_reply_id | string | null | required |
PATCH /v1/connections/{id}/ad-replies
Change a WhatsApp number’s replies to new chats from its ads: send only what changes; ads is the whole list
Scopes automations:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| who_answers | "card_then_ai" | "ai_first" | "card_then_you" | optional | |
| delay_seconds | 0 | 20 | 30 | 45 | 60 | optional | |
| hours | "always" | "outside_business_hours" | optional | |
| opening_hours | object | optional | |
| opening_hours.days | ("mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun")[] | required | |
| opening_hours.opens | string | required | |
| opening_hours.closes | string | required | |
| weekly_hours | object | optional | |
| weekly_hours.mon | object | optional | |
| weekly_hours.mon.opens | string | required | |
| weekly_hours.mon.closes | string | required | |
| weekly_hours.tue | object | optional | |
| weekly_hours.tue.opens | string | required | |
| weekly_hours.tue.closes | string | required | |
| weekly_hours.wed | object | optional | |
| weekly_hours.wed.opens | string | required | |
| weekly_hours.wed.closes | string | required | |
| weekly_hours.thu | object | optional | |
| weekly_hours.thu.opens | string | required | |
| weekly_hours.thu.closes | string | required | |
| weekly_hours.fri | object | optional | |
| weekly_hours.fri.opens | string | required | |
| weekly_hours.fri.closes | string | required | |
| weekly_hours.sat | object | optional | |
| weekly_hours.sat.opens | string | required | |
| weekly_hours.sat.closes | string | required | |
| weekly_hours.sun | object | optional | |
| weekly_hours.sun.opens | string | required | |
| weekly_hours.sun.closes | string | required | |
| greeting_id | string | null | optional | |
| product_id | string | null | optional | |
| question | string | optional | |
| ads | object[] | optional | |
| ads[].ad_id | string | required | |
| ads[].product_id | string | required | |
| ads[].saved_reply_id | string | null | optional | |
| ads[].question | string | null | optional | |
| follow_up | object | optional | |
| follow_up.after_days | integer | optional | |
| follow_up.saved_reply_id | string | null | optional | |
| follow_up.template | string | null | optional | |
| follow_up.nudge | boolean | optional | |
| follow_up.nudge_saved_reply_id | string | null | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "ad_replies" | required | |
| connection_id | string | required | |
| automation_id | string | null | required | |
| on | boolean | required | |
| who_answers | "card_then_ai" | "ai_first" | "card_then_you" | required | |
| delay_seconds | 0 | 20 | 30 | 45 | 60 | required | |
| hours | "always" | "outside_business_hours" | required | |
| opening_hours | object | required | |
| opening_hours.days | ("mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun")[] | required | |
| opening_hours.opens | string | required | |
| opening_hours.closes | string | required | |
| weekly_hours | object | required | |
| weekly_hours.mon | object | optional | |
| weekly_hours.mon.opens | string | required | |
| weekly_hours.mon.closes | string | required | |
| weekly_hours.tue | object | optional | |
| weekly_hours.tue.opens | string | required | |
| weekly_hours.tue.closes | string | required | |
| weekly_hours.wed | object | optional | |
| weekly_hours.wed.opens | string | required | |
| weekly_hours.wed.closes | string | required | |
| weekly_hours.thu | object | optional | |
| weekly_hours.thu.opens | string | required | |
| weekly_hours.thu.closes | string | required | |
| weekly_hours.fri | object | optional | |
| weekly_hours.fri.opens | string | required | |
| weekly_hours.fri.closes | string | required | |
| weekly_hours.sat | object | optional | |
| weekly_hours.sat.opens | string | required | |
| weekly_hours.sat.closes | string | required | |
| weekly_hours.sun | object | optional | |
| weekly_hours.sun.opens | string | required | |
| weekly_hours.sun.closes | string | required | |
| greeting_id | string | null | required | |
| product_id | string | null | required | |
| question | string | required | |
| ads | object[] | required | |
| ads[].ad_id | string | required | |
| ads[].headline | string | null | required | |
| ads[].product_id | string | null | required | |
| ads[].saved_reply_id | string | null | required | |
| ads[].question | string | null | required | |
| ads[].suggested_product_id | string | null | required | |
| follow_up | object | required | |
| follow_up.after_days | integer | required | |
| follow_up.saved_reply_id | string | null | required | |
| follow_up.template | string | null | required | |
| follow_up.nudge | boolean | required | |
| follow_up.nudge_saved_reply_id | string | null | required |
GET /v1/connections/{id}/ad-settings
A number’s ad account for spend, and whether it tells Meta which chats from its ads became sales
Scopes messages:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "ad_settings" | required | |
| connection_id | string | required | |
| sales_to_meta | object | required | |
| sales_to_meta.on | boolean | required | The seller switched on telling Meta about sales from chats that came from their ads. Off by default. |
| sales_to_meta.ready | boolean | required | On, and nothing is missing: confirmed and paid orders are told to Meta. |
| sales_to_meta.missing | "plan" | "permission" | null | required | plan: the workspace’s plan does not include it. permission: Meta refused this number’s access to send sales. Null when nothing is missing or the switch is off. |
| sales_to_meta.words | string | null | required | What is missing, in words to show under the switch. Null with nothing missing. |
| sales_to_meta.dataset_id | string | null | required | Meta’s dataset of the number’s WhatsApp account the sales go to. |
| ad_account | object | null | required | The ad account whose spend the ads report reads. Null: none chosen. |
| ad_account.id | string | required | Meta’s ad account id, act_ and digits. |
| ad_account.name | string | null | required | |
| ad_account.currency | string | null | required | The ad account’s currency: spend is in it. |
PATCH /v1/connections/{id}/ad-settings
Choose a number’s ad account for spend, and switch telling Meta about its sales on or off
Scopes messages:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | optional |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| sales_to_meta | boolean | optional | Switch telling Meta about sales on or off. On asks Meta for the number’s dataset first, and is refused in words when Meta does not allow it. |
| ad_account_id | string | null | optional | The ad account to read spend from, as Meta Ads Manager shows its ID (with or without act_). Null removes it. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "ad_settings" | required | |
| connection_id | string | required | |
| sales_to_meta | object | required | |
| sales_to_meta.on | boolean | required | The seller switched on telling Meta about sales from chats that came from their ads. Off by default. |
| sales_to_meta.ready | boolean | required | On, and nothing is missing: confirmed and paid orders are told to Meta. |
| sales_to_meta.missing | "plan" | "permission" | null | required | plan: the workspace’s plan does not include it. permission: Meta refused this number’s access to send sales. Null when nothing is missing or the switch is off. |
| sales_to_meta.words | string | null | required | What is missing, in words to show under the switch. Null with nothing missing. |
| sales_to_meta.dataset_id | string | null | required | Meta’s dataset of the number’s WhatsApp account the sales go to. |
| ad_account | object | null | required | The ad account whose spend the ads report reads. Null: none chosen. |
| ad_account.id | string | required | Meta’s ad account id, act_ and digits. |
| ad_account.name | string | null | required | |
| ad_account.currency | string | null | required | The ad account’s currency: spend is in it. |
GET /v1/connections/{id}/crm-order-sync
How a number’s orders go to the seller’s CRM: the account, the pipeline and the stage per order status
Scopes messages:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "crm_order_sync" | required | |
| connection_id | string | required | |
| set_up | boolean | required | False until the setting is first saved. |
| enabled | boolean | required | |
| available | boolean | required | Whether the workspace’s plan includes it (Starter and up). False on Free. |
| connector_account_id | string | null | required | The CRM account the orders go to. Before the first save, the number’s only CRM account, if it has exactly one. |
| accounts | object[] | required | The CRM accounts used on this number (HubSpot, Pipedrive, Zoho CRM). |
| accounts[].id | string | required | |
| accounts[].connector | string | required | |
| accounts[].name | string | required | The CRM as the Integrations page names it: "HubSpot". |
| accounts[].account_name | string | required | |
| pipeline_id | string | null | required | The pipeline the deals go in; null is the CRM’s first. |
| pipelines | object[] | required | The account’s deal pipelines and their stages, read from the CRM now. |
| pipelines[].id | string | required | |
| pipelines[].name | string | required | |
| pipelines[].stages | object[] | required | |
| pipelines[].stages[].id | string | required | |
| pipelines[].stages[].name | string | required | |
| pipelines[].stages[].outcome | "won" | "lost" | null | required | won or lost for a stage that closes the deal; null for an open one. |
| stages | object | null | required | Where each order status moves the deal, the defaults included. Null when it cannot be worked out (problem says why). |
| problem | string | null | required | Why the orders cannot be sent, in plain words: no account chosen, the CRM not reachable, a stage no longer there. Null when they can. |
PATCH /v1/connections/{id}/crm-order-sync
Send a number’s orders to the seller’s CRM: switch it on or off, pick the account, the pipeline and the stage per order status
Scopes messages:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | optional |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| enabled | boolean | optional | Send this number’s orders to the CRM (Starter and up). |
| connector_account_id | string | optional | A CRM account used on this number. Choosing another account clears the pipeline and stages chosen for the last one. |
| pipeline_id | string | null | optional | A pipeline of the account; null is the CRM’s first. |
| stages | object | optional | The stage per order status, only those given. Null puts a status back to its default. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "crm_order_sync" | required | |
| connection_id | string | required | |
| set_up | boolean | required | False until the setting is first saved. |
| enabled | boolean | required | |
| available | boolean | required | Whether the workspace’s plan includes it (Starter and up). False on Free. |
| connector_account_id | string | null | required | The CRM account the orders go to. Before the first save, the number’s only CRM account, if it has exactly one. |
| accounts | object[] | required | The CRM accounts used on this number (HubSpot, Pipedrive, Zoho CRM). |
| accounts[].id | string | required | |
| accounts[].connector | string | required | |
| accounts[].name | string | required | The CRM as the Integrations page names it: "HubSpot". |
| accounts[].account_name | string | required | |
| pipeline_id | string | null | required | The pipeline the deals go in; null is the CRM’s first. |
| pipelines | object[] | required | The account’s deal pipelines and their stages, read from the CRM now. |
| pipelines[].id | string | required | |
| pipelines[].name | string | required | |
| pipelines[].stages | object[] | required | |
| pipelines[].stages[].id | string | required | |
| pipelines[].stages[].name | string | required | |
| pipelines[].stages[].outcome | "won" | "lost" | null | required | won or lost for a stage that closes the deal; null for an open one. |
| stages | object | null | required | Where each order status moves the deal, the defaults included. Null when it cannot be worked out (problem says why). |
| problem | string | null | required | Why the orders cannot be sent, in plain words: no account chosen, the CRM not reachable, a stage no longer there. Null when they can. |
POST /v1/connections/{id}/display-name
Submit a new WhatsApp display name to Meta for review
Scopes connections:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| display_name | string | required |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "connection" | required | |
| phone_number_id | string | required | |
| waba_id | string | required | The WhatsApp Business Account this number is on, as Cosend's wab_ id: the waba_id templates carry, and what GET /v1/templates?waba_id= and POST /v1/templates/{id}/copy take. Meta's id for it is meta_waba_id. |
| meta_waba_id | string | required | Meta's id for the WhatsApp Business Account this number is on, as Meta's Graph API and WhatsApp Manager show it. Cosend's id for it is waba_id. |
| display_phone_number | string | required | |
| phone_e164 | string | required | |
| verified_name | string | null | required | |
| mode | "coexistence" | "cloud_api" | required | |
| status | "pending" | "active" | "needs_reauth" | "payment_blocked" | "restricted" | "disconnected" | "offboarded" | required | |
| status_reason | string | null | required | |
| status_message | string | null | required | |
| token_verification | "verified" | "stale" | "never" | "invalid" | required | |
| throughput_mps | integer | required | |
| quality_rating | string | null | required | |
| quality_rating_previous | string | null | required | |
| quality_changed_at | string (date-time) | null | required | |
| messaging_limit | string | null | required | |
| meta_business_id | string | null | required | |
| last_app_activity_at | string (date-time) | null | required | |
| delivery_mode | "stored" | "direct" | required | |
| import_contacts | boolean | required | Whether Cosend imports contacts from the phone's address book, as chosen when the number was connected. Read-only. |
| override_callback_url | string | null | required | Your endpoint for Meta’s webhooks for this number. On a direct number Cosend sets it as the number’s webhook override at Meta, and Meta sends the number’s messages, echoes, calls and history to it itself; Meta checks it first with webhook.verify_token, and keeps template and account webhooks on Cosend. On a stored number Cosend receives and keeps every change and relays each one to it in Meta’s envelope, signed X-Cosend-Signature-256: sha256=<HMAC-SHA256 of the body with webhook.relay_secret>, retried with back-off until a 2xx. null clears it. |
| orders_and_bookings | "ask_me_first" | "send_right_away" | required | Before your customer gets an order or booking the AI receptionist made. ask_me_first (the default): it waits for a person to check it and tap Send (POST /v1/receptionist-actions/{id}/send), then the customer gets it and taps Confirm. send_right_away: the customer gets it at once and taps Confirm. Cancellations, payment links, refunds and order changes go straight to the customer’s Confirm either way. |
| webhook | object | required | |
| webhook.meta | object | null | required | |
| webhook.meta.phone_number | string | null | required | |
| webhook.meta.whatsapp_business_account | string | null | required | |
| webhook.meta.application | string | null | required | |
| webhook.meta.read_at | string (date-time) | required | |
| webhook.verify_token | string | null | required | |
| webhook.relay_secret | string | null | required | |
| webhook.relay | object | required | |
| webhook.relay.last_delivered_at | string (date-time) | null | required | |
| webhook.relay.last_failure | object | null | required | |
| is_test | boolean | required | |
| connected_at | string (date-time) | null | required | |
| paused | object | null | required | Set when this number is paused because the plan includes fewer numbers than are connected: since when, and how many numbers the plan includes. A paused number sends nothing through Cosend and starts no automation, AI receptionist or recipe, and every send from it is refused with plan_does_not_include. It still receives and stores messages, keeps its history, contacts, templates and settings, stays connected at Meta, and counts as a connected number. Upgrading, or removing another number, brings it back at once. null when the number is not paused. |
| paused.reason | "plan_limit" | required | |
| paused.since | string (date-time) | required | |
| paused.plan_includes | integer | required | |
| registered_at | string (date-time) | null | required | |
| register_deadline_at | string (date-time) | null | required | |
| register_blocked_until | string (date-time) | null | required | |
| display_name_status | string | null | required | |
| display_name | object | required | |
| display_name.current | string | null | required | |
| display_name.requested | string | null | required | |
| display_name.status | "approved" | "not_reviewed" | "pending_review" | "declined" | "not_set" | required | |
| display_name.applied | boolean | null | required | |
| display_name.reason | string | null | required | |
| display_name.updated_at | string (date-time) | null | required | |
| display_name.meta_status | string | null | required | |
| display_name.meta_status_since | string (date-time) | null | required | |
| display_name.meta_review | string | null | required | |
| display_name.meta_review_since | string (date-time) | null | required | |
| display_name.read_at | string (date-time) | null | required | |
| display_name.decision | object | null | required | |
| display_name.decision.value | string | required | |
| display_name.decision.name | string | null | required | |
| display_name.decision.reason_code | string | null | required | |
| display_name.decision.reason | string | null | required | |
| display_name.decision.at | string (date-time) | required | |
| display_name.refusal | object | null | required | |
| display_name.refusal.message | string | null | required | |
| display_name.refusal.at | string (date-time) | required | |
| display_name.applied_at | string (date-time) | null | required | |
| display_name.apply_by | string (date-time) | null | required | |
| display_name.submitted | object | null | required | |
| display_name.submitted.name | string | required | |
| display_name.submitted.at | string (date-time) | required | |
| display_name.submitted.by | "owner" | "cosend" | required | |
| display_name.submitted.refusal | string | null | required | |
| display_name.submissions_in_30_days | integer | required | |
| display_name.next | object | required | |
| display_name.next.action | "none" | "applying" | "waiting" | "asking" | "verify_business" | "submit_name" | "submit_different_name" | "submit_by_hand" | … | required | |
| display_name.next.owner | boolean | required | |
| display_name.next.sentence | string | null | required | |
| display_name.next.until | string (date-time) | null | required | |
| templates_synced_at | string (date-time) | null | required | |
| health | object | null | required | |
| health.checked_at | string (date-time) | required | |
| health.can_send_message | string | null | required | |
| health.read_at | string (date-time) | null | required | |
| health.entities | object[] | required | |
| health.entities[].entity_type | string | null | required | |
| health.entities[].id | string | null | required | |
| health.entities[].can_send_message | string | null | required | |
| health.entities[].can_receive_call_sip | string | null | required | |
| health.entities[].additional_info | string[] | required | |
| health.entities[].errors | object[] | required | |
| health.token | object | null | required | |
| health.token.status | "valid" | "invalid" | "missing_permissions" | "unreachable" | required | |
| health.token.missing_scopes | string[] | required | |
| health.token.expires_at | string (date-time) | null | required | |
| health.token.reason | string | null | required | |
| health.token.action | string | null | required | |
| health.subscription | object | null | required | |
| health.subscription.status | "subscribed" | "not_subscribed" | "unreachable" | required | |
| health.subscription.reason | string | null | required | |
| health.subscription.action | string | null | required | |
| health.can_send | object | null | required | |
| health.can_send.status | "available" | "limited" | "blocked" | "unreachable" | required | |
| health.can_send.reason | string | null | required | |
| health.can_send.action | string | null | required | |
| sending | object | required | |
| sending.status | "can_send" | "limited" | "cannot_send" | "unknown" | required | |
| sending.checked_at | string (date-time) | null | required | |
| sending.problems | object[] | required | |
| sending.problems[].code | string | required | |
| sending.problems[].entity | "number" | "whatsapp_account" | "business" | "app" | "token" | "subscription" | required | |
| sending.problems[].severity | "blocks" | "limits" | "info" | required | |
| sending.problems[].meta | object | required | |
| sending.problems[].title | string | null | required | |
| sending.problems[].sentence | string | null | required | |
| sending.problems[].limit | string | null | required | |
| sending.problems[].causes | object[] | null | required | |
| sending.problems[].fix | object | required | |
| business_verification | object | required | |
| business_verification.status | string | null | required | |
| business_verification.since | string (date-time) | null | required | |
| business_verification.checked_at | string (date-time) | null | required | |
| business_verification.business_id | string | null | required | |
| business_verification.business_name | string | null | required | |
| business_verification.messaging_limit | string | null | required | |
| business_verification.messaging_limit_read_at | string (date-time) | null | required | |
| business_verification.meta | object | null | required | |
| business_verification.meta.description | string | null | required | |
| business_verification.meta.solution | string | null | required | |
| business_verification.alerts | object[] | required | |
| business_verification.alerts[].type | string | required | |
| business_verification.alerts[].severity | string | null | required | |
| business_verification.alerts[].status | string | null | required | |
| business_verification.alerts[].description | string | null | required | |
| business_verification.alerts[].entity_type | string | null | required | |
| business_verification.alerts[].entity_id | string | null | required | |
| business_verification.alerts[].received_at | string (date-time) | required | |
| business_verification.delay | string | null | required | |
| onboarding | object | null | required | |
| onboarding.status | "pending" | "syncing" | "complete" | "expired" | "failed" | "offboarded" | required | |
| onboarding.history_state | "NOT_REQUESTED" | "REQUESTED" | "STREAMING" | "COMPLETE" | "DECLINED" | "MISSED_WINDOW" | "FAILED" | "SKIPPED" | required | |
| onboarding.progress_pct | integer | required | |
| onboarding.messages_synced | integer | required | |
| onboarding.contacts_synced | integer | required | |
| onboarding.sync_deadline_at | string (date-time) | required |
Errors plan_does_not_include
GET /v1/connections/{id}/hours
The time zone a campaign on this number is scheduled in
Scopes connections:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "connection_hours" | required | |
| connection_id | string | required | |
| timezone | string | required | |
| timezone_from | "whatsapp_account" | "workspace" | required |
GET /v1/connections/{id}/onboarding
History-import progress, as polled by an onboarding screen
Scopes connections:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "onboarding" | required | |
| connection_id | string | required | |
| status | "pending" | "syncing" | "complete" | "expired" | "failed" | "offboarded" | required | |
| history_state | "NOT_REQUESTED" | "REQUESTED" | "STREAMING" | "COMPLETE" | "DECLINED" | "MISSED_WINDOW" | "FAILED" | "SKIPPED" | required | |
| progress_pct | integer | required | |
| contacts_synced | integer | required | |
| messages_synced | integer | required | |
| threads_synced | integer | required | |
| media_total | integer | required | |
| media_stored | integer | required | |
| media_unavailable | integer | required | |
| contacts_requested_at | string (date-time) | null | required | |
| contacts_completed_at | string (date-time) | null | required | |
| history_requested_at | string (date-time) | null | required | |
| history_completed_at | string (date-time) | null | required | |
| onboarded_at | string (date-time) | required | |
| sync_deadline_at | string (date-time) | required | |
| media_window_ends_at | string (date-time) | required | |
| history_horizon_at | string (date-time) | required | |
| error | object | null | required | |
| error.meta_code | integer | null | required | |
| error.reason | string | required | |
| error.message | string | required |
GET /v1/connections/{id}/order-settings
How a number sells: delivery fees and zones, payment methods, and the order switches
Scopes messages:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "order_settings" | required | |
| connection_id | string | required | |
| set_up | boolean | required | False until the settings are first saved. |
| ai_drafts | boolean | required | |
| payment_methods | ("cod" | "payment_link" | "bank_transfer")[] | required | |
| delivery_fee | string | null | required | |
| delivery_time | string | null | required | How long delivery takes anywhere (with zones: anywhere else), as the business tells customers. Null: not said. |
| delivery_zones | object[] | required | |
| delivery_zones[].name | string | required | |
| delivery_zones[].cities | string[] | required | |
| delivery_zones[].fee | string | required | |
| delivery_zones[].cod | boolean | required | Cash on delivery is taken in this zone. |
| delivery_zones[].delivery_time | string | null | required | How long delivery takes in this zone, as the business tells customers. Null: not said. |
| confirm_before_shipping | boolean | required | |
| reminder_hours | integer | required | |
| deposit | object | null | required | |
| deposit.kind | "amount" | "percent" | required | |
| deposit.value | string | required | |
| deposit.first_order | boolean | required | Asked of a customer’s first order. |
| deposit.above | string | null | required | Asked of an order whose total is above this. |
| deposit.cities | string[] | required | |
| seller_confirm_by | "email" | "whatsapp" | required | |
| seller_whatsapp | string | null | required | |
| delivery_messages | boolean | required | |
| sheets | object | null | required | The Google Sheets order sync: one row per order on the Orders tab, one per customer on the Customers tab, written on every change. Null: off. |
| sheets.account_id | string | required | A Google Sheets account (ca_ id) used on this number. |
| sheets.spreadsheet_id | string | required | Google’s id of the spreadsheet, as the picker gives it. |
| whatsapp_alerts_available | boolean | required | |
| before_customer_gets_it | "ask_first" | "send_right_away" | required | |
| ready_made_templates | object[] | required | |
| ready_made_templates[].name | string | required | |
| ready_made_templates[].language | string | required | |
| ready_made_templates[].category | "UTILITY" | required | |
| ready_made_templates[].body | string | required | |
| ready_made_templates[].buttons | string[] | required | |
| ready_made_templates[].status | string | null | required | Its status on this number, or null when the number does not have it. |
PATCH /v1/connections/{id}/order-settings
Set how a number sells: delivery fees and zones, payment methods, and the order switches
Scopes messages:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | optional |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| ai_drafts | boolean | optional | |
| payment_methods | ("cod" | "payment_link" | "bank_transfer")[] | optional | |
| delivery_fee | string | null | optional | |
| delivery_time | string | null | optional | How long delivery takes, as you tell customers, like "2 to 3 business days". Null or empty: not said. |
| delivery_zones | object[] | optional | |
| delivery_zones[].name | string | required | |
| delivery_zones[].cities | string[] | required | |
| delivery_zones[].fee | string | required | |
| delivery_zones[].cod | boolean | required | Cash on delivery is taken in this zone. |
| delivery_zones[].delivery_time | string | null | optional | How long delivery takes, as you tell customers, like "2 to 3 business days". Null or empty: not said. |
| confirm_before_shipping | boolean | optional | |
| reminder_hours | integer | optional | |
| deposit | object | null | optional | |
| deposit.kind | "amount" | "percent" | required | |
| deposit.value | string | required | |
| deposit.first_order | boolean | required | Asked of a customer’s first order. |
| deposit.above | string | null | required | Asked of an order whose total is above this. |
| deposit.cities | string[] | required | |
| seller_confirm_by | "email" | "whatsapp" | optional | |
| seller_whatsapp | string | null | optional | |
| delivery_messages | boolean | optional | |
| sheets | object | null | optional | |
| sheets.account_id | string | required | A Google Sheets account (ca_ id) used on this number. |
| sheets.spreadsheet_id | string | required | Google’s id of the spreadsheet, as the picker gives it. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "order_settings" | required | |
| connection_id | string | required | |
| set_up | boolean | required | False until the settings are first saved. |
| ai_drafts | boolean | required | |
| payment_methods | ("cod" | "payment_link" | "bank_transfer")[] | required | |
| delivery_fee | string | null | required | |
| delivery_time | string | null | required | How long delivery takes anywhere (with zones: anywhere else), as the business tells customers. Null: not said. |
| delivery_zones | object[] | required | |
| delivery_zones[].name | string | required | |
| delivery_zones[].cities | string[] | required | |
| delivery_zones[].fee | string | required | |
| delivery_zones[].cod | boolean | required | Cash on delivery is taken in this zone. |
| delivery_zones[].delivery_time | string | null | required | How long delivery takes in this zone, as the business tells customers. Null: not said. |
| confirm_before_shipping | boolean | required | |
| reminder_hours | integer | required | |
| deposit | object | null | required | |
| deposit.kind | "amount" | "percent" | required | |
| deposit.value | string | required | |
| deposit.first_order | boolean | required | Asked of a customer’s first order. |
| deposit.above | string | null | required | Asked of an order whose total is above this. |
| deposit.cities | string[] | required | |
| seller_confirm_by | "email" | "whatsapp" | required | |
| seller_whatsapp | string | null | required | |
| delivery_messages | boolean | required | |
| sheets | object | null | required | The Google Sheets order sync: one row per order on the Orders tab, one per customer on the Customers tab, written on every change. Null: off. |
| sheets.account_id | string | required | A Google Sheets account (ca_ id) used on this number. |
| sheets.spreadsheet_id | string | required | Google’s id of the spreadsheet, as the picker gives it. |
| whatsapp_alerts_available | boolean | required | |
| before_customer_gets_it | "ask_first" | "send_right_away" | required | |
| ready_made_templates | object[] | required | |
| ready_made_templates[].name | string | required | |
| ready_made_templates[].language | string | required | |
| ready_made_templates[].category | "UTILITY" | required | |
| ready_made_templates[].body | string | required | |
| ready_made_templates[].buttons | string[] | required | |
| ready_made_templates[].status | string | null | required | Its status on this number, or null when the number does not have it. |
POST /v1/connections/{id}/payment-check
A payment method was added in Meta: a number blocked for payment sends again
Scopes messages:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "connection" | required | |
| phone_number_id | string | required | |
| waba_id | string | required | The WhatsApp Business Account this number is on, as Cosend's wab_ id: the waba_id templates carry, and what GET /v1/templates?waba_id= and POST /v1/templates/{id}/copy take. Meta's id for it is meta_waba_id. |
| meta_waba_id | string | required | Meta's id for the WhatsApp Business Account this number is on, as Meta's Graph API and WhatsApp Manager show it. Cosend's id for it is waba_id. |
| display_phone_number | string | required | |
| phone_e164 | string | required | |
| verified_name | string | null | required | |
| mode | "coexistence" | "cloud_api" | required | |
| status | "pending" | "active" | "needs_reauth" | "payment_blocked" | "restricted" | "disconnected" | "offboarded" | required | |
| status_reason | string | null | required | |
| status_message | string | null | required | |
| token_verification | "verified" | "stale" | "never" | "invalid" | required | |
| throughput_mps | integer | required | |
| quality_rating | string | null | required | |
| quality_rating_previous | string | null | required | |
| quality_changed_at | string (date-time) | null | required | |
| messaging_limit | string | null | required | |
| meta_business_id | string | null | required | |
| last_app_activity_at | string (date-time) | null | required | |
| delivery_mode | "stored" | "direct" | required | |
| import_contacts | boolean | required | Whether Cosend imports contacts from the phone's address book, as chosen when the number was connected. Read-only. |
| override_callback_url | string | null | required | Your endpoint for Meta’s webhooks for this number. On a direct number Cosend sets it as the number’s webhook override at Meta, and Meta sends the number’s messages, echoes, calls and history to it itself; Meta checks it first with webhook.verify_token, and keeps template and account webhooks on Cosend. On a stored number Cosend receives and keeps every change and relays each one to it in Meta’s envelope, signed X-Cosend-Signature-256: sha256=<HMAC-SHA256 of the body with webhook.relay_secret>, retried with back-off until a 2xx. null clears it. |
| orders_and_bookings | "ask_me_first" | "send_right_away" | required | Before your customer gets an order or booking the AI receptionist made. ask_me_first (the default): it waits for a person to check it and tap Send (POST /v1/receptionist-actions/{id}/send), then the customer gets it and taps Confirm. send_right_away: the customer gets it at once and taps Confirm. Cancellations, payment links, refunds and order changes go straight to the customer’s Confirm either way. |
| webhook | object | required | |
| webhook.meta | object | null | required | |
| webhook.meta.phone_number | string | null | required | |
| webhook.meta.whatsapp_business_account | string | null | required | |
| webhook.meta.application | string | null | required | |
| webhook.meta.read_at | string (date-time) | required | |
| webhook.verify_token | string | null | required | |
| webhook.relay_secret | string | null | required | |
| webhook.relay | object | required | |
| webhook.relay.last_delivered_at | string (date-time) | null | required | |
| webhook.relay.last_failure | object | null | required | |
| is_test | boolean | required | |
| connected_at | string (date-time) | null | required | |
| paused | object | null | required | Set when this number is paused because the plan includes fewer numbers than are connected: since when, and how many numbers the plan includes. A paused number sends nothing through Cosend and starts no automation, AI receptionist or recipe, and every send from it is refused with plan_does_not_include. It still receives and stores messages, keeps its history, contacts, templates and settings, stays connected at Meta, and counts as a connected number. Upgrading, or removing another number, brings it back at once. null when the number is not paused. |
| paused.reason | "plan_limit" | required | |
| paused.since | string (date-time) | required | |
| paused.plan_includes | integer | required | |
| registered_at | string (date-time) | null | required | |
| register_deadline_at | string (date-time) | null | required | |
| register_blocked_until | string (date-time) | null | required | |
| display_name_status | string | null | required | |
| display_name | object | required | |
| display_name.current | string | null | required | |
| display_name.requested | string | null | required | |
| display_name.status | "approved" | "not_reviewed" | "pending_review" | "declined" | "not_set" | required | |
| display_name.applied | boolean | null | required | |
| display_name.reason | string | null | required | |
| display_name.updated_at | string (date-time) | null | required | |
| display_name.meta_status | string | null | required | |
| display_name.meta_status_since | string (date-time) | null | required | |
| display_name.meta_review | string | null | required | |
| display_name.meta_review_since | string (date-time) | null | required | |
| display_name.read_at | string (date-time) | null | required | |
| display_name.decision | object | null | required | |
| display_name.decision.value | string | required | |
| display_name.decision.name | string | null | required | |
| display_name.decision.reason_code | string | null | required | |
| display_name.decision.reason | string | null | required | |
| display_name.decision.at | string (date-time) | required | |
| display_name.refusal | object | null | required | |
| display_name.refusal.message | string | null | required | |
| display_name.refusal.at | string (date-time) | required | |
| display_name.applied_at | string (date-time) | null | required | |
| display_name.apply_by | string (date-time) | null | required | |
| display_name.submitted | object | null | required | |
| display_name.submitted.name | string | required | |
| display_name.submitted.at | string (date-time) | required | |
| display_name.submitted.by | "owner" | "cosend" | required | |
| display_name.submitted.refusal | string | null | required | |
| display_name.submissions_in_30_days | integer | required | |
| display_name.next | object | required | |
| display_name.next.action | "none" | "applying" | "waiting" | "asking" | "verify_business" | "submit_name" | "submit_different_name" | "submit_by_hand" | … | required | |
| display_name.next.owner | boolean | required | |
| display_name.next.sentence | string | null | required | |
| display_name.next.until | string (date-time) | null | required | |
| templates_synced_at | string (date-time) | null | required | |
| health | object | null | required | |
| health.checked_at | string (date-time) | required | |
| health.can_send_message | string | null | required | |
| health.read_at | string (date-time) | null | required | |
| health.entities | object[] | required | |
| health.entities[].entity_type | string | null | required | |
| health.entities[].id | string | null | required | |
| health.entities[].can_send_message | string | null | required | |
| health.entities[].can_receive_call_sip | string | null | required | |
| health.entities[].additional_info | string[] | required | |
| health.entities[].errors | object[] | required | |
| health.token | object | null | required | |
| health.token.status | "valid" | "invalid" | "missing_permissions" | "unreachable" | required | |
| health.token.missing_scopes | string[] | required | |
| health.token.expires_at | string (date-time) | null | required | |
| health.token.reason | string | null | required | |
| health.token.action | string | null | required | |
| health.subscription | object | null | required | |
| health.subscription.status | "subscribed" | "not_subscribed" | "unreachable" | required | |
| health.subscription.reason | string | null | required | |
| health.subscription.action | string | null | required | |
| health.can_send | object | null | required | |
| health.can_send.status | "available" | "limited" | "blocked" | "unreachable" | required | |
| health.can_send.reason | string | null | required | |
| health.can_send.action | string | null | required | |
| sending | object | required | |
| sending.status | "can_send" | "limited" | "cannot_send" | "unknown" | required | |
| sending.checked_at | string (date-time) | null | required | |
| sending.problems | object[] | required | |
| sending.problems[].code | string | required | |
| sending.problems[].entity | "number" | "whatsapp_account" | "business" | "app" | "token" | "subscription" | required | |
| sending.problems[].severity | "blocks" | "limits" | "info" | required | |
| sending.problems[].meta | object | required | |
| sending.problems[].title | string | null | required | |
| sending.problems[].sentence | string | null | required | |
| sending.problems[].limit | string | null | required | |
| sending.problems[].causes | object[] | null | required | |
| sending.problems[].fix | object | required | |
| business_verification | object | required | |
| business_verification.status | string | null | required | |
| business_verification.since | string (date-time) | null | required | |
| business_verification.checked_at | string (date-time) | null | required | |
| business_verification.business_id | string | null | required | |
| business_verification.business_name | string | null | required | |
| business_verification.messaging_limit | string | null | required | |
| business_verification.messaging_limit_read_at | string (date-time) | null | required | |
| business_verification.meta | object | null | required | |
| business_verification.meta.description | string | null | required | |
| business_verification.meta.solution | string | null | required | |
| business_verification.alerts | object[] | required | |
| business_verification.alerts[].type | string | required | |
| business_verification.alerts[].severity | string | null | required | |
| business_verification.alerts[].status | string | null | required | |
| business_verification.alerts[].description | string | null | required | |
| business_verification.alerts[].entity_type | string | null | required | |
| business_verification.alerts[].entity_id | string | null | required | |
| business_verification.alerts[].received_at | string (date-time) | required | |
| business_verification.delay | string | null | required | |
| onboarding | object | null | required | |
| onboarding.status | "pending" | "syncing" | "complete" | "expired" | "failed" | "offboarded" | required | |
| onboarding.history_state | "NOT_REQUESTED" | "REQUESTED" | "STREAMING" | "COMPLETE" | "DECLINED" | "MISSED_WINDOW" | "FAILED" | "SKIPPED" | required | |
| onboarding.progress_pct | integer | required | |
| onboarding.messages_synced | integer | required | |
| onboarding.contacts_synced | integer | required | |
| onboarding.sync_deadline_at | string (date-time) | required |
Errors plan_does_not_include
GET /v1/connections/{id}/profile
The WhatsApp business profile customers see, read from Meta
Scopes connections:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| about | string | null | required | |
| description | string | null | required | |
| address | string | null | required | |
| string | null | required | ||
| websites | string[] | required | |
| vertical | "alcohol" | "apparel" | "automotive" | "beauty" | "education" | "entertainment" | "event_planning" | "finance" | … | null | required | |
| vertical_meta_value | string | null | required | |
| profile_picture_url | string | null | required | |
| read_only_reason | string | null | required |
PATCH /v1/connections/{id}/profile
Edit the WhatsApp business profile: about, description, address, email, websites, industry, picture
Scopes connections:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| about | string | optional | |
| description | string | null | optional | |
| address | string | null | optional | |
| string | null | optional | ||
| websites | string (uri)[] | optional | |
| vertical | "alcohol" | "apparel" | "automotive" | "beauty" | "education" | "entertainment" | "event_planning" | "finance" | … | null | optional | |
| profile_picture | object | optional | |
| profile_picture.media_id | string | required |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| about | string | null | required | |
| description | string | null | required | |
| address | string | null | required | |
| string | null | required | ||
| websites | string[] | required | |
| vertical | "alcohol" | "apparel" | "automotive" | "beauty" | "education" | "entertainment" | "event_planning" | "finance" | … | null | required | |
| vertical_meta_value | string | null | required | |
| profile_picture_url | string | null | required | |
| read_only_reason | string | null | required |
GET /v1/connections/{id}/quote-settings
A number’s quote settings: the questions a quote needs and the PDF’s logo
Scopes messages:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "quote_settings" | required | |
| connection_id | string | required | |
| questions | object[] | required | |
| questions[].key | string | required | |
| questions[].label | string | required | |
| logo_media_id | string | null | required |
PATCH /v1/connections/{id}/quote-settings
Set a number’s quote settings: the questions a quote needs and the PDF’s logo
Scopes messages:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | optional |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| questions | object[] | optional | What a quote needs to know, in the seller’s words: origin, weight, date. |
| questions[].key | string | required | |
| questions[].label | string | required | |
| logo_media_id | string | null | optional | A PNG or JPEG uploaded for this number with POST /v1/media, drawn on the PDF. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "quote_settings" | required | |
| connection_id | string | required | |
| questions | object[] | required | |
| questions[].key | string | required | |
| questions[].label | string | required | |
| logo_media_id | string | null | required |
POST /v1/connections/{id}/reauth
The URL and Embedded Signup parameters for re-running the flow
Scopes connections:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| connection_id | string | required | |
| url | string | required | |
| config_id | string | required |
GET /v1/connections/{id}/reply-order
The order a WhatsApp number’s automations answer a customer’s message in. Read-only: change the automations to change it
Scopes automations:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| order | object[] | required | The switched-on automations on this number that answer a customer’s message, in the order a message is offered to them: by step, then the one set up first. Automations that do not answer (they tag, file a row) are not listed. |
| order[].step | "tapped" | "waiting" | "claims" | "every_message" | required | Where in the order it answers, from what it declares. tapped: it declares nothing, so it answers a tap on a button it sent, and a message no automation on the number answers. waiting: a customer it is waiting on for an answer. claims: a message its start condition names (its claims, which may be empty when the words cannot be read off it); it also answers a customer it is waiting on. every_message: any message. A tap always goes to the automation that sent the button, and a customer one is waiting on to that one, before the later steps. |
| order[].automation_id | string | required | |
| order[].name | string | required | |
| order[].claims | string[] | required | On step claims: each is a keyword, in lower case, or ad:<ad id> for the Click-to-WhatsApp ad a message came from; ad:* is any ad. Empty on the other steps. |
| order[].answers | true | required | |
| order[].shadowed_by | string | null | required | On step every_message: the automation that answers every message instead of this one, which is the first one set up. null for that first one and on the other steps. |
| updated_from | "automations" | required |
POST /v1/connections/{id}/sync
Refresh number state, quality and limits from Meta
Scopes connections:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "connection" | required | |
| phone_number_id | string | required | |
| waba_id | string | required | The WhatsApp Business Account this number is on, as Cosend's wab_ id: the waba_id templates carry, and what GET /v1/templates?waba_id= and POST /v1/templates/{id}/copy take. Meta's id for it is meta_waba_id. |
| meta_waba_id | string | required | Meta's id for the WhatsApp Business Account this number is on, as Meta's Graph API and WhatsApp Manager show it. Cosend's id for it is waba_id. |
| display_phone_number | string | required | |
| phone_e164 | string | required | |
| verified_name | string | null | required | |
| mode | "coexistence" | "cloud_api" | required | |
| status | "pending" | "active" | "needs_reauth" | "payment_blocked" | "restricted" | "disconnected" | "offboarded" | required | |
| status_reason | string | null | required | |
| status_message | string | null | required | |
| token_verification | "verified" | "stale" | "never" | "invalid" | required | |
| throughput_mps | integer | required | |
| quality_rating | string | null | required | |
| quality_rating_previous | string | null | required | |
| quality_changed_at | string (date-time) | null | required | |
| messaging_limit | string | null | required | |
| meta_business_id | string | null | required | |
| last_app_activity_at | string (date-time) | null | required | |
| delivery_mode | "stored" | "direct" | required | |
| import_contacts | boolean | required | Whether Cosend imports contacts from the phone's address book, as chosen when the number was connected. Read-only. |
| override_callback_url | string | null | required | Your endpoint for Meta’s webhooks for this number. On a direct number Cosend sets it as the number’s webhook override at Meta, and Meta sends the number’s messages, echoes, calls and history to it itself; Meta checks it first with webhook.verify_token, and keeps template and account webhooks on Cosend. On a stored number Cosend receives and keeps every change and relays each one to it in Meta’s envelope, signed X-Cosend-Signature-256: sha256=<HMAC-SHA256 of the body with webhook.relay_secret>, retried with back-off until a 2xx. null clears it. |
| orders_and_bookings | "ask_me_first" | "send_right_away" | required | Before your customer gets an order or booking the AI receptionist made. ask_me_first (the default): it waits for a person to check it and tap Send (POST /v1/receptionist-actions/{id}/send), then the customer gets it and taps Confirm. send_right_away: the customer gets it at once and taps Confirm. Cancellations, payment links, refunds and order changes go straight to the customer’s Confirm either way. |
| webhook | object | required | |
| webhook.meta | object | null | required | |
| webhook.meta.phone_number | string | null | required | |
| webhook.meta.whatsapp_business_account | string | null | required | |
| webhook.meta.application | string | null | required | |
| webhook.meta.read_at | string (date-time) | required | |
| webhook.verify_token | string | null | required | |
| webhook.relay_secret | string | null | required | |
| webhook.relay | object | required | |
| webhook.relay.last_delivered_at | string (date-time) | null | required | |
| webhook.relay.last_failure | object | null | required | |
| is_test | boolean | required | |
| connected_at | string (date-time) | null | required | |
| paused | object | null | required | Set when this number is paused because the plan includes fewer numbers than are connected: since when, and how many numbers the plan includes. A paused number sends nothing through Cosend and starts no automation, AI receptionist or recipe, and every send from it is refused with plan_does_not_include. It still receives and stores messages, keeps its history, contacts, templates and settings, stays connected at Meta, and counts as a connected number. Upgrading, or removing another number, brings it back at once. null when the number is not paused. |
| paused.reason | "plan_limit" | required | |
| paused.since | string (date-time) | required | |
| paused.plan_includes | integer | required | |
| registered_at | string (date-time) | null | required | |
| register_deadline_at | string (date-time) | null | required | |
| register_blocked_until | string (date-time) | null | required | |
| display_name_status | string | null | required | |
| display_name | object | required | |
| display_name.current | string | null | required | |
| display_name.requested | string | null | required | |
| display_name.status | "approved" | "not_reviewed" | "pending_review" | "declined" | "not_set" | required | |
| display_name.applied | boolean | null | required | |
| display_name.reason | string | null | required | |
| display_name.updated_at | string (date-time) | null | required | |
| display_name.meta_status | string | null | required | |
| display_name.meta_status_since | string (date-time) | null | required | |
| display_name.meta_review | string | null | required | |
| display_name.meta_review_since | string (date-time) | null | required | |
| display_name.read_at | string (date-time) | null | required | |
| display_name.decision | object | null | required | |
| display_name.decision.value | string | required | |
| display_name.decision.name | string | null | required | |
| display_name.decision.reason_code | string | null | required | |
| display_name.decision.reason | string | null | required | |
| display_name.decision.at | string (date-time) | required | |
| display_name.refusal | object | null | required | |
| display_name.refusal.message | string | null | required | |
| display_name.refusal.at | string (date-time) | required | |
| display_name.applied_at | string (date-time) | null | required | |
| display_name.apply_by | string (date-time) | null | required | |
| display_name.submitted | object | null | required | |
| display_name.submitted.name | string | required | |
| display_name.submitted.at | string (date-time) | required | |
| display_name.submitted.by | "owner" | "cosend" | required | |
| display_name.submitted.refusal | string | null | required | |
| display_name.submissions_in_30_days | integer | required | |
| display_name.next | object | required | |
| display_name.next.action | "none" | "applying" | "waiting" | "asking" | "verify_business" | "submit_name" | "submit_different_name" | "submit_by_hand" | … | required | |
| display_name.next.owner | boolean | required | |
| display_name.next.sentence | string | null | required | |
| display_name.next.until | string (date-time) | null | required | |
| templates_synced_at | string (date-time) | null | required | |
| health | object | null | required | |
| health.checked_at | string (date-time) | required | |
| health.can_send_message | string | null | required | |
| health.read_at | string (date-time) | null | required | |
| health.entities | object[] | required | |
| health.entities[].entity_type | string | null | required | |
| health.entities[].id | string | null | required | |
| health.entities[].can_send_message | string | null | required | |
| health.entities[].can_receive_call_sip | string | null | required | |
| health.entities[].additional_info | string[] | required | |
| health.entities[].errors | object[] | required | |
| health.token | object | null | required | |
| health.token.status | "valid" | "invalid" | "missing_permissions" | "unreachable" | required | |
| health.token.missing_scopes | string[] | required | |
| health.token.expires_at | string (date-time) | null | required | |
| health.token.reason | string | null | required | |
| health.token.action | string | null | required | |
| health.subscription | object | null | required | |
| health.subscription.status | "subscribed" | "not_subscribed" | "unreachable" | required | |
| health.subscription.reason | string | null | required | |
| health.subscription.action | string | null | required | |
| health.can_send | object | null | required | |
| health.can_send.status | "available" | "limited" | "blocked" | "unreachable" | required | |
| health.can_send.reason | string | null | required | |
| health.can_send.action | string | null | required | |
| sending | object | required | |
| sending.status | "can_send" | "limited" | "cannot_send" | "unknown" | required | |
| sending.checked_at | string (date-time) | null | required | |
| sending.problems | object[] | required | |
| sending.problems[].code | string | required | |
| sending.problems[].entity | "number" | "whatsapp_account" | "business" | "app" | "token" | "subscription" | required | |
| sending.problems[].severity | "blocks" | "limits" | "info" | required | |
| sending.problems[].meta | object | required | |
| sending.problems[].title | string | null | required | |
| sending.problems[].sentence | string | null | required | |
| sending.problems[].limit | string | null | required | |
| sending.problems[].causes | object[] | null | required | |
| sending.problems[].fix | object | required | |
| business_verification | object | required | |
| business_verification.status | string | null | required | |
| business_verification.since | string (date-time) | null | required | |
| business_verification.checked_at | string (date-time) | null | required | |
| business_verification.business_id | string | null | required | |
| business_verification.business_name | string | null | required | |
| business_verification.messaging_limit | string | null | required | |
| business_verification.messaging_limit_read_at | string (date-time) | null | required | |
| business_verification.meta | object | null | required | |
| business_verification.meta.description | string | null | required | |
| business_verification.meta.solution | string | null | required | |
| business_verification.alerts | object[] | required | |
| business_verification.alerts[].type | string | required | |
| business_verification.alerts[].severity | string | null | required | |
| business_verification.alerts[].status | string | null | required | |
| business_verification.alerts[].description | string | null | required | |
| business_verification.alerts[].entity_type | string | null | required | |
| business_verification.alerts[].entity_id | string | null | required | |
| business_verification.alerts[].received_at | string (date-time) | required | |
| business_verification.delay | string | null | required | |
| onboarding | object | null | required | |
| onboarding.status | "pending" | "syncing" | "complete" | "expired" | "failed" | "offboarded" | required | |
| onboarding.history_state | "NOT_REQUESTED" | "REQUESTED" | "STREAMING" | "COMPLETE" | "DECLINED" | "MISSED_WINDOW" | "FAILED" | "SKIPPED" | required | |
| onboarding.progress_pct | integer | required | |
| onboarding.messages_synced | integer | required | |
| onboarding.contacts_synced | integer | required | |
| onboarding.sync_deadline_at | string (date-time) | required |
Errors plan_does_not_include
GET /v1/connections/{id}/timeline
The steps of this connection’s connect, with times and outcomes
Scopes connections:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "connect_timeline" | required | |
| attempt_id | string | required | |
| connection_id | string | null | required | |
| onboarding_id | string | null | required | |
| mode | "coexistence" | "cloud_api" | required | |
| attempt_status | "connecting" | "connected" | "needs_attention" | required | |
| attempt_step | "grant" | "account" | "numbers" | "persist" | "subscribe" | "register" | "sync" | "done" | required | |
| onboarding_status | "pending" | "syncing" | "complete" | "expired" | "failed" | "offboarded" | null | required | |
| onboarded_at | string (date-time) | null | required | |
| sync_deadline_at | string (date-time) | null | required | |
| media_total | integer | null | required | |
| media_stored | integer | null | required | |
| media_unavailable | integer | null | required | |
| steps | object[] | required | |
| steps[].key | "exchange" | "saved" | "grant" | "account" | "numbers" | "persist" | "subscribe" | "register" | … | required | |
| steps[].title | string | required | |
| steps[].state | "done" | "active" | "waiting" | "stopped" | "failed" | "skipped" | "passed" | required | |
| steps[].at | string (date-time) | null | required | |
| steps[].due_at | string (date-time) | null | required | |
| steps[].armed | boolean | null | required | |
| steps[].outcome | string | null | required | |
| steps[].log_event | string | null | required | |
| steps[].meta_request_id | string | null | required | |
| steps[].counts | object | null | required | |
| steps[].counts.chunks_received | integer | required | |
| steps[].counts.chunks_applied | integer | required | |
| steps[].counts.chunks_failed | integer | required | |
| steps[].counts.messages | integer | required | |
| steps[].counts.last_received_at | string (date-time) | null | required |
POST /v1/connections/{id}/two-step-pin
Set a new two-step verification PIN for a number Cosend registered
Scopes connections:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| pin | string | required |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "connection" | required | |
| phone_number_id | string | required | |
| waba_id | string | required | The WhatsApp Business Account this number is on, as Cosend's wab_ id: the waba_id templates carry, and what GET /v1/templates?waba_id= and POST /v1/templates/{id}/copy take. Meta's id for it is meta_waba_id. |
| meta_waba_id | string | required | Meta's id for the WhatsApp Business Account this number is on, as Meta's Graph API and WhatsApp Manager show it. Cosend's id for it is waba_id. |
| display_phone_number | string | required | |
| phone_e164 | string | required | |
| verified_name | string | null | required | |
| mode | "coexistence" | "cloud_api" | required | |
| status | "pending" | "active" | "needs_reauth" | "payment_blocked" | "restricted" | "disconnected" | "offboarded" | required | |
| status_reason | string | null | required | |
| status_message | string | null | required | |
| token_verification | "verified" | "stale" | "never" | "invalid" | required | |
| throughput_mps | integer | required | |
| quality_rating | string | null | required | |
| quality_rating_previous | string | null | required | |
| quality_changed_at | string (date-time) | null | required | |
| messaging_limit | string | null | required | |
| meta_business_id | string | null | required | |
| last_app_activity_at | string (date-time) | null | required | |
| delivery_mode | "stored" | "direct" | required | |
| import_contacts | boolean | required | Whether Cosend imports contacts from the phone's address book, as chosen when the number was connected. Read-only. |
| override_callback_url | string | null | required | Your endpoint for Meta’s webhooks for this number. On a direct number Cosend sets it as the number’s webhook override at Meta, and Meta sends the number’s messages, echoes, calls and history to it itself; Meta checks it first with webhook.verify_token, and keeps template and account webhooks on Cosend. On a stored number Cosend receives and keeps every change and relays each one to it in Meta’s envelope, signed X-Cosend-Signature-256: sha256=<HMAC-SHA256 of the body with webhook.relay_secret>, retried with back-off until a 2xx. null clears it. |
| orders_and_bookings | "ask_me_first" | "send_right_away" | required | Before your customer gets an order or booking the AI receptionist made. ask_me_first (the default): it waits for a person to check it and tap Send (POST /v1/receptionist-actions/{id}/send), then the customer gets it and taps Confirm. send_right_away: the customer gets it at once and taps Confirm. Cancellations, payment links, refunds and order changes go straight to the customer’s Confirm either way. |
| webhook | object | required | |
| webhook.meta | object | null | required | |
| webhook.meta.phone_number | string | null | required | |
| webhook.meta.whatsapp_business_account | string | null | required | |
| webhook.meta.application | string | null | required | |
| webhook.meta.read_at | string (date-time) | required | |
| webhook.verify_token | string | null | required | |
| webhook.relay_secret | string | null | required | |
| webhook.relay | object | required | |
| webhook.relay.last_delivered_at | string (date-time) | null | required | |
| webhook.relay.last_failure | object | null | required | |
| is_test | boolean | required | |
| connected_at | string (date-time) | null | required | |
| paused | object | null | required | Set when this number is paused because the plan includes fewer numbers than are connected: since when, and how many numbers the plan includes. A paused number sends nothing through Cosend and starts no automation, AI receptionist or recipe, and every send from it is refused with plan_does_not_include. It still receives and stores messages, keeps its history, contacts, templates and settings, stays connected at Meta, and counts as a connected number. Upgrading, or removing another number, brings it back at once. null when the number is not paused. |
| paused.reason | "plan_limit" | required | |
| paused.since | string (date-time) | required | |
| paused.plan_includes | integer | required | |
| registered_at | string (date-time) | null | required | |
| register_deadline_at | string (date-time) | null | required | |
| register_blocked_until | string (date-time) | null | required | |
| display_name_status | string | null | required | |
| display_name | object | required | |
| display_name.current | string | null | required | |
| display_name.requested | string | null | required | |
| display_name.status | "approved" | "not_reviewed" | "pending_review" | "declined" | "not_set" | required | |
| display_name.applied | boolean | null | required | |
| display_name.reason | string | null | required | |
| display_name.updated_at | string (date-time) | null | required | |
| display_name.meta_status | string | null | required | |
| display_name.meta_status_since | string (date-time) | null | required | |
| display_name.meta_review | string | null | required | |
| display_name.meta_review_since | string (date-time) | null | required | |
| display_name.read_at | string (date-time) | null | required | |
| display_name.decision | object | null | required | |
| display_name.decision.value | string | required | |
| display_name.decision.name | string | null | required | |
| display_name.decision.reason_code | string | null | required | |
| display_name.decision.reason | string | null | required | |
| display_name.decision.at | string (date-time) | required | |
| display_name.refusal | object | null | required | |
| display_name.refusal.message | string | null | required | |
| display_name.refusal.at | string (date-time) | required | |
| display_name.applied_at | string (date-time) | null | required | |
| display_name.apply_by | string (date-time) | null | required | |
| display_name.submitted | object | null | required | |
| display_name.submitted.name | string | required | |
| display_name.submitted.at | string (date-time) | required | |
| display_name.submitted.by | "owner" | "cosend" | required | |
| display_name.submitted.refusal | string | null | required | |
| display_name.submissions_in_30_days | integer | required | |
| display_name.next | object | required | |
| display_name.next.action | "none" | "applying" | "waiting" | "asking" | "verify_business" | "submit_name" | "submit_different_name" | "submit_by_hand" | … | required | |
| display_name.next.owner | boolean | required | |
| display_name.next.sentence | string | null | required | |
| display_name.next.until | string (date-time) | null | required | |
| templates_synced_at | string (date-time) | null | required | |
| health | object | null | required | |
| health.checked_at | string (date-time) | required | |
| health.can_send_message | string | null | required | |
| health.read_at | string (date-time) | null | required | |
| health.entities | object[] | required | |
| health.entities[].entity_type | string | null | required | |
| health.entities[].id | string | null | required | |
| health.entities[].can_send_message | string | null | required | |
| health.entities[].can_receive_call_sip | string | null | required | |
| health.entities[].additional_info | string[] | required | |
| health.entities[].errors | object[] | required | |
| health.token | object | null | required | |
| health.token.status | "valid" | "invalid" | "missing_permissions" | "unreachable" | required | |
| health.token.missing_scopes | string[] | required | |
| health.token.expires_at | string (date-time) | null | required | |
| health.token.reason | string | null | required | |
| health.token.action | string | null | required | |
| health.subscription | object | null | required | |
| health.subscription.status | "subscribed" | "not_subscribed" | "unreachable" | required | |
| health.subscription.reason | string | null | required | |
| health.subscription.action | string | null | required | |
| health.can_send | object | null | required | |
| health.can_send.status | "available" | "limited" | "blocked" | "unreachable" | required | |
| health.can_send.reason | string | null | required | |
| health.can_send.action | string | null | required | |
| sending | object | required | |
| sending.status | "can_send" | "limited" | "cannot_send" | "unknown" | required | |
| sending.checked_at | string (date-time) | null | required | |
| sending.problems | object[] | required | |
| sending.problems[].code | string | required | |
| sending.problems[].entity | "number" | "whatsapp_account" | "business" | "app" | "token" | "subscription" | required | |
| sending.problems[].severity | "blocks" | "limits" | "info" | required | |
| sending.problems[].meta | object | required | |
| sending.problems[].title | string | null | required | |
| sending.problems[].sentence | string | null | required | |
| sending.problems[].limit | string | null | required | |
| sending.problems[].causes | object[] | null | required | |
| sending.problems[].fix | object | required | |
| business_verification | object | required | |
| business_verification.status | string | null | required | |
| business_verification.since | string (date-time) | null | required | |
| business_verification.checked_at | string (date-time) | null | required | |
| business_verification.business_id | string | null | required | |
| business_verification.business_name | string | null | required | |
| business_verification.messaging_limit | string | null | required | |
| business_verification.messaging_limit_read_at | string (date-time) | null | required | |
| business_verification.meta | object | null | required | |
| business_verification.meta.description | string | null | required | |
| business_verification.meta.solution | string | null | required | |
| business_verification.alerts | object[] | required | |
| business_verification.alerts[].type | string | required | |
| business_verification.alerts[].severity | string | null | required | |
| business_verification.alerts[].status | string | null | required | |
| business_verification.alerts[].description | string | null | required | |
| business_verification.alerts[].entity_type | string | null | required | |
| business_verification.alerts[].entity_id | string | null | required | |
| business_verification.alerts[].received_at | string (date-time) | required | |
| business_verification.delay | string | null | required | |
| onboarding | object | null | required | |
| onboarding.status | "pending" | "syncing" | "complete" | "expired" | "failed" | "offboarded" | required | |
| onboarding.history_state | "NOT_REQUESTED" | "REQUESTED" | "STREAMING" | "COMPLETE" | "DECLINED" | "MISSED_WINDOW" | "FAILED" | "SKIPPED" | required | |
| onboarding.progress_pct | integer | required | |
| onboarding.messages_synced | integer | required | |
| onboarding.contacts_synced | integer | required | |
| onboarding.sync_deadline_at | string (date-time) | required |
Errors plan_does_not_include
GET /v1/connections/attempts
The connect attempts of this workspace still connecting or stopped
Scopes connections:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| limit | query | integer | optional | |
| after | query | string | optional | |
| before | query | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].object | "connect_attempt" | required | |
| data[].status | "connecting" | "connected" | "needs_attention" | required | |
| data[].step | "grant" | "account" | "numbers" | "persist" | "subscribe" | "register" | "sync" | "done" | required | |
| data[].connection_id | string | null | required | |
| data[].waba_id | string | null | required | The WhatsApp Business Account, as Cosend's wab_ id (the waba_id its connection carries), from the step that saves the number on; null before. Meta's id for it is meta_waba_id. |
| data[].meta_waba_id | string | null | required | Meta's id for the WhatsApp Business Account, as Embedded Signup and Meta's Graph API give it; null until Meta has named it. Cosend's id for it is waba_id. |
| data[].phone_number_id | string | null | required | |
| data[].mode | "coexistence" | "cloud_api" | required | The path this connect takes: coexistence, a number on the WhatsApp Business app, which stays paired; cloud_api, a number used through the API only. |
| data[].phone_e164 | string | null | required | The number typed in Cosend before Meta’s window (POST /v1/connections/attempts), in E.164. null when none was typed. |
| data[].connected_number | string | null | required | The number Meta connected, in E.164 (+ and digits). null until the attempt is connected. |
| data[].typed_number_matches | boolean | null | required | Whether the number Meta connected is the one typed in Cosend before Meta’s window (POST /v1/connections/attempts), comparing digits only: true when it is, false when Meta connected another number. null when no number was typed or nothing is connected yet. |
| data[].error | object | null | required | |
| data[].error.code | string | required | upstream_unavailable while retrying. When stopped, one of permission_denied, number_in_use, no_number, display_name_rejected, payment_missing or unknown for Meta's answer, choose_number (the sign-in covers several WhatsApp accounts and Cosend could not tell which holds the number: send one of data.choices to POST /v1/connections/attempts/{id}/choose), or Cosend's own code: connection_exists_elsewhere (another workspace has the number), waba_exists_elsewhere (another workspace has the WhatsApp account chosen in Meta's window), plan_does_not_include, two_step_pin_required, number_move_refused, rate_limited, connection_not_found (the number was disconnected while it was being connected), or invalid_request with candidates. |
| data[].error.meta_code | integer | null | required | |
| data[].error.message | string | required | |
| data[].error.candidates | object[] | null | required | |
| data[].error.customer_step | "turn_off_two_step_verification" | "add_payment_method" | null | required | |
| data[].error.waba_name | string | null | required | |
| data[].error.workspace | object | null | required | |
| data[].error.data | object | null | required | |
| data[].created_at | string (date-time) | required | |
| data[].updated_at | string (date-time) | required | |
| data[].finished_at | string (date-time) | null | required | |
| has_more | boolean | required | |
| next_cursor | string | null | required |
Errors connection_exists_elsewhere connection_not_found invalid_request number_move_refused plan_does_not_include rate_limited two_step_pin_required upstream_unavailable waba_exists_elsewhere
POST /v1/connections/attempts
Start connecting your own number: its name on WhatsApp, before Meta’s window
Scopes connections:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| phone_number | string | required | |
| mode | "coexistence" | "cloud_api" | optional | coexistence: a number on the WhatsApp Business app, which needs only phone_number. cloud_api (the default, or the connection’s mode with connection_id): a number not on WhatsApp yet, which also needs display_name and category unless connection_id or moving_from_provider is sent. |
| display_name | string | optional | |
| category | "alcohol" | "apparel" | "automotive" | "beauty" | "education" | "entertainment" | "event_planning" | "finance" | … | optional | |
| website | string (uri) | optional | |
| connection_id | string | optional | A reconnect: this workspace’s connection on phone_number. Its mode is the attempt’s when mode is not sent. |
| moving_from_provider | boolean | optional | true: the number is moving from another provider, which connects as cloud_api. |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| attempt_id | string | required | |
| meta_prefill | object | required | |
| meta_prefill.business | object | optional | |
| meta_prefill.business.id | string | required | |
| meta_prefill.business.name | string | required | |
| meta_prefill.business.email | string | required | |
| meta_prefill.business.website | string | required | |
| meta_prefill.business.address | object | required | |
| meta_prefill.business.timezone | string | required | |
| meta_prefill.business.phone | object | optional | |
| meta_prefill.phone | object | optional | |
| meta_prefill.phone.displayName | string | required | |
| meta_prefill.phone.category | string | required | |
| meta_prefill.phone.description | string | required | |
| meta_prefill.preVerifiedPhone | object | optional | |
| meta_prefill.preVerifiedPhone.ids | string[] | required |
GET /v1/connections/attempts/{id}
One connect attempt, as polled by a connect screen
Scopes connections:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "connect_attempt" | required | |
| status | "connecting" | "connected" | "needs_attention" | required | |
| step | "grant" | "account" | "numbers" | "persist" | "subscribe" | "register" | "sync" | "done" | required | |
| connection_id | string | null | required | |
| waba_id | string | null | required | The WhatsApp Business Account, as Cosend's wab_ id (the waba_id its connection carries), from the step that saves the number on; null before. Meta's id for it is meta_waba_id. |
| meta_waba_id | string | null | required | Meta's id for the WhatsApp Business Account, as Embedded Signup and Meta's Graph API give it; null until Meta has named it. Cosend's id for it is waba_id. |
| phone_number_id | string | null | required | |
| mode | "coexistence" | "cloud_api" | required | The path this connect takes: coexistence, a number on the WhatsApp Business app, which stays paired; cloud_api, a number used through the API only. |
| phone_e164 | string | null | required | The number typed in Cosend before Meta’s window (POST /v1/connections/attempts), in E.164. null when none was typed. |
| connected_number | string | null | required | The number Meta connected, in E.164 (+ and digits). null until the attempt is connected. |
| typed_number_matches | boolean | null | required | Whether the number Meta connected is the one typed in Cosend before Meta’s window (POST /v1/connections/attempts), comparing digits only: true when it is, false when Meta connected another number. null when no number was typed or nothing is connected yet. |
| error | object | null | required | |
| error.code | string | required | upstream_unavailable while retrying. When stopped, one of permission_denied, number_in_use, no_number, display_name_rejected, payment_missing or unknown for Meta's answer, choose_number (the sign-in covers several WhatsApp accounts and Cosend could not tell which holds the number: send one of data.choices to POST /v1/connections/attempts/{id}/choose), or Cosend's own code: connection_exists_elsewhere (another workspace has the number), waba_exists_elsewhere (another workspace has the WhatsApp account chosen in Meta's window), plan_does_not_include, two_step_pin_required, number_move_refused, rate_limited, connection_not_found (the number was disconnected while it was being connected), or invalid_request with candidates. |
| error.meta_code | integer | null | required | |
| error.message | string | required | |
| error.candidates | object[] | null | required | |
| error.candidates[].phone_number_id | string | required | |
| error.candidates[].display_phone_number | string | null | required | |
| error.candidates[].verified_name | string | null | required | |
| error.candidates[].platform_type | string | null | required | |
| error.candidates[].is_on_biz_app | boolean | null | required | |
| error.customer_step | "turn_off_two_step_verification" | "add_payment_method" | null | required | |
| error.waba_name | string | null | required | |
| error.workspace | object | null | required | |
| error.workspace.id | string | required | |
| error.workspace.name | string | required | |
| error.data | object | null | required | |
| error.data.choices | object[] | required | |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required | |
| finished_at | string (date-time) | null | required |
Errors connection_exists_elsewhere connection_not_found invalid_request number_move_refused plan_does_not_include rate_limited two_step_pin_required upstream_unavailable waba_exists_elsewhere
POST /v1/connections/attempts/{id}/choose
Choose the number to connect when the sign-in covers several WhatsApp accounts
Scopes connections:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| phone_number_id | string | required | One of the attempt's error.data.choices: the number to connect, with the WhatsApp Business Account that holds it. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "connect_attempt" | required | |
| status | "connecting" | "connected" | "needs_attention" | required | |
| step | "grant" | "account" | "numbers" | "persist" | "subscribe" | "register" | "sync" | "done" | required | |
| connection_id | string | null | required | |
| waba_id | string | null | required | The WhatsApp Business Account, as Cosend's wab_ id (the waba_id its connection carries), from the step that saves the number on; null before. Meta's id for it is meta_waba_id. |
| meta_waba_id | string | null | required | Meta's id for the WhatsApp Business Account, as Embedded Signup and Meta's Graph API give it; null until Meta has named it. Cosend's id for it is waba_id. |
| phone_number_id | string | null | required | |
| mode | "coexistence" | "cloud_api" | required | The path this connect takes: coexistence, a number on the WhatsApp Business app, which stays paired; cloud_api, a number used through the API only. |
| phone_e164 | string | null | required | The number typed in Cosend before Meta’s window (POST /v1/connections/attempts), in E.164. null when none was typed. |
| connected_number | string | null | required | The number Meta connected, in E.164 (+ and digits). null until the attempt is connected. |
| typed_number_matches | boolean | null | required | Whether the number Meta connected is the one typed in Cosend before Meta’s window (POST /v1/connections/attempts), comparing digits only: true when it is, false when Meta connected another number. null when no number was typed or nothing is connected yet. |
| error | object | null | required | |
| error.code | string | required | upstream_unavailable while retrying. When stopped, one of permission_denied, number_in_use, no_number, display_name_rejected, payment_missing or unknown for Meta's answer, choose_number (the sign-in covers several WhatsApp accounts and Cosend could not tell which holds the number: send one of data.choices to POST /v1/connections/attempts/{id}/choose), or Cosend's own code: connection_exists_elsewhere (another workspace has the number), waba_exists_elsewhere (another workspace has the WhatsApp account chosen in Meta's window), plan_does_not_include, two_step_pin_required, number_move_refused, rate_limited, connection_not_found (the number was disconnected while it was being connected), or invalid_request with candidates. |
| error.meta_code | integer | null | required | |
| error.message | string | required | |
| error.candidates | object[] | null | required | |
| error.candidates[].phone_number_id | string | required | |
| error.candidates[].display_phone_number | string | null | required | |
| error.candidates[].verified_name | string | null | required | |
| error.candidates[].platform_type | string | null | required | |
| error.candidates[].is_on_biz_app | boolean | null | required | |
| error.customer_step | "turn_off_two_step_verification" | "add_payment_method" | null | required | |
| error.waba_name | string | null | required | |
| error.workspace | object | null | required | |
| error.workspace.id | string | required | |
| error.workspace.name | string | required | |
| error.data | object | null | required | |
| error.data.choices | object[] | required | |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required | |
| finished_at | string (date-time) | null | required |
Errors connection_exists_elsewhere connection_not_found invalid_request number_move_refused plan_does_not_include rate_limited two_step_pin_required upstream_unavailable waba_exists_elsewhere
POST /v1/connections/attempts/{id}/resume
Finish a connect attempt from where it stopped, without Meta’s window
Scopes connections:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| phone_number_id | string | null | optional | |
| two_step_pin | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "connect_attempt" | required | |
| status | "connecting" | "connected" | "needs_attention" | required | |
| step | "grant" | "account" | "numbers" | "persist" | "subscribe" | "register" | "sync" | "done" | required | |
| connection_id | string | null | required | |
| waba_id | string | null | required | The WhatsApp Business Account, as Cosend's wab_ id (the waba_id its connection carries), from the step that saves the number on; null before. Meta's id for it is meta_waba_id. |
| meta_waba_id | string | null | required | Meta's id for the WhatsApp Business Account, as Embedded Signup and Meta's Graph API give it; null until Meta has named it. Cosend's id for it is waba_id. |
| phone_number_id | string | null | required | |
| mode | "coexistence" | "cloud_api" | required | The path this connect takes: coexistence, a number on the WhatsApp Business app, which stays paired; cloud_api, a number used through the API only. |
| phone_e164 | string | null | required | The number typed in Cosend before Meta’s window (POST /v1/connections/attempts), in E.164. null when none was typed. |
| connected_number | string | null | required | The number Meta connected, in E.164 (+ and digits). null until the attempt is connected. |
| typed_number_matches | boolean | null | required | Whether the number Meta connected is the one typed in Cosend before Meta’s window (POST /v1/connections/attempts), comparing digits only: true when it is, false when Meta connected another number. null when no number was typed or nothing is connected yet. |
| error | object | null | required | |
| error.code | string | required | upstream_unavailable while retrying. When stopped, one of permission_denied, number_in_use, no_number, display_name_rejected, payment_missing or unknown for Meta's answer, choose_number (the sign-in covers several WhatsApp accounts and Cosend could not tell which holds the number: send one of data.choices to POST /v1/connections/attempts/{id}/choose), or Cosend's own code: connection_exists_elsewhere (another workspace has the number), waba_exists_elsewhere (another workspace has the WhatsApp account chosen in Meta's window), plan_does_not_include, two_step_pin_required, number_move_refused, rate_limited, connection_not_found (the number was disconnected while it was being connected), or invalid_request with candidates. |
| error.meta_code | integer | null | required | |
| error.message | string | required | |
| error.candidates | object[] | null | required | |
| error.candidates[].phone_number_id | string | required | |
| error.candidates[].display_phone_number | string | null | required | |
| error.candidates[].verified_name | string | null | required | |
| error.candidates[].platform_type | string | null | required | |
| error.candidates[].is_on_biz_app | boolean | null | required | |
| error.customer_step | "turn_off_two_step_verification" | "add_payment_method" | null | required | |
| error.waba_name | string | null | required | |
| error.workspace | object | null | required | |
| error.workspace.id | string | required | |
| error.workspace.name | string | required | |
| error.data | object | null | required | |
| error.data.choices | object[] | required | |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required | |
| finished_at | string (date-time) | null | required |
Errors connection_exists_elsewhere connection_not_found invalid_request number_move_refused plan_does_not_include rate_limited two_step_pin_required upstream_unavailable waba_exists_elsewhere
GET /v1/connections/attempts/{id}/timeline
The steps of one connect attempt, with times and outcomes
Scopes connections:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "connect_timeline" | required | |
| attempt_id | string | required | |
| connection_id | string | null | required | |
| onboarding_id | string | null | required | |
| mode | "coexistence" | "cloud_api" | required | |
| attempt_status | "connecting" | "connected" | "needs_attention" | required | |
| attempt_step | "grant" | "account" | "numbers" | "persist" | "subscribe" | "register" | "sync" | "done" | required | |
| onboarding_status | "pending" | "syncing" | "complete" | "expired" | "failed" | "offboarded" | null | required | |
| onboarded_at | string (date-time) | null | required | |
| sync_deadline_at | string (date-time) | null | required | |
| media_total | integer | null | required | |
| media_stored | integer | null | required | |
| media_unavailable | integer | null | required | |
| steps | object[] | required | |
| steps[].key | "exchange" | "saved" | "grant" | "account" | "numbers" | "persist" | "subscribe" | "register" | … | required | |
| steps[].title | string | required | |
| steps[].state | "done" | "active" | "waiting" | "stopped" | "failed" | "skipped" | "passed" | required | |
| steps[].at | string (date-time) | null | required | |
| steps[].due_at | string (date-time) | null | required | |
| steps[].armed | boolean | null | required | |
| steps[].outcome | string | null | required | |
| steps[].log_event | string | null | required | |
| steps[].meta_request_id | string | null | required | |
| steps[].counts | object | null | required | |
| steps[].counts.chunks_received | integer | required | |
| steps[].counts.chunks_applied | integer | required | |
| steps[].counts.chunks_failed | integer | required | |
| steps[].counts.messages | integer | required | |
| steps[].counts.last_received_at | string (date-time) | null | required |
GET /v1/connections/attempts/last-unfinished
The last connect attempt of this workspace that did not finish
Scopes connections:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| attempt | object | null | required | |
| attempt.id | string | required | |
| attempt.started_at | string (date-time) | required | |
| attempt.mode | "coexistence" | "cloud_api" | "move" | required | The path the connect took: coexistence, a number on the WhatsApp Business app; cloud_api, a number used through the API only; move, a number moving from another provider. |
| attempt.phone_number | string | null | required | The number typed in Cosend before Meta’s window (POST /v1/connections/attempts), in E.164. null when none was typed. |
| attempt.state | "abandoned" | "needs_attention" | "no_answer" | required | abandoned: Meta’s window never gave Cosend a code, and the attempt was given up after a day. needs_attention: a step stopped and the attempt waits for its cause to be fixed. no_answer: Meta’s window opened at least 15 minutes ago and has not given Cosend a code. |
| attempt.meta | object | required | |
| attempt.meta.error_code | integer | null | required | The error code Meta’s window last reported for this attempt; null when it reported none. |
| attempt.meta.step | string | null | required | The step of Meta’s window it was last closed on, as Meta names it (current_step), when it reported no error code; null otherwise. |
POST /v1/connections/connect
Exchange an Embedded Signup code and connect the number
Scopes connections:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| code | string | required | |
| session | object | optional | |
| session.waba_id | string | optional | Meta's id for the WhatsApp Business Account, as Embedded Signup's finish event gave it, forwarded unchanged. It becomes the connection's meta_waba_id; the connection's waba_id is Cosend's wab_ id. |
| session.phone_number_id | string | optional | |
| session.business_id | string | optional | |
| session.session_id | string | optional | |
| session.event | string | optional | |
| delivery_mode | "stored" | "direct" | optional | |
| mode | "coexistence" | "cloud_api" | optional | |
| two_step_pin | string | optional | |
| moving_from_provider | boolean | optional | |
| import_history | boolean | optional | Import the chat history from the WhatsApp Business app. Default true. false: Cosend never asks WhatsApp for it, and the onboarding completes without it. |
| import_contacts | boolean | optional | Import contacts from the phone's address book. Left out: true when the number connects for the first time, and the number's earlier answer when it connects again. false: Cosend never asks WhatsApp for them and stores no address-book change WhatsApp sends later. true turns the import back on for a number connected again. Set only here. |
| attempt_id | string | optional | The cta_ id POST /v1/connections/attempts answered before Meta’s window opened: the connect continues that attempt, with the name and category it holds. |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "connection" | required | |
| phone_number_id | string | required | |
| waba_id | string | required | The WhatsApp Business Account this number is on, as Cosend's wab_ id: the waba_id templates carry, and what GET /v1/templates?waba_id= and POST /v1/templates/{id}/copy take. Meta's id for it is meta_waba_id. |
| meta_waba_id | string | required | Meta's id for the WhatsApp Business Account this number is on, as Meta's Graph API and WhatsApp Manager show it. Cosend's id for it is waba_id. |
| display_phone_number | string | required | |
| phone_e164 | string | required | |
| verified_name | string | null | required | |
| mode | "coexistence" | "cloud_api" | required | |
| status | "pending" | "active" | "needs_reauth" | "payment_blocked" | "restricted" | "disconnected" | "offboarded" | required | |
| status_reason | string | null | required | |
| status_message | string | null | required | |
| token_verification | "verified" | "stale" | "never" | "invalid" | required | |
| throughput_mps | integer | required | |
| quality_rating | string | null | required | |
| quality_rating_previous | string | null | required | |
| quality_changed_at | string (date-time) | null | required | |
| messaging_limit | string | null | required | |
| meta_business_id | string | null | required | |
| last_app_activity_at | string (date-time) | null | required | |
| delivery_mode | "stored" | "direct" | required | |
| import_contacts | boolean | required | Whether Cosend imports contacts from the phone's address book, as chosen when the number was connected. Read-only. |
| override_callback_url | string | null | required | Your endpoint for Meta’s webhooks for this number. On a direct number Cosend sets it as the number’s webhook override at Meta, and Meta sends the number’s messages, echoes, calls and history to it itself; Meta checks it first with webhook.verify_token, and keeps template and account webhooks on Cosend. On a stored number Cosend receives and keeps every change and relays each one to it in Meta’s envelope, signed X-Cosend-Signature-256: sha256=<HMAC-SHA256 of the body with webhook.relay_secret>, retried with back-off until a 2xx. null clears it. |
| orders_and_bookings | "ask_me_first" | "send_right_away" | required | Before your customer gets an order or booking the AI receptionist made. ask_me_first (the default): it waits for a person to check it and tap Send (POST /v1/receptionist-actions/{id}/send), then the customer gets it and taps Confirm. send_right_away: the customer gets it at once and taps Confirm. Cancellations, payment links, refunds and order changes go straight to the customer’s Confirm either way. |
| webhook | object | required | |
| webhook.meta | object | null | required | |
| webhook.meta.phone_number | string | null | required | |
| webhook.meta.whatsapp_business_account | string | null | required | |
| webhook.meta.application | string | null | required | |
| webhook.meta.read_at | string (date-time) | required | |
| webhook.verify_token | string | null | required | |
| webhook.relay_secret | string | null | required | |
| webhook.relay | object | required | |
| webhook.relay.last_delivered_at | string (date-time) | null | required | |
| webhook.relay.last_failure | object | null | required | |
| is_test | boolean | required | |
| connected_at | string (date-time) | null | required | |
| paused | object | null | required | Set when this number is paused because the plan includes fewer numbers than are connected: since when, and how many numbers the plan includes. A paused number sends nothing through Cosend and starts no automation, AI receptionist or recipe, and every send from it is refused with plan_does_not_include. It still receives and stores messages, keeps its history, contacts, templates and settings, stays connected at Meta, and counts as a connected number. Upgrading, or removing another number, brings it back at once. null when the number is not paused. |
| paused.reason | "plan_limit" | required | |
| paused.since | string (date-time) | required | |
| paused.plan_includes | integer | required | |
| registered_at | string (date-time) | null | required | |
| register_deadline_at | string (date-time) | null | required | |
| register_blocked_until | string (date-time) | null | required | |
| display_name_status | string | null | required | |
| display_name | object | required | |
| display_name.current | string | null | required | |
| display_name.requested | string | null | required | |
| display_name.status | "approved" | "not_reviewed" | "pending_review" | "declined" | "not_set" | required | |
| display_name.applied | boolean | null | required | |
| display_name.reason | string | null | required | |
| display_name.updated_at | string (date-time) | null | required | |
| display_name.meta_status | string | null | required | |
| display_name.meta_status_since | string (date-time) | null | required | |
| display_name.meta_review | string | null | required | |
| display_name.meta_review_since | string (date-time) | null | required | |
| display_name.read_at | string (date-time) | null | required | |
| display_name.decision | object | null | required | |
| display_name.decision.value | string | required | |
| display_name.decision.name | string | null | required | |
| display_name.decision.reason_code | string | null | required | |
| display_name.decision.reason | string | null | required | |
| display_name.decision.at | string (date-time) | required | |
| display_name.refusal | object | null | required | |
| display_name.refusal.message | string | null | required | |
| display_name.refusal.at | string (date-time) | required | |
| display_name.applied_at | string (date-time) | null | required | |
| display_name.apply_by | string (date-time) | null | required | |
| display_name.submitted | object | null | required | |
| display_name.submitted.name | string | required | |
| display_name.submitted.at | string (date-time) | required | |
| display_name.submitted.by | "owner" | "cosend" | required | |
| display_name.submitted.refusal | string | null | required | |
| display_name.submissions_in_30_days | integer | required | |
| display_name.next | object | required | |
| display_name.next.action | "none" | "applying" | "waiting" | "asking" | "verify_business" | "submit_name" | "submit_different_name" | "submit_by_hand" | … | required | |
| display_name.next.owner | boolean | required | |
| display_name.next.sentence | string | null | required | |
| display_name.next.until | string (date-time) | null | required | |
| templates_synced_at | string (date-time) | null | required | |
| health | object | null | required | |
| health.checked_at | string (date-time) | required | |
| health.can_send_message | string | null | required | |
| health.read_at | string (date-time) | null | required | |
| health.entities | object[] | required | |
| health.entities[].entity_type | string | null | required | |
| health.entities[].id | string | null | required | |
| health.entities[].can_send_message | string | null | required | |
| health.entities[].can_receive_call_sip | string | null | required | |
| health.entities[].additional_info | string[] | required | |
| health.entities[].errors | object[] | required | |
| health.token | object | null | required | |
| health.token.status | "valid" | "invalid" | "missing_permissions" | "unreachable" | required | |
| health.token.missing_scopes | string[] | required | |
| health.token.expires_at | string (date-time) | null | required | |
| health.token.reason | string | null | required | |
| health.token.action | string | null | required | |
| health.subscription | object | null | required | |
| health.subscription.status | "subscribed" | "not_subscribed" | "unreachable" | required | |
| health.subscription.reason | string | null | required | |
| health.subscription.action | string | null | required | |
| health.can_send | object | null | required | |
| health.can_send.status | "available" | "limited" | "blocked" | "unreachable" | required | |
| health.can_send.reason | string | null | required | |
| health.can_send.action | string | null | required | |
| sending | object | required | |
| sending.status | "can_send" | "limited" | "cannot_send" | "unknown" | required | |
| sending.checked_at | string (date-time) | null | required | |
| sending.problems | object[] | required | |
| sending.problems[].code | string | required | |
| sending.problems[].entity | "number" | "whatsapp_account" | "business" | "app" | "token" | "subscription" | required | |
| sending.problems[].severity | "blocks" | "limits" | "info" | required | |
| sending.problems[].meta | object | required | |
| sending.problems[].title | string | null | required | |
| sending.problems[].sentence | string | null | required | |
| sending.problems[].limit | string | null | required | |
| sending.problems[].causes | object[] | null | required | |
| sending.problems[].fix | object | required | |
| business_verification | object | required | |
| business_verification.status | string | null | required | |
| business_verification.since | string (date-time) | null | required | |
| business_verification.checked_at | string (date-time) | null | required | |
| business_verification.business_id | string | null | required | |
| business_verification.business_name | string | null | required | |
| business_verification.messaging_limit | string | null | required | |
| business_verification.messaging_limit_read_at | string (date-time) | null | required | |
| business_verification.meta | object | null | required | |
| business_verification.meta.description | string | null | required | |
| business_verification.meta.solution | string | null | required | |
| business_verification.alerts | object[] | required | |
| business_verification.alerts[].type | string | required | |
| business_verification.alerts[].severity | string | null | required | |
| business_verification.alerts[].status | string | null | required | |
| business_verification.alerts[].description | string | null | required | |
| business_verification.alerts[].entity_type | string | null | required | |
| business_verification.alerts[].entity_id | string | null | required | |
| business_verification.alerts[].received_at | string (date-time) | required | |
| business_verification.delay | string | null | required | |
| onboarding | object | null | required | |
| onboarding.status | "pending" | "syncing" | "complete" | "expired" | "failed" | "offboarded" | required | |
| onboarding.history_state | "NOT_REQUESTED" | "REQUESTED" | "STREAMING" | "COMPLETE" | "DECLINED" | "MISSED_WINDOW" | "FAILED" | "SKIPPED" | required | |
| onboarding.progress_pct | integer | required | |
| onboarding.messages_synced | integer | required | |
| onboarding.contacts_synced | integer | required | |
| onboarding.sync_deadline_at | string (date-time) | required | |
| attempt_id | string | required | The connect attempt that finished in this request, as GET /v1/connections/attempts/{id} reads it. |
Response 202
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "connect_attempt" | required | |
| status | "connecting" | "connected" | "needs_attention" | required | |
| step | "grant" | "account" | "numbers" | "persist" | "subscribe" | "register" | "sync" | "done" | required | |
| connection_id | string | null | required | |
| waba_id | string | null | required | The WhatsApp Business Account, as Cosend's wab_ id (the waba_id its connection carries), from the step that saves the number on; null before. Meta's id for it is meta_waba_id. |
| meta_waba_id | string | null | required | Meta's id for the WhatsApp Business Account, as Embedded Signup and Meta's Graph API give it; null until Meta has named it. Cosend's id for it is waba_id. |
| phone_number_id | string | null | required | |
| mode | "coexistence" | "cloud_api" | required | The path this connect takes: coexistence, a number on the WhatsApp Business app, which stays paired; cloud_api, a number used through the API only. |
| phone_e164 | string | null | required | The number typed in Cosend before Meta’s window (POST /v1/connections/attempts), in E.164. null when none was typed. |
| connected_number | string | null | required | The number Meta connected, in E.164 (+ and digits). null until the attempt is connected. |
| typed_number_matches | boolean | null | required | Whether the number Meta connected is the one typed in Cosend before Meta’s window (POST /v1/connections/attempts), comparing digits only: true when it is, false when Meta connected another number. null when no number was typed or nothing is connected yet. |
| error | object | null | required | |
| error.code | string | required | upstream_unavailable while retrying. When stopped, one of permission_denied, number_in_use, no_number, display_name_rejected, payment_missing or unknown for Meta's answer, choose_number (the sign-in covers several WhatsApp accounts and Cosend could not tell which holds the number: send one of data.choices to POST /v1/connections/attempts/{id}/choose), or Cosend's own code: connection_exists_elsewhere (another workspace has the number), waba_exists_elsewhere (another workspace has the WhatsApp account chosen in Meta's window), plan_does_not_include, two_step_pin_required, number_move_refused, rate_limited, connection_not_found (the number was disconnected while it was being connected), or invalid_request with candidates. |
| error.meta_code | integer | null | required | |
| error.message | string | required | |
| error.candidates | object[] | null | required | |
| error.candidates[].phone_number_id | string | required | |
| error.candidates[].display_phone_number | string | null | required | |
| error.candidates[].verified_name | string | null | required | |
| error.candidates[].platform_type | string | null | required | |
| error.candidates[].is_on_biz_app | boolean | null | required | |
| error.customer_step | "turn_off_two_step_verification" | "add_payment_method" | null | required | |
| error.waba_name | string | null | required | |
| error.workspace | object | null | required | |
| error.workspace.id | string | required | |
| error.workspace.name | string | required | |
| error.data | object | null | required | |
| error.data.choices | object[] | required | |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required | |
| finished_at | string (date-time) | null | required | |
| attempt_id | string | required | The same as id: the connect attempt, as GET /v1/connections/attempts/{id} reads it. |
Errors connection_exists_elsewhere connection_not_found invalid_request number_move_refused plan_does_not_include rate_limited two_step_pin_required upstream_unavailable waba_exists_elsewhere
/v1/connector-accounts
GET /v1/connector-accounts
The workspace’s connected accounts, filterable by connector, for re-checking the connected state
Scopes connectors:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| connector | query | string | optional | |
| status | query | "active" | "needs_reauth" | "error" | "disabled" | "revoked" | optional | |
| connection_id | query | string | optional | Only the accounts used on this WhatsApp number. Without it, every account of the workspace. |
| limit | query | integer | optional | |
| after | query | string | optional | |
| before | query | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].connector | string | required | |
| data[].name | string | required | |
| data[].connection_ids | string[] | required | The WhatsApp numbers this account is used on, sorted. Only these numbers' automations hear its events and may call it; each number's automations stay its own. One account, one sign-in: every number here uses the same credential. Empty when it is on no number: it is then refused wherever it would be used until POST /v1/connector-accounts/{id}/numbers adds one. |
| data[].status | "active" | "needs_reauth" | "error" | "disabled" | "revoked" | required | |
| data[].external_label | string | null | required | |
| data[].external_account_id | string | null | required | |
| data[].granted_scopes | string[] | required | |
| data[].config | object | required | |
| data[].credential_fingerprint | string | null | required | |
| data[].last_error | string | null | required | Why the account last failed, as a sentence to show as it is: the app's own words when it gave some, otherwise Cosend's. Never a bare code; a Test's error carries the code. null when there is none. |
| data[].last_used_at | string | null | required | |
| data[].last_verified_at | string | null | required | |
| data[].created_at | string | required | |
| data[].updated_at | string | required | |
| data[].identity | object | null | required | |
| data[].identity.id | string | required | |
| data[].identity.label | string | required | |
| data[].triggers | object[] | optional | |
| data[].triggers[].id | string | required | |
| data[].triggers[].name | string | required | |
| data[].triggers[].trigger | string | required | |
| data[].triggers[].event | string | required | |
| data[].triggers[].mode | string | required | |
| data[].triggers[].automation_id | string | null | required | |
| data[].triggers[].status | string | required | |
| data[].triggers[].last_error | string | null | required | |
| data[].triggers[].last_event_at | string | null | required | |
| data[].triggers[].ingress_url | string | null | required | |
| has_more | boolean | required | |
| next_cursor | string | null | required |
GET /v1/connector-accounts/{id}
One connected account. Never its credential
Scopes connectors:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| connector | string | required | |
| name | string | required | |
| connection_ids | string[] | required | The WhatsApp numbers this account is used on, sorted. Only these numbers' automations hear its events and may call it; each number's automations stay its own. One account, one sign-in: every number here uses the same credential. Empty when it is on no number: it is then refused wherever it would be used until POST /v1/connector-accounts/{id}/numbers adds one. |
| status | "active" | "needs_reauth" | "error" | "disabled" | "revoked" | required | |
| external_label | string | null | required | |
| external_account_id | string | null | required | |
| granted_scopes | string[] | required | |
| config | object | required | |
| credential_fingerprint | string | null | required | |
| last_error | string | null | required | Why the account last failed, as a sentence to show as it is: the app's own words when it gave some, otherwise Cosend's. Never a bare code; a Test's error carries the code. null when there is none. |
| last_used_at | string | null | required | |
| last_verified_at | string | null | required | |
| created_at | string | required | |
| updated_at | string | required | |
| identity | object | null | required | |
| identity.id | string | required | |
| identity.label | string | required | |
| triggers | object[] | optional | |
| triggers[].id | string | required | |
| triggers[].name | string | required | |
| triggers[].trigger | string | required | |
| triggers[].event | string | required | |
| triggers[].mode | string | required | |
| triggers[].automation_id | string | null | required | |
| triggers[].status | string | required | |
| triggers[].last_error | string | null | required | |
| triggers[].last_event_at | string | null | required | |
| triggers[].ingress_url | string | null | required |
PATCH /v1/connector-accounts/{id}
Rename, or change non-secret config. A key changes through PATCH /v1/connector-accounts/{id}/credential
Scopes connectors:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | optional | |
| config | object | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| connector | string | required | |
| name | string | required | |
| connection_ids | string[] | required | The WhatsApp numbers this account is used on, sorted. Only these numbers' automations hear its events and may call it; each number's automations stay its own. One account, one sign-in: every number here uses the same credential. Empty when it is on no number: it is then refused wherever it would be used until POST /v1/connector-accounts/{id}/numbers adds one. |
| status | "active" | "needs_reauth" | "error" | "disabled" | "revoked" | required | |
| external_label | string | null | required | |
| external_account_id | string | null | required | |
| granted_scopes | string[] | required | |
| config | object | required | |
| credential_fingerprint | string | null | required | |
| last_error | string | null | required | Why the account last failed, as a sentence to show as it is: the app's own words when it gave some, otherwise Cosend's. Never a bare code; a Test's error carries the code. null when there is none. |
| last_used_at | string | null | required | |
| last_verified_at | string | null | required | |
| created_at | string | required | |
| updated_at | string | required | |
| identity | object | null | required | |
| identity.id | string | required | |
| identity.label | string | required | |
| triggers | object[] | optional | |
| triggers[].id | string | required | |
| triggers[].name | string | required | |
| triggers[].trigger | string | required | |
| triggers[].event | string | required | |
| triggers[].mode | string | required | |
| triggers[].automation_id | string | null | required | |
| triggers[].status | string | required | |
| triggers[].last_error | string | null | required | |
| triggers[].last_event_at | string | null | required | |
| triggers[].ingress_url | string | null | required |
DELETE /v1/connector-accounts/{id}
Revoke at the provider, then delete the secret
Scopes connectors:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| deleted | true | required | |
| provider_revoked | boolean | required | |
| identity_kept | boolean | required |
GET /v1/connector-accounts/{id}/appointments-preview
A calendar account’s upcoming events and the customer number found in each, or none
Scopes connectors:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| days | query | integer | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| days | integer | required | |
| with_phone | integer | required | |
| without_phone | integer | required | |
| events | object[] | required | |
| events[].external_id | string | required | |
| events[].title | string | null | required | |
| events[].starts_at | string | required | |
| events[].phone | string | null | required |
Errors connector_needs_reauth preview_unsupported rate_limited upstream_error
GET /v1/connector-accounts/{id}/channels
A team-alert account’s channels, with the id its config.channel_id takes, 200 a page
Scopes connectors:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| after | query | string | optional | The next_cursor of the page before, for the next page. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].object | "channel" | required | |
| data[].id | string | required | The channel’s id at the app: what config.channel_id takes. |
| data[].name | string | required | The channel’s name, as the app shows it. |
| data[].private | boolean | required | A private channel or group: listed only once the app is in it, and only its members see it. |
| next_cursor | string | null | required |
PATCH /v1/connector-accounts/{id}/credential
Set or replace the key of an account connected with one, keeping its id, name, config and number. The key is never returned
Scopes connectors:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| api_key | string | optional | |
| username | string | optional | |
| password | string | optional | |
| webhook_secret | string | optional | The secret the provider signs its webhooks with, for an integration whose webhook you add in the provider’s own dashboard. Optional at connect; set it later through PATCH /v1/connector-accounts/{id}/credential. Never returned. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| connector | string | required | |
| name | string | required | |
| connection_ids | string[] | required | The WhatsApp numbers this account is used on, sorted. Only these numbers' automations hear its events and may call it; each number's automations stay its own. One account, one sign-in: every number here uses the same credential. Empty when it is on no number: it is then refused wherever it would be used until POST /v1/connector-accounts/{id}/numbers adds one. |
| status | "active" | "needs_reauth" | "error" | "disabled" | "revoked" | required | |
| external_label | string | null | required | |
| external_account_id | string | null | required | |
| granted_scopes | string[] | required | |
| config | object | required | |
| credential_fingerprint | string | null | required | |
| last_error | string | null | required | Why the account last failed, as a sentence to show as it is: the app's own words when it gave some, otherwise Cosend's. Never a bare code; a Test's error carries the code. null when there is none. |
| last_used_at | string | null | required | |
| last_verified_at | string | null | required | |
| created_at | string | required | |
| updated_at | string | required | |
| identity | object | null | required | |
| identity.id | string | required | |
| identity.label | string | required | |
| triggers | object[] | optional | |
| triggers[].id | string | required | |
| triggers[].name | string | required | |
| triggers[].trigger | string | required | |
| triggers[].event | string | required | |
| triggers[].mode | string | required | |
| triggers[].automation_id | string | null | required | |
| triggers[].status | string | required | |
| triggers[].last_error | string | null | required | |
| triggers[].last_event_at | string | null | required | |
| triggers[].ingress_url | string | null | required |
DELETE /v1/connector-accounts/{id}/credential
Remove the key of an account whose connector works without one (http); its calls then carry no credential
Scopes connectors:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| connector | string | required | |
| name | string | required | |
| connection_ids | string[] | required | The WhatsApp numbers this account is used on, sorted. Only these numbers' automations hear its events and may call it; each number's automations stay its own. One account, one sign-in: every number here uses the same credential. Empty when it is on no number: it is then refused wherever it would be used until POST /v1/connector-accounts/{id}/numbers adds one. |
| status | "active" | "needs_reauth" | "error" | "disabled" | "revoked" | required | |
| external_label | string | null | required | |
| external_account_id | string | null | required | |
| granted_scopes | string[] | required | |
| config | object | required | |
| credential_fingerprint | string | null | required | |
| last_error | string | null | required | Why the account last failed, as a sentence to show as it is: the app's own words when it gave some, otherwise Cosend's. Never a bare code; a Test's error carries the code. null when there is none. |
| last_used_at | string | null | required | |
| last_verified_at | string | null | required | |
| created_at | string | required | |
| updated_at | string | required | |
| identity | object | null | required | |
| identity.id | string | required | |
| identity.label | string | required | |
| triggers | object[] | optional | |
| triggers[].id | string | required | |
| triggers[].name | string | required | |
| triggers[].trigger | string | required | |
| triggers[].event | string | required | |
| triggers[].mode | string | required | |
| triggers[].automation_id | string | null | required | |
| triggers[].status | string | required | |
| triggers[].last_error | string | null | required | |
| triggers[].last_event_at | string | null | required | |
| triggers[].ingress_url | string | null | required |
GET /v1/connector-accounts/{id}/forms
A form account’s forms, with the id an automation’s start takes as its form_id
Scopes connectors:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].object | "form" | required | |
| data[].id | string | required | The form’s id at the form tool: what form_id takes. |
| data[].name | string | required | The form’s name, as the form tool shows it. |
| data[].checkboxes | object[] | optional | The form’s own checkboxes, where the form tool has them: what a connected form’s consent_checkbox takes, by key. |
| data[].checkboxes[].key | string | required | |
| data[].checkboxes[].text | string | required | |
| has_more | boolean | required | The account has more forms than the form tool’s first page, which is what this lists (Jotform 100, Typeform 200). |
POST /v1/connector-accounts/{id}/numbers
Use this integration account on another WhatsApp number of the workspace too: the same account and sign-in, never a copy. Owner or admin. Already on that number answers the account unchanged
Scopes connectors:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| connection_id | string | required | The WhatsApp number of this workspace to use the account on too. Already on it answers 200 with the account. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| connector | string | required | |
| name | string | required | |
| connection_ids | string[] | required | The WhatsApp numbers this account is used on, sorted. Only these numbers' automations hear its events and may call it; each number's automations stay its own. One account, one sign-in: every number here uses the same credential. Empty when it is on no number: it is then refused wherever it would be used until POST /v1/connector-accounts/{id}/numbers adds one. |
| status | "active" | "needs_reauth" | "error" | "disabled" | "revoked" | required | |
| external_label | string | null | required | |
| external_account_id | string | null | required | |
| granted_scopes | string[] | required | |
| config | object | required | |
| credential_fingerprint | string | null | required | |
| last_error | string | null | required | Why the account last failed, as a sentence to show as it is: the app's own words when it gave some, otherwise Cosend's. Never a bare code; a Test's error carries the code. null when there is none. |
| last_used_at | string | null | required | |
| last_verified_at | string | null | required | |
| created_at | string | required | |
| updated_at | string | required | |
| identity | object | null | required | |
| identity.id | string | required | |
| identity.label | string | required | |
| triggers | object[] | optional | |
| triggers[].id | string | required | |
| triggers[].name | string | required | |
| triggers[].trigger | string | required | |
| triggers[].event | string | required | |
| triggers[].mode | string | required | |
| triggers[].automation_id | string | null | required | |
| triggers[].status | string | required | |
| triggers[].last_error | string | null | required | |
| triggers[].last_event_at | string | null | required | |
| triggers[].ingress_url | string | null | required |
DELETE /v1/connector-accounts/{id}/numbers/{connection_id}
Stop using this integration account on one WhatsApp number. Owner or admin. Refused on its only number (disconnect it instead) and while an automation switched on there still needs it
Scopes connectors:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| connector | string | required | |
| name | string | required | |
| connection_ids | string[] | required | The WhatsApp numbers this account is used on, sorted. Only these numbers' automations hear its events and may call it; each number's automations stay its own. One account, one sign-in: every number here uses the same credential. Empty when it is on no number: it is then refused wherever it would be used until POST /v1/connector-accounts/{id}/numbers adds one. |
| status | "active" | "needs_reauth" | "error" | "disabled" | "revoked" | required | |
| external_label | string | null | required | |
| external_account_id | string | null | required | |
| granted_scopes | string[] | required | |
| config | object | required | |
| credential_fingerprint | string | null | required | |
| last_error | string | null | required | Why the account last failed, as a sentence to show as it is: the app's own words when it gave some, otherwise Cosend's. Never a bare code; a Test's error carries the code. null when there is none. |
| last_used_at | string | null | required | |
| last_verified_at | string | null | required | |
| created_at | string | required | |
| updated_at | string | required | |
| identity | object | null | required | |
| identity.id | string | required | |
| identity.label | string | required | |
| triggers | object[] | optional | |
| triggers[].id | string | required | |
| triggers[].name | string | required | |
| triggers[].trigger | string | required | |
| triggers[].event | string | required | |
| triggers[].mode | string | required | |
| triggers[].automation_id | string | null | required | |
| triggers[].status | string | required | |
| triggers[].last_error | string | null | required | |
| triggers[].last_event_at | string | null | required | |
| triggers[].ingress_url | string | null | required |
POST /v1/connector-accounts/{id}/picker
What the browser opens Google’s file picker with for this Google account: a short-lived drive.file access token, the app id and the API key
Scopes connectors:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| access_token | string | required | |
| expires_at | string | required | |
| app_id | string | required | |
| api_key | string | required |
GET /v1/connector-accounts/{id}/sheets
A Google account’s spreadsheets, 100 a page at most, or one spreadsheet’s tabs with ?spreadsheet_id=
Scopes connectors:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| spreadsheet_id | query | string | optional | |
| limit | query | integer | optional | |
| after | query | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].object | "spreadsheet" | required | |
| data[].id | string | required | |
| data[].name | string | required | |
| data[].tabs | object[] | optional | |
| data[].tabs[].id | integer | required | |
| data[].tabs[].title | string | required | |
| has_more | boolean | required | |
| next_cursor | string | null | required |
POST /v1/connector-accounts/{id}/sheets
Make a spreadsheet in this Google account: its name, its tab, the header columns and an example row
Scopes connectors:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | optional |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| title | string | required | The spreadsheet’s name, in the owner’s words. |
| tab | string | required | The one tab’s name. |
| columns | object[] | required | The header row, first column first: 26 at most, A to Z. |
| columns[].name | string | required | The column’s header, as the first row shows it and as Find a row matches it (any case). |
| columns[].type | "text" | "number" | "date" | optional | What the column holds. text, the default: the example row’s cell is formatted as text, so what the owner types over it stays exactly as typed (a phone number, a code). number or date: that cell is not formatted as text, so what the owner types over it is read the way Google Sheets reads anything typed. The example value itself is written as text either way. With no example row it changes nothing in the sheet. |
| example_row | string[] | optional | One row under the header for the owner to type over, as wide as columns. Absent: the sheet has the header row only. |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "spreadsheet" | required | |
| id | string | required | |
| name | string | required | |
| tabs | object[] | required | |
| tabs[].id | integer | required | |
| tabs[].title | string | required | |
| url | string | required | |
| columns | object[] | required | |
| columns[].name | string | required | |
| columns[].type | "text" | "number" | "date" | required |
POST /v1/connector-accounts/{id}/test
One safe read against the provider to verify the credential
Scopes connectors:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| ok | boolean | required | |
| status | "active" | "needs_reauth" | "error" | "disabled" | "revoked" | required | |
| external_label | string | null | required | |
| error | string | null | required | |
| message | string | null | required | |
| checked_at | string | required |
POST /v1/connector-accounts/connect
Start a connection: an authorize URL for OAuth, or an immediate connect for a key
Scopes connectors:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | optional |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| connector | string | required | |
| name | string | optional | |
| api_key | string | optional | |
| username | string | optional | |
| password | string | optional | |
| webhook_secret | string | optional | The secret the provider signs its webhooks with, for an integration whose webhook you add in the provider’s own dashboard. Optional at connect; set it later through PATCH /v1/connector-accounts/{id}/credential. Never returned. |
| config | object | optional | |
| connection_id | string | null | optional | The WhatsApp number this integration is for. Left out in a workspace with one number, it is that number; with several, the account is on no number until POST /v1/connector-accounts/{id}/numbers adds one. Connecting an account the workspace already has (the same shop, the same sign-in) adds this number to it and keeps its other numbers. |
| identity_id | string | optional | |
| install_proof | string | optional | For an integration installed from the provider’s own app store: the install_proof from the link Cosend sends after the install. For an account whose app was uninstalled, it shows the provider has installed it again, so the answer is the sign-in page instead of the provider’s install page. Valid for one hour. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| status | "authorize_required" | required | |
| connector | string | required | |
| authorize_url | string | required | |
| expires_in_ms | number | required | |
| install_url | string | required | The provider’s own install page for this app, for an account whose app was uninstalled. Open it in the same tab, not a sign-in window; it does not expire. The provider then opens Cosend again, and the account is connected from there. |
| account | object | required | |
| account.id | string | required | |
| account.connector | string | required | |
| account.name | string | required | |
| account.connection_ids | string[] | required | The WhatsApp numbers this account is used on, sorted. Only these numbers' automations hear its events and may call it; each number's automations stay its own. One account, one sign-in: every number here uses the same credential. Empty when it is on no number: it is then refused wherever it would be used until POST /v1/connector-accounts/{id}/numbers adds one. |
| account.status | "active" | "needs_reauth" | "error" | "disabled" | "revoked" | required | |
| account.external_label | string | null | required | |
| account.external_account_id | string | null | required | |
| account.granted_scopes | string[] | required | |
| account.config | object | required | |
| account.credential_fingerprint | string | null | required | |
| account.last_error | string | null | required | Why the account last failed, as a sentence to show as it is: the app's own words when it gave some, otherwise Cosend's. Never a bare code; a Test's error carries the code. null when there is none. |
| account.last_used_at | string | null | required | |
| account.last_verified_at | string | null | required | |
| account.created_at | string | required | |
| account.updated_at | string | required | |
| account.identity | object | null | required | |
| account.identity.id | string | required | |
| account.identity.label | string | required | |
| account.triggers | object[] | optional | |
| account.triggers[].id | string | required | |
| account.triggers[].name | string | required | |
| account.triggers[].trigger | string | required | |
| account.triggers[].event | string | required | |
| account.triggers[].mode | string | required | |
| account.triggers[].automation_id | string | null | required | |
| account.triggers[].status | string | required | |
| account.triggers[].last_error | string | null | required | |
| account.triggers[].last_event_at | string | null | required | |
| account.triggers[].ingress_url | string | null | required | |
| first_use | boolean | required |
POST /v1/connector-accounts/grants/{id}/claim
Save a connection the OAuth callback holds: only for the person who started it, signed in to the dashboard in its workspace
Scopes connectors:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| connector | string | required | |
| account_id | string | required | The connected account, stored by this claim. |
| identity | object | null | required | The Google login the account is filed under: the one the person signed in with. Null for every other connector. |
| identity.id | string | required | |
| identity.label | string | required | |
| first_use | boolean | required |
/v1/connector-identities
GET /v1/connector-identities
The workspace’s connected Google logins and the integrations each one serves, filterable by number
Scopes connectors:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| connection_id | query | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].family | "google" | required | |
| data[].label | string | required | |
| data[].status | "active" | "needs_reauth" | "revoked" | required | |
| data[].granted_scopes | string[] | required | |
| data[].products | string[] | required | |
| data[].created_at | string | required |
/v1/connectors
GET /v1/connectors
What can be connected, and which of them this workspace already has
Scopes connectors:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].connector | string | required | |
| data[].display_name | string | required | |
| data[].category | string | required | |
| data[].auth_kind | "oauth2" | "api_key" | "basic" | "none" | required | |
| data[].scopes | string[] | required | |
| data[].credential_label | string | null | required | |
| data[].credential_help_url | string | null | required | |
| data[].test_system | boolean | required | |
| data[].operations | object[] | required | |
| data[].operations[].key | string | required | |
| data[].operations[].title | string | required | |
| data[].operations[].side_effect | "none" | "internal_write" | "external_send" | required | |
| data[].operations[].test_reads_for_real | boolean | required | |
| data[].operations[].input_schema | object | required | |
| data[].status | string | required | |
| data[].min_plan | string | null | required | |
| data[].docs_url | string | null | required | |
| data[].connected_account_ids | string[] | required |
/v1/contact-fields
GET /v1/contact-fields
The workspace's contact fields, each with how many contacts hold a value for it
Scopes contacts:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| limit | query | integer | optional | |
| after | query | string | optional | |
| before | query | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].object | "contact_field" | required | |
| data[].key | string | required | The key in a contact’s attributes. Fixed once made. |
| data[].label | string | required | |
| data[].type | "text" | "number" | "date" | "boolean" | "choice" | required | |
| data[].choices | string[] | required | |
| data[].required | boolean | required | A PATCH /v1/contacts/{id} that sets attributes must give this field a value. |
| data[].contacts_with_value | integer | required | |
| data[].created_at | string (date-time) | required | |
| data[].updated_at | string (date-time) | required | |
| has_more | boolean | required | |
| next_cursor | string | null | required |
POST /v1/contact-fields
Add a contact field: a key of a contact’s attributes, with its label and type
Scopes contacts:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| key | string | required | |
| label | string | required | |
| type | "text" | "number" | "date" | "boolean" | "choice" | required | |
| choices | string[] | optional | A choice field's options, 1 to 100 of them, each once; none otherwise. |
| required | boolean | optional |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "contact_field" | required | |
| key | string | required | The key in a contact’s attributes. Fixed once made. |
| label | string | required | |
| type | "text" | "number" | "date" | "boolean" | "choice" | required | |
| choices | string[] | required | |
| required | boolean | required | A PATCH /v1/contacts/{id} that sets attributes must give this field a value. |
| contacts_with_value | integer | required | |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required |
PATCH /v1/contact-fields/{id}
Change a contact field's label, type, choices or whether it is required; the key stays
Scopes contacts:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| label | string | optional | |
| type | "text" | "number" | "date" | "boolean" | "choice" | optional | |
| choices | string[] | optional | A choice field's options, 1 to 100 of them, each once; none otherwise. |
| required | boolean | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "contact_field" | required | |
| key | string | required | The key in a contact’s attributes. Fixed once made. |
| label | string | required | |
| type | "text" | "number" | "date" | "boolean" | "choice" | required | |
| choices | string[] | required | |
| required | boolean | required | A PATCH /v1/contacts/{id} that sets attributes must give this field a value. |
| contacts_with_value | integer | required | |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required |
DELETE /v1/contact-fields/{id}
Delete a contact field and every contact's value for it
Scopes contacts:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "contact_field" | required | |
| deleted | true | required | |
| contacts_updated | integer | required |
/v1/contact-imports
GET /v1/contact-imports
The workspace's contact imports
Scopes contacts:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| limit | query | integer | optional | |
| after | query | string | optional | |
| before | query | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].object | "contact_import" | required | |
| data[].state | "draft" | "queued" | "running" | "completed" | "failed" | required | |
| data[].connection_id | string | required | |
| data[].file_name | string | null | required | |
| data[].row_count | integer | required | |
| data[].columns | string[] | required | |
| data[].sample_rows | string[][] | required | |
| data[].mapping | object | required | |
| data[].new_fields | object[] | required | |
| data[].new_fields[].key | string | required | |
| data[].new_fields[].label | string | required | |
| data[].new_fields[].type | "text" | "number" | "date" | "boolean" | "choice" | required | |
| data[].new_fields[].choices | string[] | required | |
| data[].consent | object | null | required | |
| data[].consent.categories | ("marketing" | "utility" | "authentication")[] | required | |
| data[].consent.sentence_shown | string | null | required | |
| data[].consent.attested_by | string | null | required | |
| data[].progress | object | required | |
| data[].progress.processed | integer | required | |
| data[].progress.total | integer | required | |
| data[].result | object | null | required | |
| data[].result.imported | integer | required | |
| data[].result.failed | object[] | required | |
| data[].result.errors | integer | required | |
| data[].created_at | string (date-time) | required | |
| data[].updated_at | string (date-time) | required | |
| data[].finished_at | string (date-time) | null | required | |
| has_more | boolean | required | |
| next_cursor | string | null | required |
POST /v1/contact-imports
Upload a CSV of contacts for one number (base64, or a med_ id); answers its columns, first rows and row count
Scopes contacts:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| connection_id | string | required | |
| file_name | string | optional | |
| data_base64 | string | optional | The CSV file, base64-encoded. |
| media_id | string | optional | A med_ id from POST /v1/media (text/plain or text/csv), instead of data_base64. |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "contact_import" | required | |
| state | "draft" | "queued" | "running" | "completed" | "failed" | required | |
| connection_id | string | required | |
| file_name | string | null | required | |
| row_count | integer | required | |
| columns | string[] | required | |
| sample_rows | string[][] | required | |
| mapping | object | required | |
| new_fields | object[] | required | |
| new_fields[].key | string | required | |
| new_fields[].label | string | required | |
| new_fields[].type | "text" | "number" | "date" | "boolean" | "choice" | required | |
| new_fields[].choices | string[] | required | |
| consent | object | null | required | |
| consent.categories | ("marketing" | "utility" | "authentication")[] | required | |
| consent.sentence_shown | string | null | required | |
| consent.attested_by | string | null | required | |
| progress | object | required | |
| progress.processed | integer | required | |
| progress.total | integer | required | |
| result | object | null | required | |
| result.imported | integer | required | |
| result.failed | object[] | required | |
| result.failed[].row | integer | required | |
| result.failed[].reason | string | required | |
| result.errors | integer | required | |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required | |
| finished_at | string (date-time) | null | required |
GET /v1/contact-imports/{id}
One contact import: its state, progress and result
Scopes contacts:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "contact_import" | required | |
| state | "draft" | "queued" | "running" | "completed" | "failed" | required | |
| connection_id | string | required | |
| file_name | string | null | required | |
| row_count | integer | required | |
| columns | string[] | required | |
| sample_rows | string[][] | required | |
| mapping | object | required | |
| new_fields | object[] | required | |
| new_fields[].key | string | required | |
| new_fields[].label | string | required | |
| new_fields[].type | "text" | "number" | "date" | "boolean" | "choice" | required | |
| new_fields[].choices | string[] | required | |
| consent | object | null | required | |
| consent.categories | ("marketing" | "utility" | "authentication")[] | required | |
| consent.sentence_shown | string | null | required | |
| consent.attested_by | string | null | required | |
| progress | object | required | |
| progress.processed | integer | required | |
| progress.total | integer | required | |
| result | object | null | required | |
| result.imported | integer | required | |
| result.failed | object[] | required | |
| result.failed[].row | integer | required | |
| result.failed[].reason | string | required | |
| result.errors | integer | required | |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required | |
| finished_at | string (date-time) | null | required |
PATCH /v1/contact-imports/{id}
Set an import's column mapping, its number, and the consent everyone in the file gave
Scopes contacts:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| mapping | object | optional | |
| new_fields | object[] | optional | |
| new_fields[].key | string | required | |
| new_fields[].label | string | required | |
| new_fields[].type | "text" | "number" | "date" | "boolean" | "choice" | required | |
| new_fields[].choices | string[] | required | A choice field's options, 1 to 100 of them, each once; none otherwise. |
| connection_id | string | optional | |
| consent | object | null | optional | |
| consent.categories | ("marketing" | "utility" | "authentication")[] | required | |
| consent.sentence_shown | string | optional | |
| consent.attested_by | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "contact_import" | required | |
| state | "draft" | "queued" | "running" | "completed" | "failed" | required | |
| connection_id | string | required | |
| file_name | string | null | required | |
| row_count | integer | required | |
| columns | string[] | required | |
| sample_rows | string[][] | required | |
| mapping | object | required | |
| new_fields | object[] | required | |
| new_fields[].key | string | required | |
| new_fields[].label | string | required | |
| new_fields[].type | "text" | "number" | "date" | "boolean" | "choice" | required | |
| new_fields[].choices | string[] | required | |
| consent | object | null | required | |
| consent.categories | ("marketing" | "utility" | "authentication")[] | required | |
| consent.sentence_shown | string | null | required | |
| consent.attested_by | string | null | required | |
| progress | object | required | |
| progress.processed | integer | required | |
| progress.total | integer | required | |
| result | object | null | required | |
| result.imported | integer | required | |
| result.failed | object[] | required | |
| result.failed[].row | integer | required | |
| result.failed[].reason | string | required | |
| result.errors | integer | required | |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required | |
| finished_at | string (date-time) | null | required |
POST /v1/contact-imports/{id}/preview
What running the import would do, over the whole file: new, updated, invalid, duplicates, already opted out, consent recorded
Scopes contacts:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| details | boolean | optional | Also answer the rows that will not be imported (the first 100) and five contacts as the import will write them. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| new | integer | required | |
| updated | integer | required | |
| invalid | integer | required | |
| duplicates | integer | required | |
| already_opted_out | integer | required | |
| consent_recorded | integer | required | |
| invalid_rows | object[] | optional | |
| invalid_rows[].row | integer | required | |
| invalid_rows[].phone | string | required | |
| invalid_rows[].problem | "no_number" | "value" | required | |
| invalid_rows[].reason | string | required | |
| samples | object[] | optional | |
| samples[].row | integer | required | |
| samples[].phone | string | required | |
| samples[].name | string | null | required | |
| samples[].tags | string[] | required | |
| samples[].fields | object[] | required | |
| samples[].fields[].key | string | required | |
| samples[].fields[].label | string | required | |
| samples[].fields[].value | string | number | boolean | required | |
| samples[].existing | boolean | required |
POST /v1/contact-imports/{id}/run
Run the import in the background; GET it to follow its progress and result
Scopes contacts:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| tag | string | optional | A tag every contact this import adds or updates gets, beside the file’s own tags, so the whole file can be saved as an audience on it. |
Response 202
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "contact_import" | required | |
| state | "draft" | "queued" | "running" | "completed" | "failed" | required | |
| connection_id | string | required | |
| file_name | string | null | required | |
| row_count | integer | required | |
| columns | string[] | required | |
| sample_rows | string[][] | required | |
| mapping | object | required | |
| new_fields | object[] | required | |
| new_fields[].key | string | required | |
| new_fields[].label | string | required | |
| new_fields[].type | "text" | "number" | "date" | "boolean" | "choice" | required | |
| new_fields[].choices | string[] | required | |
| consent | object | null | required | |
| consent.categories | ("marketing" | "utility" | "authentication")[] | required | |
| consent.sentence_shown | string | null | required | |
| consent.attested_by | string | null | required | |
| progress | object | required | |
| progress.processed | integer | required | |
| progress.total | integer | required | |
| result | object | null | required | |
| result.imported | integer | required | |
| result.failed | object[] | required | |
| result.failed[].row | integer | required | |
| result.failed[].reason | string | required | |
| result.errors | integer | required | |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required | |
| finished_at | string (date-time) | null | required |
POST /v1/contact-imports/{id}/suggest
Cosend's AI reads the file and sets the draft's mapping and new fields, for the person to check; nothing is imported
Scopes contacts:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "contact_import" | required | |
| state | "draft" | "queued" | "running" | "completed" | "failed" | required | |
| connection_id | string | required | |
| file_name | string | null | required | |
| row_count | integer | required | |
| columns | string[] | required | |
| sample_rows | string[][] | required | |
| mapping | object | required | |
| new_fields | object[] | required | |
| new_fields[].key | string | required | |
| new_fields[].label | string | required | |
| new_fields[].type | "text" | "number" | "date" | "boolean" | "choice" | required | |
| new_fields[].choices | string[] | required | |
| consent | object | null | required | |
| consent.categories | ("marketing" | "utility" | "authentication")[] | required | |
| consent.sentence_shown | string | null | required | |
| consent.attested_by | string | null | required | |
| progress | object | required | |
| progress.processed | integer | required | |
| progress.total | integer | required | |
| result | object | null | required | |
| result.imported | integer | required | |
| result.failed | object[] | required | |
| result.failed[].row | integer | required | |
| result.failed[].reason | string | required | |
| result.errors | integer | required | |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required | |
| finished_at | string (date-time) | null | required |
/v1/contacts
GET /v1/contacts
List contacts; q searches display_name, phone digits and username (page size 20 under q)
Scopes contacts:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| limit | query | integer | optional | |
| after | query | string | optional | |
| before | query | string | optional | |
| q | query | string | optional | |
| tag | query | string | string[] | optional | |
| connection_id | query | string | string[] | optional | |
| portfolio_id | query | string | optional | |
| order | query | "recent" | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].object | "contact" | required | |
| data[].connection_id | string | required | |
| data[].portfolio_id | string | required | |
| data[].numbers | object[] | required | |
| data[].numbers[].connection_id | string | required | |
| data[].numbers[].first_seen_at | string (date-time) | required | |
| data[].numbers[].last_seen_at | string (date-time) | null | required | |
| data[].numbers[].is_blocked | boolean | required | |
| data[].numbers[].in_phone_contacts | boolean | required | |
| data[].numbers[].removed_in_app_at | string (date-time) | null | required | |
| data[].numbers[].history_imported | boolean | required | |
| data[].display_name | string | required | |
| data[].phone_e164 | string | null | required | |
| data[].wa_id | string | null | required | |
| data[].bsuid | string | null | required | |
| data[].username | string | null | required | |
| data[].name | string | null | required | |
| data[].profile_name | string | null | required | |
| data[].attributes | object | required | |
| data[].tags | string[] | required | |
| data[].locale | string | null | required | |
| data[].timezone | string | null | required | |
| data[].is_blocked | boolean | required | |
| data[].removed_in_app_at | string (date-time) | null | required | |
| data[].first_seen_at | string (date-time) | required | |
| data[].last_seen_at | string (date-time) | null | required | |
| data[].created_at | string (date-time) | required | |
| data[].ad | object | null | required | |
| data[].ad.source_id | string | required | |
| data[].ad.source_type | string | required | |
| data[].ad.source_url | string | null | required | |
| data[].ad.headline | string | null | required | |
| data[].ad.body | string | null | required | |
| data[].ad.media_type | string | null | required | |
| data[].ad.image_url | string | null | required | |
| data[].ad.video_url | string | null | required | |
| data[].ad.thumbnail_url | string | null | required | |
| data[].ad.at | string (date-time) | required | |
| has_more | boolean | required | |
| next_cursor | string | null | required |
POST /v1/contacts
Create a contact. It upserts: one that already exists gets the fields sent, removes nothing, and returns 200
Scopes contacts:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| connection_id | string | required | |
| name | string | null | optional | |
| phone_e164 | string | null | optional | |
| bsuid | string | null | optional | |
| profile_name | string | null | optional | |
| attributes | object | optional | Free-form values. PATCH replaces them whole; a POST for a contact that already exists writes the keys sent over its values and removes none. A key registered in /v1/contact-fields must hold a value of its type (text: a string; number: a number; date: YYYY-MM-DD; boolean: true or false; choice: one of its choices) or null; after a PATCH that sets attributes, or a POST that writes them to a contact that already exists, every required field must have a value. A key that is not registered is kept as it comes. A contact has up to 100 keys, each up to 64 characters long, and a text value is up to 1,000 characters long. |
| tags | string[] | optional | A new contact gets these tags. A contact that already exists gets them added to its own, and keeps every tag it has. |
| locale | string | null | optional | |
| timezone | string | null | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "contact" | required | |
| connection_id | string | required | |
| portfolio_id | string | required | |
| numbers | object[] | required | |
| numbers[].connection_id | string | required | |
| numbers[].first_seen_at | string (date-time) | required | |
| numbers[].last_seen_at | string (date-time) | null | required | |
| numbers[].is_blocked | boolean | required | |
| numbers[].in_phone_contacts | boolean | required | |
| numbers[].removed_in_app_at | string (date-time) | null | required | |
| numbers[].history_imported | boolean | required | |
| display_name | string | required | |
| phone_e164 | string | null | required | |
| wa_id | string | null | required | |
| bsuid | string | null | required | |
| username | string | null | required | |
| name | string | null | required | |
| profile_name | string | null | required | |
| attributes | object | required | |
| tags | string[] | required | |
| locale | string | null | required | |
| timezone | string | null | required | |
| is_blocked | boolean | required | |
| removed_in_app_at | string (date-time) | null | required | |
| first_seen_at | string (date-time) | required | |
| last_seen_at | string (date-time) | null | required | |
| created_at | string (date-time) | required | |
| ad | object | null | required | |
| ad.source_id | string | required | |
| ad.source_type | string | required | |
| ad.source_url | string | null | required | |
| ad.headline | string | null | required | |
| ad.body | string | null | required | |
| ad.media_type | string | null | required | |
| ad.image_url | string | null | required | |
| ad.video_url | string | null | required | |
| ad.thumbnail_url | string | null | required | |
| ad.at | string (date-time) | required |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "contact" | required | |
| connection_id | string | required | |
| portfolio_id | string | required | |
| numbers | object[] | required | |
| numbers[].connection_id | string | required | |
| numbers[].first_seen_at | string (date-time) | required | |
| numbers[].last_seen_at | string (date-time) | null | required | |
| numbers[].is_blocked | boolean | required | |
| numbers[].in_phone_contacts | boolean | required | |
| numbers[].removed_in_app_at | string (date-time) | null | required | |
| numbers[].history_imported | boolean | required | |
| display_name | string | required | |
| phone_e164 | string | null | required | |
| wa_id | string | null | required | |
| bsuid | string | null | required | |
| username | string | null | required | |
| name | string | null | required | |
| profile_name | string | null | required | |
| attributes | object | required | |
| tags | string[] | required | |
| locale | string | null | required | |
| timezone | string | null | required | |
| is_blocked | boolean | required | |
| removed_in_app_at | string (date-time) | null | required | |
| first_seen_at | string (date-time) | required | |
| last_seen_at | string (date-time) | null | required | |
| created_at | string (date-time) | required | |
| ad | object | null | required | |
| ad.source_id | string | required | |
| ad.source_type | string | required | |
| ad.source_url | string | null | required | |
| ad.headline | string | null | required | |
| ad.body | string | null | required | |
| ad.media_type | string | null | required | |
| ad.image_url | string | null | required | |
| ad.video_url | string | null | required | |
| ad.thumbnail_url | string | null | required | |
| ad.at | string (date-time) | required |
GET /v1/contacts/{id}
One contact, by id, E.164 or BSUID
Scopes contacts:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "contact" | required | |
| connection_id | string | required | |
| portfolio_id | string | required | |
| numbers | object[] | required | |
| numbers[].connection_id | string | required | |
| numbers[].first_seen_at | string (date-time) | required | |
| numbers[].last_seen_at | string (date-time) | null | required | |
| numbers[].is_blocked | boolean | required | |
| numbers[].in_phone_contacts | boolean | required | |
| numbers[].removed_in_app_at | string (date-time) | null | required | |
| numbers[].history_imported | boolean | required | |
| display_name | string | required | |
| phone_e164 | string | null | required | |
| wa_id | string | null | required | |
| bsuid | string | null | required | |
| username | string | null | required | |
| name | string | null | required | |
| profile_name | string | null | required | |
| attributes | object | required | |
| tags | string[] | required | |
| locale | string | null | required | |
| timezone | string | null | required | |
| is_blocked | boolean | required | |
| removed_in_app_at | string (date-time) | null | required | |
| first_seen_at | string (date-time) | required | |
| last_seen_at | string (date-time) | null | required | |
| created_at | string (date-time) | required | |
| ad | object | null | required | |
| ad.source_id | string | required | |
| ad.source_type | string | required | |
| ad.source_url | string | null | required | |
| ad.headline | string | null | required | |
| ad.body | string | null | required | |
| ad.media_type | string | null | required | |
| ad.image_url | string | null | required | |
| ad.video_url | string | null | required | |
| ad.thumbnail_url | string | null | required | |
| ad.at | string (date-time) | required |
PATCH /v1/contacts/{id}
Update attributes, tags, names and timezone
Scopes contacts:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | null | optional | |
| profile_name | string | null | optional | |
| attributes | object | optional | Free-form values. PATCH replaces them whole; a POST for a contact that already exists writes the keys sent over its values and removes none. A key registered in /v1/contact-fields must hold a value of its type (text: a string; number: a number; date: YYYY-MM-DD; boolean: true or false; choice: one of its choices) or null; after a PATCH that sets attributes, or a POST that writes them to a contact that already exists, every required field must have a value. A key that is not registered is kept as it comes. A contact has up to 100 keys, each up to 64 characters long, and a text value is up to 1,000 characters long. |
| tags | string[] | optional | |
| locale | string | null | optional | |
| timezone | string | null | optional | |
| is_blocked | boolean | optional | |
| connection_id | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "contact" | required | |
| connection_id | string | required | |
| portfolio_id | string | required | |
| numbers | object[] | required | |
| numbers[].connection_id | string | required | |
| numbers[].first_seen_at | string (date-time) | required | |
| numbers[].last_seen_at | string (date-time) | null | required | |
| numbers[].is_blocked | boolean | required | |
| numbers[].in_phone_contacts | boolean | required | |
| numbers[].removed_in_app_at | string (date-time) | null | required | |
| numbers[].history_imported | boolean | required | |
| display_name | string | required | |
| phone_e164 | string | null | required | |
| wa_id | string | null | required | |
| bsuid | string | null | required | |
| username | string | null | required | |
| name | string | null | required | |
| profile_name | string | null | required | |
| attributes | object | required | |
| tags | string[] | required | |
| locale | string | null | required | |
| timezone | string | null | required | |
| is_blocked | boolean | required | |
| removed_in_app_at | string (date-time) | null | required | |
| first_seen_at | string (date-time) | required | |
| last_seen_at | string (date-time) | null | required | |
| created_at | string (date-time) | required | |
| ad | object | null | required | |
| ad.source_id | string | required | |
| ad.source_type | string | required | |
| ad.source_url | string | null | required | |
| ad.headline | string | null | required | |
| ad.body | string | null | required | |
| ad.media_type | string | null | required | |
| ad.image_url | string | null | required | |
| ad.video_url | string | null | required | |
| ad.thumbnail_url | string | null | required | |
| ad.at | string (date-time) | required |
DELETE /v1/contacts/{id}
Delete a contact; ?purge=true erases it permanently, for a GDPR request
Scopes contacts:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| purge | query | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "contact" | required | |
| deleted | true | required | |
| purge | object | optional | |
| purge.erased | object | required | |
| purge.not_erased | string[] | required | |
| purge.numbers | object[] | required | |
| purge.numbers[].connection_id | string | required | |
| purge.numbers[].conversations | integer | required | |
| purge.numbers[].messages | integer | required |
GET /v1/contacts/{id}/consent
Consent state per category, with the evidence each was recorded with
Scopes contacts:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| connection_id | query | string | optional | The number whose consent is answered; the contact's first number when left out. Consent is each number's: a STOP said to one number does not change the answer for another. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "consent" | required | |
| contact_id | string | required | |
| contact | object | required | |
| contact.id | string | required | |
| contact.bsuid | string | null | required | |
| contact.phone | string | null | required | |
| contact.username | string | null | required | |
| contact.name | string | required | |
| connection_id | string | required | |
| portfolio | object | required | |
| portfolio.marketing_opt_out | object | null | required | Deprecated, and always null. A STOP, WhatsApp’s own opt-out or an owner’s entry stops marketing on the number it was said to and on no other, so nothing holds across the numbers of a business. Read number.marketing for the number you send from. |
| portfolio.marketing_opt_out.at | string (date-time) | required | |
| portfolio.marketing_opt_out.source | string | required | |
| number | object | required | |
| number.marketing | object | required | |
| number.marketing.state | "granted" | "withdrawn" | "unknown" | required | |
| number.marketing.evidence | object | null | required | |
| number.utility | object | required | |
| number.utility.state | "granted" | "withdrawn" | "unknown" | required | |
| number.utility.evidence | object | null | required | |
| number.authentication | object | required | |
| number.authentication.state | "granted" | "withdrawn" | "unknown" | required | |
| number.authentication.evidence | object | null | required | |
| categories | object | required | |
| meta_marketing_opt_out | boolean | required | |
| evidence | object | required |
POST /v1/contacts/{id}/consent
Record consent as an append-only ledger entry
Scopes contacts:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| connection_id | string | optional | |
| category | "marketing" | "utility" | "authentication" | required | |
| state | "granted" | "withdrawn" | "unknown" | required | |
| source | string | optional | |
| evidence | object | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "consent" | required | |
| contact_id | string | required | |
| contact | object | required | |
| contact.id | string | required | |
| contact.bsuid | string | null | required | |
| contact.phone | string | null | required | |
| contact.username | string | null | required | |
| contact.name | string | required | |
| connection_id | string | required | |
| portfolio | object | required | |
| portfolio.marketing_opt_out | object | null | required | Deprecated, and always null. A STOP, WhatsApp’s own opt-out or an owner’s entry stops marketing on the number it was said to and on no other, so nothing holds across the numbers of a business. Read number.marketing for the number you send from. |
| portfolio.marketing_opt_out.at | string (date-time) | required | |
| portfolio.marketing_opt_out.source | string | required | |
| number | object | required | |
| number.marketing | object | required | |
| number.marketing.state | "granted" | "withdrawn" | "unknown" | required | |
| number.marketing.evidence | object | null | required | |
| number.utility | object | required | |
| number.utility.state | "granted" | "withdrawn" | "unknown" | required | |
| number.utility.evidence | object | null | required | |
| number.authentication | object | required | |
| number.authentication.state | "granted" | "withdrawn" | "unknown" | required | |
| number.authentication.evidence | object | null | required | |
| categories | object | required | |
| meta_marketing_opt_out | boolean | required | |
| evidence | object | required |
POST /v1/contacts/{id}/merge
Merge two identities (phone + BSUID)
Scopes contacts:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| from | string | required |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "contact" | required | |
| connection_id | string | required | |
| portfolio_id | string | required | |
| numbers | object[] | required | |
| numbers[].connection_id | string | required | |
| numbers[].first_seen_at | string (date-time) | required | |
| numbers[].last_seen_at | string (date-time) | null | required | |
| numbers[].is_blocked | boolean | required | |
| numbers[].in_phone_contacts | boolean | required | |
| numbers[].removed_in_app_at | string (date-time) | null | required | |
| numbers[].history_imported | boolean | required | |
| display_name | string | required | |
| phone_e164 | string | null | required | |
| wa_id | string | null | required | |
| bsuid | string | null | required | |
| username | string | null | required | |
| name | string | null | required | |
| profile_name | string | null | required | |
| attributes | object | required | |
| tags | string[] | required | |
| locale | string | null | required | |
| timezone | string | null | required | |
| is_blocked | boolean | required | |
| removed_in_app_at | string (date-time) | null | required | |
| first_seen_at | string (date-time) | required | |
| last_seen_at | string (date-time) | null | required | |
| created_at | string (date-time) | required | |
| ad | object | null | required | |
| ad.source_id | string | required | |
| ad.source_type | string | required | |
| ad.source_url | string | null | required | |
| ad.headline | string | null | required | |
| ad.body | string | null | required | |
| ad.media_type | string | null | required | |
| ad.image_url | string | null | required | |
| ad.video_url | string | null | required | |
| ad.thumbnail_url | string | null | required | |
| ad.at | string (date-time) | required |
POST /v1/contacts/{id}/tags
Add tags to a contact; a tag it already has is left as it is
Scopes contacts:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| tags | string[] | required |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "contact" | required | |
| connection_id | string | required | |
| portfolio_id | string | required | |
| numbers | object[] | required | |
| numbers[].connection_id | string | required | |
| numbers[].first_seen_at | string (date-time) | required | |
| numbers[].last_seen_at | string (date-time) | null | required | |
| numbers[].is_blocked | boolean | required | |
| numbers[].in_phone_contacts | boolean | required | |
| numbers[].removed_in_app_at | string (date-time) | null | required | |
| numbers[].history_imported | boolean | required | |
| display_name | string | required | |
| phone_e164 | string | null | required | |
| wa_id | string | null | required | |
| bsuid | string | null | required | |
| username | string | null | required | |
| name | string | null | required | |
| profile_name | string | null | required | |
| attributes | object | required | |
| tags | string[] | required | |
| locale | string | null | required | |
| timezone | string | null | required | |
| is_blocked | boolean | required | |
| removed_in_app_at | string (date-time) | null | required | |
| first_seen_at | string (date-time) | required | |
| last_seen_at | string (date-time) | null | required | |
| created_at | string (date-time) | required | |
| ad | object | null | required | |
| ad.source_id | string | required | |
| ad.source_type | string | required | |
| ad.source_url | string | null | required | |
| ad.headline | string | null | required | |
| ad.body | string | null | required | |
| ad.media_type | string | null | required | |
| ad.image_url | string | null | required | |
| ad.video_url | string | null | required | |
| ad.thumbnail_url | string | null | required | |
| ad.at | string (date-time) | required |
DELETE /v1/contacts/{id}/tags
Remove tags from a contact; a tag it does not have is ignored
Scopes contacts:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| tags | string[] | required |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "contact" | required | |
| connection_id | string | required | |
| portfolio_id | string | required | |
| numbers | object[] | required | |
| numbers[].connection_id | string | required | |
| numbers[].first_seen_at | string (date-time) | required | |
| numbers[].last_seen_at | string (date-time) | null | required | |
| numbers[].is_blocked | boolean | required | |
| numbers[].in_phone_contacts | boolean | required | |
| numbers[].removed_in_app_at | string (date-time) | null | required | |
| numbers[].history_imported | boolean | required | |
| display_name | string | required | |
| phone_e164 | string | null | required | |
| wa_id | string | null | required | |
| bsuid | string | null | required | |
| username | string | null | required | |
| name | string | null | required | |
| profile_name | string | null | required | |
| attributes | object | required | |
| tags | string[] | required | |
| locale | string | null | required | |
| timezone | string | null | required | |
| is_blocked | boolean | required | |
| removed_in_app_at | string (date-time) | null | required | |
| first_seen_at | string (date-time) | required | |
| last_seen_at | string (date-time) | null | required | |
| created_at | string (date-time) | required | |
| ad | object | null | required | |
| ad.source_id | string | required | |
| ad.source_type | string | required | |
| ad.source_url | string | null | required | |
| ad.headline | string | null | required | |
| ad.body | string | null | required | |
| ad.media_type | string | null | required | |
| ad.image_url | string | null | required | |
| ad.video_url | string | null | required | |
| ad.thumbnail_url | string | null | required | |
| ad.at | string (date-time) | required |
GET /v1/contacts/{id}/threads
This person’s chats on each number of their business the caller may see, newest first
Scopes contacts:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].connection_id | string | required | |
| data[].contact_id | string | required | |
| data[].conversation_id | string | required | |
| data[].state | "open" | "pending" | "snoozed" | "resolved" | required | |
| data[].last_message_at | string (date-time) | null | required | |
| data[].window | object | required | |
| data[].window.state | "open" | "expiring" | "closed" | required | |
| data[].window.band | "open" | "closing" | "expiring" | "closed" | required | |
| data[].window.expires_at | string (date-time) | null | required |
GET /v1/contacts/{id}/window
Messaging-window state for a contact
Scopes contacts:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| connection_id | query | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| service_window_open | boolean | required | |
| service_window_expires_at | string (date-time) | null | required | |
| free_entry_point_expires_at | string (date-time) | null | required | |
| can_send_freeform | boolean | required | |
| expires_in_seconds | integer | null | required | |
| state | "open" | "expiring" | "closed" | required | |
| band | "open" | "closing" | "expiring" | "closed" | required | |
| object | "window" | required | |
| contact_id | string | required | |
| conversation_id | string | null | required |
POST /v1/contacts/bulk-tags
Add and remove tags on many contacts at once: up to 1,000 by id, or every contact a filter of the contact list matches
Scopes contacts:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| add | string[] | optional | |
| remove | string[] | optional | |
| contact_ids | string[] | optional | |
| filter | object | optional | The contacts GET /v1/contacts lists with these filters: q searches the name, the phone digits and the username; tag keeps contacts with every tag given; connection_id keeps contacts on any of these numbers; portfolio_id keeps one business’s. {} is every contact you can see. |
| filter.q | string | optional | |
| filter.tag | string[] | optional | |
| filter.connection_id | string[] | optional | |
| filter.portfolio_id | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| matched | integer | required | The contacts found to tag. |
| changed | integer | required | The contacts whose tags changed. One that already had every tag added and none removed is not changed, nor is one an add would take over 100 tags. |
| skipped | integer | required | The contact_ids that name no contact you can see: another workspace’s, a deleted one, or one on a number not shared with you. They are left untouched. 0 for a filter. |
/v1/conversations
GET /v1/conversations
List conversations, filtered; q searches the contact and the newest message (page size 20 under q)
Scopes messages:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| limit | query | integer | optional | |
| after | query | string | optional | |
| before | query | string | optional | |
| q | query | string | optional | |
| state | query | "open" | "pending" | "snoozed" | "resolved" | optional | |
| control | query | "bot" | "pending_human" | "human" | "app" | optional | |
| assignee_id | query | string | optional | |
| assignee | query | "none" | "me" | optional | |
| connection_id | query | string | string[] | optional | |
| include_direct | query | string | optional | |
| label | query | string | optional | |
| unread | query | string | optional | |
| waiting | query | string | optional | |
| needs_person | query | string | optional | |
| window_state | query | "open" | "closing" | "expiring" | "closed" | ("open" | "closing" | "expiring" | "closed")[] | optional | |
| order | query | "recent" | "urgency" | "waiting_longest" | optional | |
| priority | query | "normal" | "priority" | "high_priority" | optional | |
| campaign_id | query | string | optional | |
| expand | query | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].object | "conversation" | required | |
| data[].connection_id | string | required | |
| data[].contact_id | string | required | |
| data[].state | "open" | "pending" | "snoozed" | "resolved" | required | |
| data[].control | "bot" | "pending_human" | "human" | "app" | required | |
| data[].assignee_id | string | null | required | |
| data[].unread_count | integer | required | |
| data[].message_count | integer | required | |
| data[].last_message_at | string (date-time) | null | required | |
| data[].snoozed_until | string (date-time) | null | required | |
| data[].window | object | required | |
| data[].window.service_window_open | boolean | required | |
| data[].window.service_window_expires_at | string (date-time) | null | required | |
| data[].window.free_entry_point_expires_at | string (date-time) | null | required | |
| data[].window.can_send_freeform | boolean | required | |
| data[].window.expires_in_seconds | integer | null | required | |
| data[].window.state | "open" | "expiring" | "closed" | required | |
| data[].window.band | "open" | "closing" | "expiring" | "closed" | required | |
| data[].lock | object | required | |
| data[].lock.held | boolean | required | |
| data[].lock.held_by | string | null | required | |
| data[].lock.held_by_name | string | null | required | |
| data[].lock.idle | boolean | required | |
| data[].lock.expires_at | string (date-time) | null | required | |
| data[].lock.can_i_send | boolean | required | |
| data[].lock.can_i_take_over | "yes" | "request" | "no" | required | |
| data[].lock.pending_request | object | null | required | |
| data[].waiting | object | null | required | |
| data[].waiting.since | string (date-time) | required | |
| data[].waiting.reason | "unanswered" | "handed_over" | required | |
| data[].waiting.summary | string | null | required | |
| data[].needs_person | object | null | required | |
| data[].needs_person.since | string (date-time) | required | |
| data[].needs_person.reason | string | null | required | |
| data[].needs_person.summary | string | null | required | |
| data[].handoff | object | null | required | |
| data[].handoff.at | string (date-time) | required | |
| data[].handoff.reason | string | null | required | |
| data[].handoff.summary | object | null | required | |
| data[].priority | "normal" | "priority" | "high_priority" | required | |
| data[].resolved_at | string (date-time) | null | required | |
| data[].resolved_by | string | null | required | |
| data[].labels | string[] | required | |
| data[].created_at | string (date-time) | required | |
| data[].ad | object | null | required | |
| data[].ad.source_id | string | required | |
| data[].ad.source_type | string | required | |
| data[].ad.source_url | string | null | required | |
| data[].ad.headline | string | null | required | |
| data[].ad.body | string | null | required | |
| data[].ad.media_type | string | null | required | |
| data[].ad.image_url | string | null | required | |
| data[].ad.video_url | string | null | required | |
| data[].ad.thumbnail_url | string | null | required | |
| data[].ad.at | string (date-time) | required | |
| data[].contact | object | null | required | |
| data[].contact.id | string | required | |
| data[].contact.object | "contact" | required | |
| data[].contact.connection_id | string | required | |
| data[].contact.portfolio_id | string | required | |
| data[].contact.numbers | object[] | required | |
| data[].contact.display_name | string | required | |
| data[].contact.phone_e164 | string | null | required | |
| data[].contact.wa_id | string | null | required | |
| data[].contact.bsuid | string | null | required | |
| data[].contact.username | string | null | required | |
| data[].contact.name | string | null | required | |
| data[].contact.profile_name | string | null | required | |
| data[].contact.attributes | object | required | |
| data[].contact.tags | string[] | required | |
| data[].contact.locale | string | null | required | |
| data[].contact.timezone | string | null | required | |
| data[].contact.is_blocked | boolean | required | |
| data[].contact.removed_in_app_at | string (date-time) | null | required | |
| data[].contact.first_seen_at | string (date-time) | required | |
| data[].contact.last_seen_at | string (date-time) | null | required | |
| data[].contact.created_at | string (date-time) | required | |
| data[].contact.ad | object | null | required | |
| data[].last_message | object | null | required | |
| data[].last_message.id | string | required | |
| data[].last_message.object | "message" | required | |
| data[].last_message.conversation_id | string | required | |
| data[].last_message.contact_id | string | required | |
| data[].last_message.contact | object | required | |
| data[].last_message.connection_id | string | required | |
| data[].last_message.wamid | string | null | required | |
| data[].last_message.direction | "inbound" | "outbound" | required | |
| data[].last_message.source | "customer" | "app" | "api" | "agent" | "automation" | "ai" | "notify" | "history" | … | required | |
| data[].last_message.status | "queued" | "sending" | "sent" | "delivered" | "read" | "played" | "failed" | "deleted" | … | required | |
| data[].last_message.type | string | required | |
| data[].last_message.content | object | required | |
| data[].last_message.location | object | null | required | |
| data[].last_message.contact_cards | object[] | null | required | |
| data[].last_message.label | string | null | required | |
| data[].last_message.forwarded | boolean | required | |
| data[].last_message.frequently_forwarded | boolean | required | |
| data[].last_message.tap | object | null | required | |
| data[].last_message.template_text | object | null | required | The words a template message showed the customer: the header and body with the values the send filled in, the footer, and the button labels. Rendered from the template Cosend holds and the values the send used. An authentication template never shows its one-time code: the placeholder stays as written. When Cosend no longer holds the template, body is the text stored when it was sent and the rest is empty. null on every other message, on a template Cosend has no words for, and on a direct-mode connection. |
| data[].last_message.reply_to | object | null | required | |
| data[].last_message.reactions | object[] | required | |
| data[].last_message.metadata | object | required | |
| data[].last_message.created_at | string (date-time) | required | |
| data[].last_message.wa_timestamp | string (date-time) | required | |
| data[].last_message.is_imported | boolean | required | |
| data[].last_message.media_state | "none" | "pending" | "stored" | "expired" | "unavailable" | required | |
| data[].last_message.media_expires_at | string (date-time) | null | required | |
| data[].last_message.media | object | null | required | The file this message carries. status is pending while Cosend fetches it from Meta, ready once it is stored (open it with GET /v1/media/{id} or /v1/media/{id}/content; id is null in the other two states), and failed with failure_reason saying why in plain words. kind is voice for a WhatsApp voice note. On a template message, the header’s image, video or document, when the send named a file uploaded to Cosend (caption is null). null on a message with no file Cosend keeps. |
| data[].last_message.transcript | object | null | required | The words of an inbound voice note or audio file. null while Cosend transcribes it, and on every other message. ready carries text; failed says why in failure_reason; skipped means transcription is unavailable. The recording in media is the same whatever this says. |
| data[].last_message.client_token | string | null | required | |
| data[].last_message.author_user_id | string | null | required | |
| data[].last_message.automation_run_id | string | null | required | |
| data[].last_message.campaign_id | string | null | required | |
| data[].last_message.campaign_name | string | null | required | |
| data[].last_message.error_code | integer | null | required | |
| data[].last_message.error_title | string | null | required | |
| data[].last_message.error_detail | string | null | required | |
| data[].connection | object | null | required | |
| data[].connection.id | string | required | |
| data[].connection.verified_name | string | null | required | |
| data[].connection.display_phone_number | string | required | |
| data[].connection.delivery_mode | "stored" | "direct" | required | |
| data[].last_read_at | string (date-time) | null | required | |
| has_more | boolean | required | |
| next_cursor | string | null | required |
GET /v1/conversations/{id}
One conversation, with its window and lock blocks
Scopes messages:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| expand | query | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "conversation" | required | |
| connection_id | string | required | |
| contact_id | string | required | |
| state | "open" | "pending" | "snoozed" | "resolved" | required | |
| control | "bot" | "pending_human" | "human" | "app" | required | |
| assignee_id | string | null | required | |
| unread_count | integer | required | |
| message_count | integer | required | |
| last_message_at | string (date-time) | null | required | |
| snoozed_until | string (date-time) | null | required | |
| window | object | required | |
| window.service_window_open | boolean | required | |
| window.service_window_expires_at | string (date-time) | null | required | |
| window.free_entry_point_expires_at | string (date-time) | null | required | |
| window.can_send_freeform | boolean | required | |
| window.expires_in_seconds | integer | null | required | |
| window.state | "open" | "expiring" | "closed" | required | |
| window.band | "open" | "closing" | "expiring" | "closed" | required | |
| lock | object | required | |
| lock.held | boolean | required | |
| lock.held_by | string | null | required | |
| lock.held_by_name | string | null | required | |
| lock.idle | boolean | required | |
| lock.expires_at | string (date-time) | null | required | |
| lock.can_i_send | boolean | required | |
| lock.can_i_take_over | "yes" | "request" | "no" | required | |
| lock.pending_request | object | null | required | |
| lock.pending_request.id | string | required | |
| lock.pending_request.requested_by | string | required | |
| lock.pending_request.requested_by_name | string | null | required | |
| lock.pending_request.auto_grants_at | string (date-time) | required | |
| waiting | object | null | required | |
| waiting.since | string (date-time) | required | |
| waiting.reason | "unanswered" | "handed_over" | required | |
| waiting.summary | string | null | required | |
| needs_person | object | null | required | |
| needs_person.since | string (date-time) | required | |
| needs_person.reason | string | null | required | |
| needs_person.summary | string | null | required | |
| handoff | object | null | required | |
| handoff.at | string (date-time) | required | |
| handoff.reason | string | null | required | |
| handoff.summary | object | null | required | |
| handoff.summary.customer | string | null | required | |
| handoff.summary.wants | string | null | required | |
| handoff.summary.answered | string | null | required | |
| handoff.summary.still_open | string | null | required | |
| handoff.summary.mood | string | null | required | |
| handoff.summary.language | string | null | required | |
| handoff.summary.actions | object[] | required | |
| priority | "normal" | "priority" | "high_priority" | required | |
| resolved_at | string (date-time) | null | required | |
| resolved_by | string | null | required | |
| labels | string[] | required | |
| created_at | string (date-time) | required | |
| ad | object | null | required | |
| ad.source_id | string | required | |
| ad.source_type | string | required | |
| ad.source_url | string | null | required | |
| ad.headline | string | null | required | |
| ad.body | string | null | required | |
| ad.media_type | string | null | required | |
| ad.image_url | string | null | required | |
| ad.video_url | string | null | required | |
| ad.thumbnail_url | string | null | required | |
| ad.at | string (date-time) | required | |
| contact | object | null | required | |
| contact.id | string | required | |
| contact.object | "contact" | required | |
| contact.connection_id | string | required | |
| contact.portfolio_id | string | required | |
| contact.numbers | object[] | required | |
| contact.numbers[].connection_id | string | required | |
| contact.numbers[].first_seen_at | string (date-time) | required | |
| contact.numbers[].last_seen_at | string (date-time) | null | required | |
| contact.numbers[].is_blocked | boolean | required | |
| contact.numbers[].in_phone_contacts | boolean | required | |
| contact.numbers[].removed_in_app_at | string (date-time) | null | required | |
| contact.numbers[].history_imported | boolean | required | |
| contact.display_name | string | required | |
| contact.phone_e164 | string | null | required | |
| contact.wa_id | string | null | required | |
| contact.bsuid | string | null | required | |
| contact.username | string | null | required | |
| contact.name | string | null | required | |
| contact.profile_name | string | null | required | |
| contact.attributes | object | required | |
| contact.tags | string[] | required | |
| contact.locale | string | null | required | |
| contact.timezone | string | null | required | |
| contact.is_blocked | boolean | required | |
| contact.removed_in_app_at | string (date-time) | null | required | |
| contact.first_seen_at | string (date-time) | required | |
| contact.last_seen_at | string (date-time) | null | required | |
| contact.created_at | string (date-time) | required | |
| contact.ad | object | null | required | |
| contact.ad.source_id | string | required | |
| contact.ad.source_type | string | required | |
| contact.ad.source_url | string | null | required | |
| contact.ad.headline | string | null | required | |
| contact.ad.body | string | null | required | |
| contact.ad.media_type | string | null | required | |
| contact.ad.image_url | string | null | required | |
| contact.ad.video_url | string | null | required | |
| contact.ad.thumbnail_url | string | null | required | |
| contact.ad.at | string (date-time) | required | |
| last_message | object | null | required | |
| last_message.id | string | required | |
| last_message.object | "message" | required | |
| last_message.conversation_id | string | required | |
| last_message.contact_id | string | required | |
| last_message.contact | object | required | |
| last_message.contact.id | string | required | |
| last_message.contact.bsuid | string | null | required | |
| last_message.contact.phone | string | null | required | |
| last_message.contact.username | string | null | required | |
| last_message.contact.name | string | required | |
| last_message.connection_id | string | required | |
| last_message.wamid | string | null | required | |
| last_message.direction | "inbound" | "outbound" | required | |
| last_message.source | "customer" | "app" | "api" | "agent" | "automation" | "ai" | "notify" | "history" | … | required | |
| last_message.status | "queued" | "sending" | "sent" | "delivered" | "read" | "played" | "failed" | "deleted" | … | required | |
| last_message.type | string | required | |
| last_message.content | object | required | |
| last_message.location | object | null | required | |
| last_message.location.latitude | number | required | |
| last_message.location.longitude | number | required | |
| last_message.location.name | string | null | required | |
| last_message.location.address | string | null | required | |
| last_message.location.url | string | null | required | |
| last_message.contact_cards | object[] | null | required | |
| last_message.contact_cards[].name | string | null | required | |
| last_message.contact_cards[].phones | object[] | required | |
| last_message.contact_cards[].emails | object[] | required | |
| last_message.contact_cards[].org | object | null | required | |
| last_message.label | string | null | required | |
| last_message.forwarded | boolean | required | |
| last_message.frequently_forwarded | boolean | required | |
| last_message.tap | object | null | required | |
| last_message.tap.kind | "button_reply" | "list_reply" | "button" | required | |
| last_message.tap.id | string | required | |
| last_message.tap.title | string | required | |
| last_message.tap.description | string | null | required | |
| last_message.template_text | object | null | required | The words a template message showed the customer: the header and body with the values the send filled in, the footer, and the button labels. Rendered from the template Cosend holds and the values the send used. An authentication template never shows its one-time code: the placeholder stays as written. When Cosend no longer holds the template, body is the text stored when it was sent and the rest is empty. null on every other message, on a template Cosend has no words for, and on a direct-mode connection. |
| last_message.template_text.header | string | null | required | |
| last_message.template_text.body | string | null | required | |
| last_message.template_text.footer | string | null | required | |
| last_message.template_text.buttons | string[] | required | |
| last_message.reply_to | object | null | required | |
| last_message.reply_to.id | string | null | required | |
| last_message.reply_to.wamid | string | required | |
| last_message.reply_to.kind | string | null | required | |
| last_message.reply_to.from | "contact" | "business" | null | required | |
| last_message.reply_to.preview | string | required | |
| last_message.reactions | object[] | required | |
| last_message.reactions[].emoji | string | required | |
| last_message.reactions[].direction | "inbound" | "outbound" | required | |
| last_message.reactions[].message_id | string | required | |
| last_message.reactions[].created_at | string (date-time) | required | |
| last_message.metadata | object | required | |
| last_message.created_at | string (date-time) | required | |
| last_message.wa_timestamp | string (date-time) | required | |
| last_message.is_imported | boolean | required | |
| last_message.media_state | "none" | "pending" | "stored" | "expired" | "unavailable" | required | |
| last_message.media_expires_at | string (date-time) | null | required | |
| last_message.media | object | null | required | The file this message carries. status is pending while Cosend fetches it from Meta, ready once it is stored (open it with GET /v1/media/{id} or /v1/media/{id}/content; id is null in the other two states), and failed with failure_reason saying why in plain words. kind is voice for a WhatsApp voice note. On a template message, the header’s image, video or document, when the send named a file uploaded to Cosend (caption is null). null on a message with no file Cosend keeps. |
| last_message.media.id | string | null | required | |
| last_message.media.kind | "image" | "video" | "audio" | "voice" | "document" | "sticker" | required | |
| last_message.media.mime_type | string | null | required | |
| last_message.media.size_bytes | integer | null | required | |
| last_message.media.filename | string | null | required | |
| last_message.media.caption | string | null | required | |
| last_message.media.animated | boolean | null | required | |
| last_message.media.status | "pending" | "ready" | "failed" | required | |
| last_message.media.failure_reason | string | null | required | |
| last_message.transcript | object | null | required | The words of an inbound voice note or audio file. null while Cosend transcribes it, and on every other message. ready carries text; failed says why in failure_reason; skipped means transcription is unavailable. The recording in media is the same whatever this says. |
| last_message.transcript.status | "ready" | "failed" | "skipped" | required | |
| last_message.transcript.text | string | null | required | |
| last_message.transcript.language | string | null | required | |
| last_message.transcript.model | string | null | required | |
| last_message.transcript.failure_reason | string | null | required | |
| last_message.client_token | string | null | required | |
| last_message.author_user_id | string | null | required | |
| last_message.automation_run_id | string | null | required | |
| last_message.campaign_id | string | null | required | |
| last_message.campaign_name | string | null | required | |
| last_message.error_code | integer | null | required | |
| last_message.error_title | string | null | required | |
| last_message.error_detail | string | null | required | |
| connection | object | null | required | |
| connection.id | string | required | |
| connection.verified_name | string | null | required | |
| connection.display_phone_number | string | required | |
| connection.delivery_mode | "stored" | "direct" | required | |
| last_read_at | string (date-time) | null | required |
PATCH /v1/conversations/{id}
State, assignee, snooze, labels and priority. state: resolved is Done, the same as POST /resolve
Scopes messages:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| state | "open" | "pending" | "snoozed" | "resolved" | optional | |
| assignee_id | string | null | optional | |
| snoozed_until | string (date-time) | null | optional | |
| labels | string[] | optional | |
| priority | "normal" | "priority" | "high_priority" | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "conversation" | required | |
| connection_id | string | required | |
| contact_id | string | required | |
| state | "open" | "pending" | "snoozed" | "resolved" | required | |
| control | "bot" | "pending_human" | "human" | "app" | required | |
| assignee_id | string | null | required | |
| unread_count | integer | required | |
| message_count | integer | required | |
| last_message_at | string (date-time) | null | required | |
| snoozed_until | string (date-time) | null | required | |
| window | object | required | |
| window.service_window_open | boolean | required | |
| window.service_window_expires_at | string (date-time) | null | required | |
| window.free_entry_point_expires_at | string (date-time) | null | required | |
| window.can_send_freeform | boolean | required | |
| window.expires_in_seconds | integer | null | required | |
| window.state | "open" | "expiring" | "closed" | required | |
| window.band | "open" | "closing" | "expiring" | "closed" | required | |
| lock | object | required | |
| lock.held | boolean | required | |
| lock.held_by | string | null | required | |
| lock.held_by_name | string | null | required | |
| lock.idle | boolean | required | |
| lock.expires_at | string (date-time) | null | required | |
| lock.can_i_send | boolean | required | |
| lock.can_i_take_over | "yes" | "request" | "no" | required | |
| lock.pending_request | object | null | required | |
| lock.pending_request.id | string | required | |
| lock.pending_request.requested_by | string | required | |
| lock.pending_request.requested_by_name | string | null | required | |
| lock.pending_request.auto_grants_at | string (date-time) | required | |
| waiting | object | null | required | |
| waiting.since | string (date-time) | required | |
| waiting.reason | "unanswered" | "handed_over" | required | |
| waiting.summary | string | null | required | |
| needs_person | object | null | required | |
| needs_person.since | string (date-time) | required | |
| needs_person.reason | string | null | required | |
| needs_person.summary | string | null | required | |
| handoff | object | null | required | |
| handoff.at | string (date-time) | required | |
| handoff.reason | string | null | required | |
| handoff.summary | object | null | required | |
| handoff.summary.customer | string | null | required | |
| handoff.summary.wants | string | null | required | |
| handoff.summary.answered | string | null | required | |
| handoff.summary.still_open | string | null | required | |
| handoff.summary.mood | string | null | required | |
| handoff.summary.language | string | null | required | |
| handoff.summary.actions | object[] | required | |
| priority | "normal" | "priority" | "high_priority" | required | |
| resolved_at | string (date-time) | null | required | |
| resolved_by | string | null | required | |
| labels | string[] | required | |
| created_at | string (date-time) | required | |
| ad | object | null | required | |
| ad.source_id | string | required | |
| ad.source_type | string | required | |
| ad.source_url | string | null | required | |
| ad.headline | string | null | required | |
| ad.body | string | null | required | |
| ad.media_type | string | null | required | |
| ad.image_url | string | null | required | |
| ad.video_url | string | null | required | |
| ad.thumbnail_url | string | null | required | |
| ad.at | string (date-time) | required | |
| contact | object | null | required | |
| contact.id | string | required | |
| contact.object | "contact" | required | |
| contact.connection_id | string | required | |
| contact.portfolio_id | string | required | |
| contact.numbers | object[] | required | |
| contact.numbers[].connection_id | string | required | |
| contact.numbers[].first_seen_at | string (date-time) | required | |
| contact.numbers[].last_seen_at | string (date-time) | null | required | |
| contact.numbers[].is_blocked | boolean | required | |
| contact.numbers[].in_phone_contacts | boolean | required | |
| contact.numbers[].removed_in_app_at | string (date-time) | null | required | |
| contact.numbers[].history_imported | boolean | required | |
| contact.display_name | string | required | |
| contact.phone_e164 | string | null | required | |
| contact.wa_id | string | null | required | |
| contact.bsuid | string | null | required | |
| contact.username | string | null | required | |
| contact.name | string | null | required | |
| contact.profile_name | string | null | required | |
| contact.attributes | object | required | |
| contact.tags | string[] | required | |
| contact.locale | string | null | required | |
| contact.timezone | string | null | required | |
| contact.is_blocked | boolean | required | |
| contact.removed_in_app_at | string (date-time) | null | required | |
| contact.first_seen_at | string (date-time) | required | |
| contact.last_seen_at | string (date-time) | null | required | |
| contact.created_at | string (date-time) | required | |
| contact.ad | object | null | required | |
| contact.ad.source_id | string | required | |
| contact.ad.source_type | string | required | |
| contact.ad.source_url | string | null | required | |
| contact.ad.headline | string | null | required | |
| contact.ad.body | string | null | required | |
| contact.ad.media_type | string | null | required | |
| contact.ad.image_url | string | null | required | |
| contact.ad.video_url | string | null | required | |
| contact.ad.thumbnail_url | string | null | required | |
| contact.ad.at | string (date-time) | required | |
| last_message | object | null | required | |
| last_message.id | string | required | |
| last_message.object | "message" | required | |
| last_message.conversation_id | string | required | |
| last_message.contact_id | string | required | |
| last_message.contact | object | required | |
| last_message.contact.id | string | required | |
| last_message.contact.bsuid | string | null | required | |
| last_message.contact.phone | string | null | required | |
| last_message.contact.username | string | null | required | |
| last_message.contact.name | string | required | |
| last_message.connection_id | string | required | |
| last_message.wamid | string | null | required | |
| last_message.direction | "inbound" | "outbound" | required | |
| last_message.source | "customer" | "app" | "api" | "agent" | "automation" | "ai" | "notify" | "history" | … | required | |
| last_message.status | "queued" | "sending" | "sent" | "delivered" | "read" | "played" | "failed" | "deleted" | … | required | |
| last_message.type | string | required | |
| last_message.content | object | required | |
| last_message.location | object | null | required | |
| last_message.location.latitude | number | required | |
| last_message.location.longitude | number | required | |
| last_message.location.name | string | null | required | |
| last_message.location.address | string | null | required | |
| last_message.location.url | string | null | required | |
| last_message.contact_cards | object[] | null | required | |
| last_message.contact_cards[].name | string | null | required | |
| last_message.contact_cards[].phones | object[] | required | |
| last_message.contact_cards[].emails | object[] | required | |
| last_message.contact_cards[].org | object | null | required | |
| last_message.label | string | null | required | |
| last_message.forwarded | boolean | required | |
| last_message.frequently_forwarded | boolean | required | |
| last_message.tap | object | null | required | |
| last_message.tap.kind | "button_reply" | "list_reply" | "button" | required | |
| last_message.tap.id | string | required | |
| last_message.tap.title | string | required | |
| last_message.tap.description | string | null | required | |
| last_message.template_text | object | null | required | The words a template message showed the customer: the header and body with the values the send filled in, the footer, and the button labels. Rendered from the template Cosend holds and the values the send used. An authentication template never shows its one-time code: the placeholder stays as written. When Cosend no longer holds the template, body is the text stored when it was sent and the rest is empty. null on every other message, on a template Cosend has no words for, and on a direct-mode connection. |
| last_message.template_text.header | string | null | required | |
| last_message.template_text.body | string | null | required | |
| last_message.template_text.footer | string | null | required | |
| last_message.template_text.buttons | string[] | required | |
| last_message.reply_to | object | null | required | |
| last_message.reply_to.id | string | null | required | |
| last_message.reply_to.wamid | string | required | |
| last_message.reply_to.kind | string | null | required | |
| last_message.reply_to.from | "contact" | "business" | null | required | |
| last_message.reply_to.preview | string | required | |
| last_message.reactions | object[] | required | |
| last_message.reactions[].emoji | string | required | |
| last_message.reactions[].direction | "inbound" | "outbound" | required | |
| last_message.reactions[].message_id | string | required | |
| last_message.reactions[].created_at | string (date-time) | required | |
| last_message.metadata | object | required | |
| last_message.created_at | string (date-time) | required | |
| last_message.wa_timestamp | string (date-time) | required | |
| last_message.is_imported | boolean | required | |
| last_message.media_state | "none" | "pending" | "stored" | "expired" | "unavailable" | required | |
| last_message.media_expires_at | string (date-time) | null | required | |
| last_message.media | object | null | required | The file this message carries. status is pending while Cosend fetches it from Meta, ready once it is stored (open it with GET /v1/media/{id} or /v1/media/{id}/content; id is null in the other two states), and failed with failure_reason saying why in plain words. kind is voice for a WhatsApp voice note. On a template message, the header’s image, video or document, when the send named a file uploaded to Cosend (caption is null). null on a message with no file Cosend keeps. |
| last_message.media.id | string | null | required | |
| last_message.media.kind | "image" | "video" | "audio" | "voice" | "document" | "sticker" | required | |
| last_message.media.mime_type | string | null | required | |
| last_message.media.size_bytes | integer | null | required | |
| last_message.media.filename | string | null | required | |
| last_message.media.caption | string | null | required | |
| last_message.media.animated | boolean | null | required | |
| last_message.media.status | "pending" | "ready" | "failed" | required | |
| last_message.media.failure_reason | string | null | required | |
| last_message.transcript | object | null | required | The words of an inbound voice note or audio file. null while Cosend transcribes it, and on every other message. ready carries text; failed says why in failure_reason; skipped means transcription is unavailable. The recording in media is the same whatever this says. |
| last_message.transcript.status | "ready" | "failed" | "skipped" | required | |
| last_message.transcript.text | string | null | required | |
| last_message.transcript.language | string | null | required | |
| last_message.transcript.model | string | null | required | |
| last_message.transcript.failure_reason | string | null | required | |
| last_message.client_token | string | null | required | |
| last_message.author_user_id | string | null | required | |
| last_message.automation_run_id | string | null | required | |
| last_message.campaign_id | string | null | required | |
| last_message.campaign_name | string | null | required | |
| last_message.error_code | integer | null | required | |
| last_message.error_title | string | null | required | |
| last_message.error_detail | string | null | required | |
| connection | object | null | required | |
| connection.id | string | required | |
| connection.verified_name | string | null | required | |
| connection.display_phone_number | string | required | |
| connection.delivery_mode | "stored" | "direct" | required | |
| last_read_at | string (date-time) | null | required |
POST /v1/conversations/{id}/control
Bot ↔ human handoff
Scopes messages:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| control | "pending_human" | "human" | required | |
| reason | string | optional | |
| pause_bot_until | string (date-time) | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "conversation" | required | |
| connection_id | string | required | |
| contact_id | string | required | |
| state | "open" | "pending" | "snoozed" | "resolved" | required | |
| control | "bot" | "pending_human" | "human" | "app" | required | |
| assignee_id | string | null | required | |
| unread_count | integer | required | |
| message_count | integer | required | |
| last_message_at | string (date-time) | null | required | |
| snoozed_until | string (date-time) | null | required | |
| window | object | required | |
| window.service_window_open | boolean | required | |
| window.service_window_expires_at | string (date-time) | null | required | |
| window.free_entry_point_expires_at | string (date-time) | null | required | |
| window.can_send_freeform | boolean | required | |
| window.expires_in_seconds | integer | null | required | |
| window.state | "open" | "expiring" | "closed" | required | |
| window.band | "open" | "closing" | "expiring" | "closed" | required | |
| lock | object | required | |
| lock.held | boolean | required | |
| lock.held_by | string | null | required | |
| lock.held_by_name | string | null | required | |
| lock.idle | boolean | required | |
| lock.expires_at | string (date-time) | null | required | |
| lock.can_i_send | boolean | required | |
| lock.can_i_take_over | "yes" | "request" | "no" | required | |
| lock.pending_request | object | null | required | |
| lock.pending_request.id | string | required | |
| lock.pending_request.requested_by | string | required | |
| lock.pending_request.requested_by_name | string | null | required | |
| lock.pending_request.auto_grants_at | string (date-time) | required | |
| waiting | object | null | required | |
| waiting.since | string (date-time) | required | |
| waiting.reason | "unanswered" | "handed_over" | required | |
| waiting.summary | string | null | required | |
| needs_person | object | null | required | |
| needs_person.since | string (date-time) | required | |
| needs_person.reason | string | null | required | |
| needs_person.summary | string | null | required | |
| handoff | object | null | required | |
| handoff.at | string (date-time) | required | |
| handoff.reason | string | null | required | |
| handoff.summary | object | null | required | |
| handoff.summary.customer | string | null | required | |
| handoff.summary.wants | string | null | required | |
| handoff.summary.answered | string | null | required | |
| handoff.summary.still_open | string | null | required | |
| handoff.summary.mood | string | null | required | |
| handoff.summary.language | string | null | required | |
| handoff.summary.actions | object[] | required | |
| priority | "normal" | "priority" | "high_priority" | required | |
| resolved_at | string (date-time) | null | required | |
| resolved_by | string | null | required | |
| labels | string[] | required | |
| created_at | string (date-time) | required | |
| ad | object | null | required | |
| ad.source_id | string | required | |
| ad.source_type | string | required | |
| ad.source_url | string | null | required | |
| ad.headline | string | null | required | |
| ad.body | string | null | required | |
| ad.media_type | string | null | required | |
| ad.image_url | string | null | required | |
| ad.video_url | string | null | required | |
| ad.thumbnail_url | string | null | required | |
| ad.at | string (date-time) | required | |
| contact | object | null | required | |
| contact.id | string | required | |
| contact.object | "contact" | required | |
| contact.connection_id | string | required | |
| contact.portfolio_id | string | required | |
| contact.numbers | object[] | required | |
| contact.numbers[].connection_id | string | required | |
| contact.numbers[].first_seen_at | string (date-time) | required | |
| contact.numbers[].last_seen_at | string (date-time) | null | required | |
| contact.numbers[].is_blocked | boolean | required | |
| contact.numbers[].in_phone_contacts | boolean | required | |
| contact.numbers[].removed_in_app_at | string (date-time) | null | required | |
| contact.numbers[].history_imported | boolean | required | |
| contact.display_name | string | required | |
| contact.phone_e164 | string | null | required | |
| contact.wa_id | string | null | required | |
| contact.bsuid | string | null | required | |
| contact.username | string | null | required | |
| contact.name | string | null | required | |
| contact.profile_name | string | null | required | |
| contact.attributes | object | required | |
| contact.tags | string[] | required | |
| contact.locale | string | null | required | |
| contact.timezone | string | null | required | |
| contact.is_blocked | boolean | required | |
| contact.removed_in_app_at | string (date-time) | null | required | |
| contact.first_seen_at | string (date-time) | required | |
| contact.last_seen_at | string (date-time) | null | required | |
| contact.created_at | string (date-time) | required | |
| contact.ad | object | null | required | |
| contact.ad.source_id | string | required | |
| contact.ad.source_type | string | required | |
| contact.ad.source_url | string | null | required | |
| contact.ad.headline | string | null | required | |
| contact.ad.body | string | null | required | |
| contact.ad.media_type | string | null | required | |
| contact.ad.image_url | string | null | required | |
| contact.ad.video_url | string | null | required | |
| contact.ad.thumbnail_url | string | null | required | |
| contact.ad.at | string (date-time) | required | |
| last_message | object | null | required | |
| last_message.id | string | required | |
| last_message.object | "message" | required | |
| last_message.conversation_id | string | required | |
| last_message.contact_id | string | required | |
| last_message.contact | object | required | |
| last_message.contact.id | string | required | |
| last_message.contact.bsuid | string | null | required | |
| last_message.contact.phone | string | null | required | |
| last_message.contact.username | string | null | required | |
| last_message.contact.name | string | required | |
| last_message.connection_id | string | required | |
| last_message.wamid | string | null | required | |
| last_message.direction | "inbound" | "outbound" | required | |
| last_message.source | "customer" | "app" | "api" | "agent" | "automation" | "ai" | "notify" | "history" | … | required | |
| last_message.status | "queued" | "sending" | "sent" | "delivered" | "read" | "played" | "failed" | "deleted" | … | required | |
| last_message.type | string | required | |
| last_message.content | object | required | |
| last_message.location | object | null | required | |
| last_message.location.latitude | number | required | |
| last_message.location.longitude | number | required | |
| last_message.location.name | string | null | required | |
| last_message.location.address | string | null | required | |
| last_message.location.url | string | null | required | |
| last_message.contact_cards | object[] | null | required | |
| last_message.contact_cards[].name | string | null | required | |
| last_message.contact_cards[].phones | object[] | required | |
| last_message.contact_cards[].emails | object[] | required | |
| last_message.contact_cards[].org | object | null | required | |
| last_message.label | string | null | required | |
| last_message.forwarded | boolean | required | |
| last_message.frequently_forwarded | boolean | required | |
| last_message.tap | object | null | required | |
| last_message.tap.kind | "button_reply" | "list_reply" | "button" | required | |
| last_message.tap.id | string | required | |
| last_message.tap.title | string | required | |
| last_message.tap.description | string | null | required | |
| last_message.template_text | object | null | required | The words a template message showed the customer: the header and body with the values the send filled in, the footer, and the button labels. Rendered from the template Cosend holds and the values the send used. An authentication template never shows its one-time code: the placeholder stays as written. When Cosend no longer holds the template, body is the text stored when it was sent and the rest is empty. null on every other message, on a template Cosend has no words for, and on a direct-mode connection. |
| last_message.template_text.header | string | null | required | |
| last_message.template_text.body | string | null | required | |
| last_message.template_text.footer | string | null | required | |
| last_message.template_text.buttons | string[] | required | |
| last_message.reply_to | object | null | required | |
| last_message.reply_to.id | string | null | required | |
| last_message.reply_to.wamid | string | required | |
| last_message.reply_to.kind | string | null | required | |
| last_message.reply_to.from | "contact" | "business" | null | required | |
| last_message.reply_to.preview | string | required | |
| last_message.reactions | object[] | required | |
| last_message.reactions[].emoji | string | required | |
| last_message.reactions[].direction | "inbound" | "outbound" | required | |
| last_message.reactions[].message_id | string | required | |
| last_message.reactions[].created_at | string (date-time) | required | |
| last_message.metadata | object | required | |
| last_message.created_at | string (date-time) | required | |
| last_message.wa_timestamp | string (date-time) | required | |
| last_message.is_imported | boolean | required | |
| last_message.media_state | "none" | "pending" | "stored" | "expired" | "unavailable" | required | |
| last_message.media_expires_at | string (date-time) | null | required | |
| last_message.media | object | null | required | The file this message carries. status is pending while Cosend fetches it from Meta, ready once it is stored (open it with GET /v1/media/{id} or /v1/media/{id}/content; id is null in the other two states), and failed with failure_reason saying why in plain words. kind is voice for a WhatsApp voice note. On a template message, the header’s image, video or document, when the send named a file uploaded to Cosend (caption is null). null on a message with no file Cosend keeps. |
| last_message.media.id | string | null | required | |
| last_message.media.kind | "image" | "video" | "audio" | "voice" | "document" | "sticker" | required | |
| last_message.media.mime_type | string | null | required | |
| last_message.media.size_bytes | integer | null | required | |
| last_message.media.filename | string | null | required | |
| last_message.media.caption | string | null | required | |
| last_message.media.animated | boolean | null | required | |
| last_message.media.status | "pending" | "ready" | "failed" | required | |
| last_message.media.failure_reason | string | null | required | |
| last_message.transcript | object | null | required | The words of an inbound voice note or audio file. null while Cosend transcribes it, and on every other message. ready carries text; failed says why in failure_reason; skipped means transcription is unavailable. The recording in media is the same whatever this says. |
| last_message.transcript.status | "ready" | "failed" | "skipped" | required | |
| last_message.transcript.text | string | null | required | |
| last_message.transcript.language | string | null | required | |
| last_message.transcript.model | string | null | required | |
| last_message.transcript.failure_reason | string | null | required | |
| last_message.client_token | string | null | required | |
| last_message.author_user_id | string | null | required | |
| last_message.automation_run_id | string | null | required | |
| last_message.campaign_id | string | null | required | |
| last_message.campaign_name | string | null | required | |
| last_message.error_code | integer | null | required | |
| last_message.error_title | string | null | required | |
| last_message.error_detail | string | null | required | |
| connection | object | null | required | |
| connection.id | string | required | |
| connection.verified_name | string | null | required | |
| connection.display_phone_number | string | required | |
| connection.delivery_mode | "stored" | "direct" | required | |
| last_read_at | string (date-time) | null | required |
POST /v1/conversations/{id}/draft
Draft a reply in this chat from the number's AI assistant and this chat only. Nothing is sent
Scopes messages:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| instruction | string | null | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "conversation_draft" | required | |
| conversation_id | string | required | |
| text | string | null | required | The draft, in the customer’s language. Null when there is none: message says why. |
| sources | object[] | required | What it was written from: the number's AI assistant (assistant, its automation id), or, with none, a neutral persona named from the number's business profile (business_profile); and each knowledge source it read (knowledge, its id). |
| sources[].kind | "assistant" | "business_profile" | "knowledge" | required | |
| sources[].title | string | required | |
| sources[].id | string | null | required | |
| detected_language | string | null | required | The language the customer writes in, as a language tag such as es or pt-BR. Null when it could not be told. |
| flagged | boolean | required | True when OpenAI's moderation check flagged the customer's latest message: no draft, and nothing is handed over. |
| message | string | null | required | Why there is no draft, in words. Null when there is one. |
GET /v1/conversations/{id}/events
The activity feed for one conversation; kind (repeatable) keeps those kinds
Scopes messages:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| limit | query | integer | optional | |
| after | query | string | optional | |
| before | query | string | optional | |
| kind | query | string | string[] | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].object | "conversation_event" | required | |
| data[].conversation_id | string | required | |
| data[].actor_id | string | null | required | |
| data[].kind | string | required | |
| data[].data | object | required | What the line records; its keys depend on kind. A handed_over line carries from, to, reason (as the hand-over gave it, when it gave one) and summary: why the chat was passed to a person, in words: this hand-over's own sentence, e.g. "Passed to a person because the assistant did not have the answer (booking).", or null when it said nothing. Never a code. One an automation's run made also carries run_id and automation_id. One the AI receptionist made also carries handover, its structured summary as the conversation's handoff.summary gives it, and its summary is that summary in lines. A released line Cosend wrote, when the holder sent no message in the chat for 24 hours, has no actor_id and carries by: "time" and summary: "Released after 24 hours without a reply." |
| data[].created_at | string (date-time) | required | |
| has_more | boolean | required | |
| next_cursor | string | null | required |
POST /v1/conversations/{id}/lock
Acquire the lock. It holds until released, handed over or transferred; no expiry
Scopes messages:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| activity | boolean | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "conversation" | required | |
| connection_id | string | required | |
| contact_id | string | required | |
| state | "open" | "pending" | "snoozed" | "resolved" | required | |
| control | "bot" | "pending_human" | "human" | "app" | required | |
| assignee_id | string | null | required | |
| unread_count | integer | required | |
| message_count | integer | required | |
| last_message_at | string (date-time) | null | required | |
| snoozed_until | string (date-time) | null | required | |
| window | object | required | |
| window.service_window_open | boolean | required | |
| window.service_window_expires_at | string (date-time) | null | required | |
| window.free_entry_point_expires_at | string (date-time) | null | required | |
| window.can_send_freeform | boolean | required | |
| window.expires_in_seconds | integer | null | required | |
| window.state | "open" | "expiring" | "closed" | required | |
| window.band | "open" | "closing" | "expiring" | "closed" | required | |
| lock | object | required | |
| lock.held | boolean | required | |
| lock.held_by | string | null | required | |
| lock.held_by_name | string | null | required | |
| lock.idle | boolean | required | |
| lock.expires_at | string (date-time) | null | required | |
| lock.can_i_send | boolean | required | |
| lock.can_i_take_over | "yes" | "request" | "no" | required | |
| lock.pending_request | object | null | required | |
| lock.pending_request.id | string | required | |
| lock.pending_request.requested_by | string | required | |
| lock.pending_request.requested_by_name | string | null | required | |
| lock.pending_request.auto_grants_at | string (date-time) | required | |
| waiting | object | null | required | |
| waiting.since | string (date-time) | required | |
| waiting.reason | "unanswered" | "handed_over" | required | |
| waiting.summary | string | null | required | |
| needs_person | object | null | required | |
| needs_person.since | string (date-time) | required | |
| needs_person.reason | string | null | required | |
| needs_person.summary | string | null | required | |
| handoff | object | null | required | |
| handoff.at | string (date-time) | required | |
| handoff.reason | string | null | required | |
| handoff.summary | object | null | required | |
| handoff.summary.customer | string | null | required | |
| handoff.summary.wants | string | null | required | |
| handoff.summary.answered | string | null | required | |
| handoff.summary.still_open | string | null | required | |
| handoff.summary.mood | string | null | required | |
| handoff.summary.language | string | null | required | |
| handoff.summary.actions | object[] | required | |
| priority | "normal" | "priority" | "high_priority" | required | |
| resolved_at | string (date-time) | null | required | |
| resolved_by | string | null | required | |
| labels | string[] | required | |
| created_at | string (date-time) | required | |
| ad | object | null | required | |
| ad.source_id | string | required | |
| ad.source_type | string | required | |
| ad.source_url | string | null | required | |
| ad.headline | string | null | required | |
| ad.body | string | null | required | |
| ad.media_type | string | null | required | |
| ad.image_url | string | null | required | |
| ad.video_url | string | null | required | |
| ad.thumbnail_url | string | null | required | |
| ad.at | string (date-time) | required | |
| contact | object | null | required | |
| contact.id | string | required | |
| contact.object | "contact" | required | |
| contact.connection_id | string | required | |
| contact.portfolio_id | string | required | |
| contact.numbers | object[] | required | |
| contact.numbers[].connection_id | string | required | |
| contact.numbers[].first_seen_at | string (date-time) | required | |
| contact.numbers[].last_seen_at | string (date-time) | null | required | |
| contact.numbers[].is_blocked | boolean | required | |
| contact.numbers[].in_phone_contacts | boolean | required | |
| contact.numbers[].removed_in_app_at | string (date-time) | null | required | |
| contact.numbers[].history_imported | boolean | required | |
| contact.display_name | string | required | |
| contact.phone_e164 | string | null | required | |
| contact.wa_id | string | null | required | |
| contact.bsuid | string | null | required | |
| contact.username | string | null | required | |
| contact.name | string | null | required | |
| contact.profile_name | string | null | required | |
| contact.attributes | object | required | |
| contact.tags | string[] | required | |
| contact.locale | string | null | required | |
| contact.timezone | string | null | required | |
| contact.is_blocked | boolean | required | |
| contact.removed_in_app_at | string (date-time) | null | required | |
| contact.first_seen_at | string (date-time) | required | |
| contact.last_seen_at | string (date-time) | null | required | |
| contact.created_at | string (date-time) | required | |
| contact.ad | object | null | required | |
| contact.ad.source_id | string | required | |
| contact.ad.source_type | string | required | |
| contact.ad.source_url | string | null | required | |
| contact.ad.headline | string | null | required | |
| contact.ad.body | string | null | required | |
| contact.ad.media_type | string | null | required | |
| contact.ad.image_url | string | null | required | |
| contact.ad.video_url | string | null | required | |
| contact.ad.thumbnail_url | string | null | required | |
| contact.ad.at | string (date-time) | required | |
| last_message | object | null | required | |
| last_message.id | string | required | |
| last_message.object | "message" | required | |
| last_message.conversation_id | string | required | |
| last_message.contact_id | string | required | |
| last_message.contact | object | required | |
| last_message.contact.id | string | required | |
| last_message.contact.bsuid | string | null | required | |
| last_message.contact.phone | string | null | required | |
| last_message.contact.username | string | null | required | |
| last_message.contact.name | string | required | |
| last_message.connection_id | string | required | |
| last_message.wamid | string | null | required | |
| last_message.direction | "inbound" | "outbound" | required | |
| last_message.source | "customer" | "app" | "api" | "agent" | "automation" | "ai" | "notify" | "history" | … | required | |
| last_message.status | "queued" | "sending" | "sent" | "delivered" | "read" | "played" | "failed" | "deleted" | … | required | |
| last_message.type | string | required | |
| last_message.content | object | required | |
| last_message.location | object | null | required | |
| last_message.location.latitude | number | required | |
| last_message.location.longitude | number | required | |
| last_message.location.name | string | null | required | |
| last_message.location.address | string | null | required | |
| last_message.location.url | string | null | required | |
| last_message.contact_cards | object[] | null | required | |
| last_message.contact_cards[].name | string | null | required | |
| last_message.contact_cards[].phones | object[] | required | |
| last_message.contact_cards[].emails | object[] | required | |
| last_message.contact_cards[].org | object | null | required | |
| last_message.label | string | null | required | |
| last_message.forwarded | boolean | required | |
| last_message.frequently_forwarded | boolean | required | |
| last_message.tap | object | null | required | |
| last_message.tap.kind | "button_reply" | "list_reply" | "button" | required | |
| last_message.tap.id | string | required | |
| last_message.tap.title | string | required | |
| last_message.tap.description | string | null | required | |
| last_message.template_text | object | null | required | The words a template message showed the customer: the header and body with the values the send filled in, the footer, and the button labels. Rendered from the template Cosend holds and the values the send used. An authentication template never shows its one-time code: the placeholder stays as written. When Cosend no longer holds the template, body is the text stored when it was sent and the rest is empty. null on every other message, on a template Cosend has no words for, and on a direct-mode connection. |
| last_message.template_text.header | string | null | required | |
| last_message.template_text.body | string | null | required | |
| last_message.template_text.footer | string | null | required | |
| last_message.template_text.buttons | string[] | required | |
| last_message.reply_to | object | null | required | |
| last_message.reply_to.id | string | null | required | |
| last_message.reply_to.wamid | string | required | |
| last_message.reply_to.kind | string | null | required | |
| last_message.reply_to.from | "contact" | "business" | null | required | |
| last_message.reply_to.preview | string | required | |
| last_message.reactions | object[] | required | |
| last_message.reactions[].emoji | string | required | |
| last_message.reactions[].direction | "inbound" | "outbound" | required | |
| last_message.reactions[].message_id | string | required | |
| last_message.reactions[].created_at | string (date-time) | required | |
| last_message.metadata | object | required | |
| last_message.created_at | string (date-time) | required | |
| last_message.wa_timestamp | string (date-time) | required | |
| last_message.is_imported | boolean | required | |
| last_message.media_state | "none" | "pending" | "stored" | "expired" | "unavailable" | required | |
| last_message.media_expires_at | string (date-time) | null | required | |
| last_message.media | object | null | required | The file this message carries. status is pending while Cosend fetches it from Meta, ready once it is stored (open it with GET /v1/media/{id} or /v1/media/{id}/content; id is null in the other two states), and failed with failure_reason saying why in plain words. kind is voice for a WhatsApp voice note. On a template message, the header’s image, video or document, when the send named a file uploaded to Cosend (caption is null). null on a message with no file Cosend keeps. |
| last_message.media.id | string | null | required | |
| last_message.media.kind | "image" | "video" | "audio" | "voice" | "document" | "sticker" | required | |
| last_message.media.mime_type | string | null | required | |
| last_message.media.size_bytes | integer | null | required | |
| last_message.media.filename | string | null | required | |
| last_message.media.caption | string | null | required | |
| last_message.media.animated | boolean | null | required | |
| last_message.media.status | "pending" | "ready" | "failed" | required | |
| last_message.media.failure_reason | string | null | required | |
| last_message.transcript | object | null | required | The words of an inbound voice note or audio file. null while Cosend transcribes it, and on every other message. ready carries text; failed says why in failure_reason; skipped means transcription is unavailable. The recording in media is the same whatever this says. |
| last_message.transcript.status | "ready" | "failed" | "skipped" | required | |
| last_message.transcript.text | string | null | required | |
| last_message.transcript.language | string | null | required | |
| last_message.transcript.model | string | null | required | |
| last_message.transcript.failure_reason | string | null | required | |
| last_message.client_token | string | null | required | |
| last_message.author_user_id | string | null | required | |
| last_message.automation_run_id | string | null | required | |
| last_message.campaign_id | string | null | required | |
| last_message.campaign_name | string | null | required | |
| last_message.error_code | integer | null | required | |
| last_message.error_title | string | null | required | |
| last_message.error_detail | string | null | required | |
| connection | object | null | required | |
| connection.id | string | required | |
| connection.verified_name | string | null | required | |
| connection.display_phone_number | string | required | |
| connection.delivery_mode | "stored" | "direct" | required | |
| last_read_at | string (date-time) | null | required |
DELETE /v1/conversations/{id}/lock
Release the lock. Fired on leaving the chat and on tab close
Scopes messages:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "conversation" | required | |
| connection_id | string | required | |
| contact_id | string | required | |
| state | "open" | "pending" | "snoozed" | "resolved" | required | |
| control | "bot" | "pending_human" | "human" | "app" | required | |
| assignee_id | string | null | required | |
| unread_count | integer | required | |
| message_count | integer | required | |
| last_message_at | string (date-time) | null | required | |
| snoozed_until | string (date-time) | null | required | |
| window | object | required | |
| window.service_window_open | boolean | required | |
| window.service_window_expires_at | string (date-time) | null | required | |
| window.free_entry_point_expires_at | string (date-time) | null | required | |
| window.can_send_freeform | boolean | required | |
| window.expires_in_seconds | integer | null | required | |
| window.state | "open" | "expiring" | "closed" | required | |
| window.band | "open" | "closing" | "expiring" | "closed" | required | |
| lock | object | required | |
| lock.held | boolean | required | |
| lock.held_by | string | null | required | |
| lock.held_by_name | string | null | required | |
| lock.idle | boolean | required | |
| lock.expires_at | string (date-time) | null | required | |
| lock.can_i_send | boolean | required | |
| lock.can_i_take_over | "yes" | "request" | "no" | required | |
| lock.pending_request | object | null | required | |
| lock.pending_request.id | string | required | |
| lock.pending_request.requested_by | string | required | |
| lock.pending_request.requested_by_name | string | null | required | |
| lock.pending_request.auto_grants_at | string (date-time) | required | |
| waiting | object | null | required | |
| waiting.since | string (date-time) | required | |
| waiting.reason | "unanswered" | "handed_over" | required | |
| waiting.summary | string | null | required | |
| needs_person | object | null | required | |
| needs_person.since | string (date-time) | required | |
| needs_person.reason | string | null | required | |
| needs_person.summary | string | null | required | |
| handoff | object | null | required | |
| handoff.at | string (date-time) | required | |
| handoff.reason | string | null | required | |
| handoff.summary | object | null | required | |
| handoff.summary.customer | string | null | required | |
| handoff.summary.wants | string | null | required | |
| handoff.summary.answered | string | null | required | |
| handoff.summary.still_open | string | null | required | |
| handoff.summary.mood | string | null | required | |
| handoff.summary.language | string | null | required | |
| handoff.summary.actions | object[] | required | |
| priority | "normal" | "priority" | "high_priority" | required | |
| resolved_at | string (date-time) | null | required | |
| resolved_by | string | null | required | |
| labels | string[] | required | |
| created_at | string (date-time) | required | |
| ad | object | null | required | |
| ad.source_id | string | required | |
| ad.source_type | string | required | |
| ad.source_url | string | null | required | |
| ad.headline | string | null | required | |
| ad.body | string | null | required | |
| ad.media_type | string | null | required | |
| ad.image_url | string | null | required | |
| ad.video_url | string | null | required | |
| ad.thumbnail_url | string | null | required | |
| ad.at | string (date-time) | required | |
| contact | object | null | required | |
| contact.id | string | required | |
| contact.object | "contact" | required | |
| contact.connection_id | string | required | |
| contact.portfolio_id | string | required | |
| contact.numbers | object[] | required | |
| contact.numbers[].connection_id | string | required | |
| contact.numbers[].first_seen_at | string (date-time) | required | |
| contact.numbers[].last_seen_at | string (date-time) | null | required | |
| contact.numbers[].is_blocked | boolean | required | |
| contact.numbers[].in_phone_contacts | boolean | required | |
| contact.numbers[].removed_in_app_at | string (date-time) | null | required | |
| contact.numbers[].history_imported | boolean | required | |
| contact.display_name | string | required | |
| contact.phone_e164 | string | null | required | |
| contact.wa_id | string | null | required | |
| contact.bsuid | string | null | required | |
| contact.username | string | null | required | |
| contact.name | string | null | required | |
| contact.profile_name | string | null | required | |
| contact.attributes | object | required | |
| contact.tags | string[] | required | |
| contact.locale | string | null | required | |
| contact.timezone | string | null | required | |
| contact.is_blocked | boolean | required | |
| contact.removed_in_app_at | string (date-time) | null | required | |
| contact.first_seen_at | string (date-time) | required | |
| contact.last_seen_at | string (date-time) | null | required | |
| contact.created_at | string (date-time) | required | |
| contact.ad | object | null | required | |
| contact.ad.source_id | string | required | |
| contact.ad.source_type | string | required | |
| contact.ad.source_url | string | null | required | |
| contact.ad.headline | string | null | required | |
| contact.ad.body | string | null | required | |
| contact.ad.media_type | string | null | required | |
| contact.ad.image_url | string | null | required | |
| contact.ad.video_url | string | null | required | |
| contact.ad.thumbnail_url | string | null | required | |
| contact.ad.at | string (date-time) | required | |
| last_message | object | null | required | |
| last_message.id | string | required | |
| last_message.object | "message" | required | |
| last_message.conversation_id | string | required | |
| last_message.contact_id | string | required | |
| last_message.contact | object | required | |
| last_message.contact.id | string | required | |
| last_message.contact.bsuid | string | null | required | |
| last_message.contact.phone | string | null | required | |
| last_message.contact.username | string | null | required | |
| last_message.contact.name | string | required | |
| last_message.connection_id | string | required | |
| last_message.wamid | string | null | required | |
| last_message.direction | "inbound" | "outbound" | required | |
| last_message.source | "customer" | "app" | "api" | "agent" | "automation" | "ai" | "notify" | "history" | … | required | |
| last_message.status | "queued" | "sending" | "sent" | "delivered" | "read" | "played" | "failed" | "deleted" | … | required | |
| last_message.type | string | required | |
| last_message.content | object | required | |
| last_message.location | object | null | required | |
| last_message.location.latitude | number | required | |
| last_message.location.longitude | number | required | |
| last_message.location.name | string | null | required | |
| last_message.location.address | string | null | required | |
| last_message.location.url | string | null | required | |
| last_message.contact_cards | object[] | null | required | |
| last_message.contact_cards[].name | string | null | required | |
| last_message.contact_cards[].phones | object[] | required | |
| last_message.contact_cards[].emails | object[] | required | |
| last_message.contact_cards[].org | object | null | required | |
| last_message.label | string | null | required | |
| last_message.forwarded | boolean | required | |
| last_message.frequently_forwarded | boolean | required | |
| last_message.tap | object | null | required | |
| last_message.tap.kind | "button_reply" | "list_reply" | "button" | required | |
| last_message.tap.id | string | required | |
| last_message.tap.title | string | required | |
| last_message.tap.description | string | null | required | |
| last_message.template_text | object | null | required | The words a template message showed the customer: the header and body with the values the send filled in, the footer, and the button labels. Rendered from the template Cosend holds and the values the send used. An authentication template never shows its one-time code: the placeholder stays as written. When Cosend no longer holds the template, body is the text stored when it was sent and the rest is empty. null on every other message, on a template Cosend has no words for, and on a direct-mode connection. |
| last_message.template_text.header | string | null | required | |
| last_message.template_text.body | string | null | required | |
| last_message.template_text.footer | string | null | required | |
| last_message.template_text.buttons | string[] | required | |
| last_message.reply_to | object | null | required | |
| last_message.reply_to.id | string | null | required | |
| last_message.reply_to.wamid | string | required | |
| last_message.reply_to.kind | string | null | required | |
| last_message.reply_to.from | "contact" | "business" | null | required | |
| last_message.reply_to.preview | string | required | |
| last_message.reactions | object[] | required | |
| last_message.reactions[].emoji | string | required | |
| last_message.reactions[].direction | "inbound" | "outbound" | required | |
| last_message.reactions[].message_id | string | required | |
| last_message.reactions[].created_at | string (date-time) | required | |
| last_message.metadata | object | required | |
| last_message.created_at | string (date-time) | required | |
| last_message.wa_timestamp | string (date-time) | required | |
| last_message.is_imported | boolean | required | |
| last_message.media_state | "none" | "pending" | "stored" | "expired" | "unavailable" | required | |
| last_message.media_expires_at | string (date-time) | null | required | |
| last_message.media | object | null | required | The file this message carries. status is pending while Cosend fetches it from Meta, ready once it is stored (open it with GET /v1/media/{id} or /v1/media/{id}/content; id is null in the other two states), and failed with failure_reason saying why in plain words. kind is voice for a WhatsApp voice note. On a template message, the header’s image, video or document, when the send named a file uploaded to Cosend (caption is null). null on a message with no file Cosend keeps. |
| last_message.media.id | string | null | required | |
| last_message.media.kind | "image" | "video" | "audio" | "voice" | "document" | "sticker" | required | |
| last_message.media.mime_type | string | null | required | |
| last_message.media.size_bytes | integer | null | required | |
| last_message.media.filename | string | null | required | |
| last_message.media.caption | string | null | required | |
| last_message.media.animated | boolean | null | required | |
| last_message.media.status | "pending" | "ready" | "failed" | required | |
| last_message.media.failure_reason | string | null | required | |
| last_message.transcript | object | null | required | The words of an inbound voice note or audio file. null while Cosend transcribes it, and on every other message. ready carries text; failed says why in failure_reason; skipped means transcription is unavailable. The recording in media is the same whatever this says. |
| last_message.transcript.status | "ready" | "failed" | "skipped" | required | |
| last_message.transcript.text | string | null | required | |
| last_message.transcript.language | string | null | required | |
| last_message.transcript.model | string | null | required | |
| last_message.transcript.failure_reason | string | null | required | |
| last_message.client_token | string | null | required | |
| last_message.author_user_id | string | null | required | |
| last_message.automation_run_id | string | null | required | |
| last_message.campaign_id | string | null | required | |
| last_message.campaign_name | string | null | required | |
| last_message.error_code | integer | null | required | |
| last_message.error_title | string | null | required | |
| last_message.error_detail | string | null | required | |
| connection | object | null | required | |
| connection.id | string | required | |
| connection.verified_name | string | null | required | |
| connection.display_phone_number | string | required | |
| connection.delivery_mode | "stored" | "direct" | required | |
| last_read_at | string (date-time) | null | required |
POST /v1/conversations/{id}/lock/requests
Ask the holder to hand over; silence transfers in 60s
Scopes messages:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| reason | string | optional |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "lock_request" | required | |
| conversation_id | string | required | |
| expires_at | string (date-time) | required | |
| held_by | string | required | |
| requested_by | string | required | |
| state | "pending" | "granted" | "declined" | "expired" | "superseded" | required | |
| auto_grants | true | required |
GET /v1/conversations/{id}/notes
Internal notes on a conversation
Scopes messages:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| limit | query | integer | optional | |
| after | query | string | optional | |
| before | query | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].object | "note" | required | |
| data[].conversation_id | string | required | |
| data[].author_id | string | required | |
| data[].body | string | required | |
| data[].mentions | string[] | required | |
| data[].created_at | string (date-time) | required | |
| data[].edited_at | string (date-time) | null | required | |
| has_more | boolean | required | |
| next_cursor | string | null | required |
POST /v1/conversations/{id}/notes
Add an internal note, with @mentions
Scopes messages:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| body | string | required | |
| mentions | string[] | optional |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "note" | required | |
| conversation_id | string | required | |
| author_id | string | required | |
| body | string | required | |
| mentions | string[] | required | |
| created_at | string (date-time) | required | |
| edited_at | string (date-time) | null | required |
PATCH /v1/conversations/{id}/notes/{noteId}
Edit an internal note. Only its author can
Scopes messages:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| body | string | required | |
| mentions | string[] | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "note" | required | |
| conversation_id | string | required | |
| author_id | string | required | |
| body | string | required | |
| mentions | string[] | required | |
| created_at | string (date-time) | required | |
| edited_at | string (date-time) | null | required |
DELETE /v1/conversations/{id}/notes/{noteId}
Delete an internal note. Its author, or an owner or admin, can
Scopes messages:write
Response 204
No content
POST /v1/conversations/{id}/order-draft
Draft an order from this chat with the AI: the number’s products and prices, nothing sent
Scopes messages:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| from | "seller" | "composer" | optional | composer when it is the composer’s /order; seller otherwise. |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "order" | required | |
| number | integer | required | The order number the customer reads, per number. |
| connection_id | string | required | |
| contact_id | string | required | |
| conversation_id | string | null | required | |
| status | "draft" | "awaiting_customer" | "confirmed" | "out_for_delivery" | "delivered" | "cancelled" | "returned" | "problem" | required | |
| payment_status | "unpaid" | "deposit_paid" | "paid" | "cod_collected" | "refunded" | required | |
| payment_method | "cod" | "payment_link" | "bank_transfer" | null | required | |
| source | "chat" | "seller" | "composer" | "location" | "api" | "mcp" | "quote" | required | |
| currency | string | null | required | |
| items | object[] | required | |
| items[].product_id | string | null | required | |
| items[].variant | string | null | required | |
| items[].name | string | required | |
| items[].quantity | integer | required | |
| items[].unit_price | string | null | required | |
| items[].tier_quantity | integer | null | required | |
| items[].price_source | string | null | required | Where the price came from: product_list, seller_message:<message id>, or seller (typed by a person). Null is no price. |
| items[].line_total | string | null | required | |
| items[].custom | boolean | required | Not on the number’s product list. |
| items[].confidence | number | null | required | |
| items[].evidence | string[] | required | The messages the line was read from. |
| items[].check | boolean | required | Shown with "Check": the seller should look at it. |
| subtotal | string | null | required | |
| discount_amount | string | null | required | What the discount of the quote this order was made from takes off its subtotal. Null on an order no quote made, or with no discount. |
| tax_amount | string | null | required | The tax of the quote this order was made from, on its subtotal less the discount. Null on an order no quote made, or with no tax. |
| delivery_fee | string | null | required | |
| total | string | null | required | |
| deposit_amount | string | null | required | |
| delivery | object | required | |
| delivery.address_text | string | null | required | |
| delivery.city | string | null | required | |
| delivery.postcode | string | null | required | |
| delivery.location | object | null | required | |
| delivery.location.latitude | number | required | |
| delivery.location.longitude | number | required | |
| delivery.recipient_name | string | null | required | |
| delivery.preferred_day | string | null | required | |
| delivery.delivery_date | string | null | required | |
| delivery.courier | string | null | required | |
| delivery.tracking_number | string | null | required | |
| customer | object | required | |
| customer.name | string | null | required | |
| customer.phone | string | null | required | |
| ad_source | object | null | required | The Click-to-WhatsApp ad the order’s chat came from, when it has one. |
| ad_source.id | string | required | |
| ad_source.headline | string | null | required | |
| ad_source.source_url | string | null | required | |
| assignee_id | string | null | required | The member the order is assigned to. |
| assigned_at | string | null | required | |
| notes | string | null | required | |
| language | string | null | required | |
| missing | string[] | required | |
| checks | string[] | required | |
| evidence | object | required | |
| risk | object[] | required | |
| risk[].code | "first_order" | "earlier_returns" | "did_not_confirm" | "address_incomplete" | "outside_delivery_zone" | required | |
| risk[].text | string | required | |
| unconfirmed | boolean | required | No answer 20 hours after it was sent: "Unconfirmed: don’t ship". |
| payment_screenshots | object[] | required | |
| payment_screenshots[].message_id | string | required | |
| payment_screenshots[].amount | string | null | required | |
| payment_screenshots[].currency | string | null | required | |
| payment_screenshots[].reference | string | null | required | |
| payment_screenshots[].date | string | null | required | |
| payment_screenshots[].bank | string | null | required | |
| payment_screenshots[].matches_total | boolean | required | |
| change_requests | object[] | required | |
| change_requests[].message_id | string | required | |
| change_requests[].at | string | required | |
| last_change | object | null | required | |
| last_change.kind | string | required | |
| last_change.actor | string | required | |
| last_change.at | string | required | |
| last_change.changes | object | null | required | |
| expires_at | string | null | required | |
| sent_at | string | null | required | |
| reminded_at | string | null | required | |
| unconfirmed_at | string | null | required | |
| confirmed_at | string | null | required | |
| delivered_at | string | null | required | |
| cancelled_at | string | null | required | |
| cancel_reason | "changed_mind" | "too_expensive" | "too_slow" | "ordered_elsewhere" | "other" | "expired" | "seller" | null | required | |
| crm | object | null | required | |
| crm.connector_account_id | string | null | required | |
| crm.contact_id | string | null | required | The customer’s contact in the CRM. |
| crm.deal_id | string | null | required | |
| crm.deal_url | string | null | required | The deal in the CRM: the link to show. |
| crm.synced_at | string | null | required | |
| crm.problem | string | null | required | Why the last change was not sent to the CRM, in plain words. Null once one is. |
| created_at | string | required | |
| updated_at | string | required |
GET /v1/conversations/{id}/picker
The composer’s / picker: the chat’s number’s products and saved replies, in one search
Scopes messages:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| q | query | string | optional | What was typed after /: a shortcut’s start, or words. Each word matches the start of a word in a product’s name, SKU or tags, or a reply’s shortcut, folder or text. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].kind | "product" | required | |
| data[].id | string | required | |
| data[].name | string | required | |
| data[].short_description | string | null | required | |
| data[].cover | object | null | required | |
| data[].cover.media_id | string | required | |
| data[].cover.mime_type | string | required | |
| data[].cover.filename | string | null | required | |
| data[].price | string | null | required | |
| data[].stock | "in_stock" | "low" | "out_of_stock" | required | |
| data[].shortcut | string | null | required | |
| data[].folder | string | null | required | |
| data[].language | string | null | required | |
| data[].text | string | required | |
| data[].missing | string[] | required | |
| data[].media | object[] | required | |
| data[].media[].media_id | string | required | |
| data[].media[].kind | "image" | "video" | "document" | "audio" | required | |
| data[].media[].mime_type | string | required | |
| data[].media[].filename | string | null | required | |
| data[].times_sent | integer | required |
POST /v1/conversations/{id}/quote-draft
Read this chat with the AI for the answers a quote needs, and suggest one question for the rest
Scopes messages:write
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "quote" | required | |
| number | string | required | The quote number the customer reads: Q, the year and the workspace’s count in that year. |
| connection_id | string | required | |
| contact_id | string | required | |
| conversation_id | string | null | required | |
| status | "draft" | "sent" | "accepted" | "declined" | "expired" | required | |
| currency | string | null | required | |
| items | object[] | required | |
| items[].product_id | string | null | required | |
| items[].variant | string | null | required | |
| items[].name | string | required | |
| items[].quantity | integer | required | |
| items[].unit_price | string | null | required | |
| items[].tier_quantity | integer | null | required | |
| items[].price_source | "product_list" | "seller" | null | required | Where the price came from: product_list, or seller (a custom line, typed by a person). Null is no price. |
| items[].line_total | string | null | required | |
| items[].custom | boolean | required | Not on the number’s product list. |
| items[].check | boolean | required | Shown with "Check": the line has no price. |
| subtotal | string | null | required | |
| discount | object | null | required | |
| discount.kind | "amount" | required | |
| discount.value | string | required | |
| discount_amount | string | null | required | |
| tax_rate | string | null | required | |
| tax_amount | string | null | required | |
| total | string | null | required | |
| deposit | object | null | required | |
| deposit.kind | "amount" | required | |
| deposit.value | string | required | |
| deposit_amount | string | null | required | |
| valid_until | string | null | required | |
| terms | string | null | required | |
| notes | string | null | required | |
| language | string | null | required | |
| answers | object[] | required | |
| answers[].key | string | required | |
| answers[].label | string | required | |
| answers[].value | string | null | required | |
| answers[].confidence | number | null | required | |
| answers[].evidence | string[] | required | The messages the answer was read from: the customer said it there. |
| answers[].by | "ai" | "seller" | required | |
| answers[].check | boolean | required | The AI was unsure: shown with "Check". |
| missing | string[] | required | The keys of the questions with no answer. |
| suggested_question | string | null | required | One question asking every missing answer, for the seller to send. |
| order_id | string | null | required | The order an accepted quote became. |
| pdf_media_id | string | null | required | The PDF the customer was sent. |
| follow_up | object | null | required | Day 2 or day 5 with no word from the customer: follow up today. |
| follow_up.day | 2 | 5 | required | |
| follow_up.due_at | string | required | |
| sent_at | string | null | required | |
| accepted_at | string | null | required | |
| declined_at | string | null | required | |
| decline_reason | "too_expensive" | "not_needed" | "found_another" | "other" | null | required | |
| expired_at | string | null | required | |
| created_at | string | required | |
| updated_at | string | required |
POST /v1/conversations/{id}/read
Mark the whole thread read (internal; no blue ticks)
Scopes messages:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "conversation" | required | |
| connection_id | string | required | |
| contact_id | string | required | |
| state | "open" | "pending" | "snoozed" | "resolved" | required | |
| control | "bot" | "pending_human" | "human" | "app" | required | |
| assignee_id | string | null | required | |
| unread_count | integer | required | |
| message_count | integer | required | |
| last_message_at | string (date-time) | null | required | |
| snoozed_until | string (date-time) | null | required | |
| window | object | required | |
| window.service_window_open | boolean | required | |
| window.service_window_expires_at | string (date-time) | null | required | |
| window.free_entry_point_expires_at | string (date-time) | null | required | |
| window.can_send_freeform | boolean | required | |
| window.expires_in_seconds | integer | null | required | |
| window.state | "open" | "expiring" | "closed" | required | |
| window.band | "open" | "closing" | "expiring" | "closed" | required | |
| lock | object | required | |
| lock.held | boolean | required | |
| lock.held_by | string | null | required | |
| lock.held_by_name | string | null | required | |
| lock.idle | boolean | required | |
| lock.expires_at | string (date-time) | null | required | |
| lock.can_i_send | boolean | required | |
| lock.can_i_take_over | "yes" | "request" | "no" | required | |
| lock.pending_request | object | null | required | |
| lock.pending_request.id | string | required | |
| lock.pending_request.requested_by | string | required | |
| lock.pending_request.requested_by_name | string | null | required | |
| lock.pending_request.auto_grants_at | string (date-time) | required | |
| waiting | object | null | required | |
| waiting.since | string (date-time) | required | |
| waiting.reason | "unanswered" | "handed_over" | required | |
| waiting.summary | string | null | required | |
| needs_person | object | null | required | |
| needs_person.since | string (date-time) | required | |
| needs_person.reason | string | null | required | |
| needs_person.summary | string | null | required | |
| handoff | object | null | required | |
| handoff.at | string (date-time) | required | |
| handoff.reason | string | null | required | |
| handoff.summary | object | null | required | |
| handoff.summary.customer | string | null | required | |
| handoff.summary.wants | string | null | required | |
| handoff.summary.answered | string | null | required | |
| handoff.summary.still_open | string | null | required | |
| handoff.summary.mood | string | null | required | |
| handoff.summary.language | string | null | required | |
| handoff.summary.actions | object[] | required | |
| priority | "normal" | "priority" | "high_priority" | required | |
| resolved_at | string (date-time) | null | required | |
| resolved_by | string | null | required | |
| labels | string[] | required | |
| created_at | string (date-time) | required | |
| ad | object | null | required | |
| ad.source_id | string | required | |
| ad.source_type | string | required | |
| ad.source_url | string | null | required | |
| ad.headline | string | null | required | |
| ad.body | string | null | required | |
| ad.media_type | string | null | required | |
| ad.image_url | string | null | required | |
| ad.video_url | string | null | required | |
| ad.thumbnail_url | string | null | required | |
| ad.at | string (date-time) | required | |
| contact | object | null | required | |
| contact.id | string | required | |
| contact.object | "contact" | required | |
| contact.connection_id | string | required | |
| contact.portfolio_id | string | required | |
| contact.numbers | object[] | required | |
| contact.numbers[].connection_id | string | required | |
| contact.numbers[].first_seen_at | string (date-time) | required | |
| contact.numbers[].last_seen_at | string (date-time) | null | required | |
| contact.numbers[].is_blocked | boolean | required | |
| contact.numbers[].in_phone_contacts | boolean | required | |
| contact.numbers[].removed_in_app_at | string (date-time) | null | required | |
| contact.numbers[].history_imported | boolean | required | |
| contact.display_name | string | required | |
| contact.phone_e164 | string | null | required | |
| contact.wa_id | string | null | required | |
| contact.bsuid | string | null | required | |
| contact.username | string | null | required | |
| contact.name | string | null | required | |
| contact.profile_name | string | null | required | |
| contact.attributes | object | required | |
| contact.tags | string[] | required | |
| contact.locale | string | null | required | |
| contact.timezone | string | null | required | |
| contact.is_blocked | boolean | required | |
| contact.removed_in_app_at | string (date-time) | null | required | |
| contact.first_seen_at | string (date-time) | required | |
| contact.last_seen_at | string (date-time) | null | required | |
| contact.created_at | string (date-time) | required | |
| contact.ad | object | null | required | |
| contact.ad.source_id | string | required | |
| contact.ad.source_type | string | required | |
| contact.ad.source_url | string | null | required | |
| contact.ad.headline | string | null | required | |
| contact.ad.body | string | null | required | |
| contact.ad.media_type | string | null | required | |
| contact.ad.image_url | string | null | required | |
| contact.ad.video_url | string | null | required | |
| contact.ad.thumbnail_url | string | null | required | |
| contact.ad.at | string (date-time) | required | |
| last_message | object | null | required | |
| last_message.id | string | required | |
| last_message.object | "message" | required | |
| last_message.conversation_id | string | required | |
| last_message.contact_id | string | required | |
| last_message.contact | object | required | |
| last_message.contact.id | string | required | |
| last_message.contact.bsuid | string | null | required | |
| last_message.contact.phone | string | null | required | |
| last_message.contact.username | string | null | required | |
| last_message.contact.name | string | required | |
| last_message.connection_id | string | required | |
| last_message.wamid | string | null | required | |
| last_message.direction | "inbound" | "outbound" | required | |
| last_message.source | "customer" | "app" | "api" | "agent" | "automation" | "ai" | "notify" | "history" | … | required | |
| last_message.status | "queued" | "sending" | "sent" | "delivered" | "read" | "played" | "failed" | "deleted" | … | required | |
| last_message.type | string | required | |
| last_message.content | object | required | |
| last_message.location | object | null | required | |
| last_message.location.latitude | number | required | |
| last_message.location.longitude | number | required | |
| last_message.location.name | string | null | required | |
| last_message.location.address | string | null | required | |
| last_message.location.url | string | null | required | |
| last_message.contact_cards | object[] | null | required | |
| last_message.contact_cards[].name | string | null | required | |
| last_message.contact_cards[].phones | object[] | required | |
| last_message.contact_cards[].emails | object[] | required | |
| last_message.contact_cards[].org | object | null | required | |
| last_message.label | string | null | required | |
| last_message.forwarded | boolean | required | |
| last_message.frequently_forwarded | boolean | required | |
| last_message.tap | object | null | required | |
| last_message.tap.kind | "button_reply" | "list_reply" | "button" | required | |
| last_message.tap.id | string | required | |
| last_message.tap.title | string | required | |
| last_message.tap.description | string | null | required | |
| last_message.template_text | object | null | required | The words a template message showed the customer: the header and body with the values the send filled in, the footer, and the button labels. Rendered from the template Cosend holds and the values the send used. An authentication template never shows its one-time code: the placeholder stays as written. When Cosend no longer holds the template, body is the text stored when it was sent and the rest is empty. null on every other message, on a template Cosend has no words for, and on a direct-mode connection. |
| last_message.template_text.header | string | null | required | |
| last_message.template_text.body | string | null | required | |
| last_message.template_text.footer | string | null | required | |
| last_message.template_text.buttons | string[] | required | |
| last_message.reply_to | object | null | required | |
| last_message.reply_to.id | string | null | required | |
| last_message.reply_to.wamid | string | required | |
| last_message.reply_to.kind | string | null | required | |
| last_message.reply_to.from | "contact" | "business" | null | required | |
| last_message.reply_to.preview | string | required | |
| last_message.reactions | object[] | required | |
| last_message.reactions[].emoji | string | required | |
| last_message.reactions[].direction | "inbound" | "outbound" | required | |
| last_message.reactions[].message_id | string | required | |
| last_message.reactions[].created_at | string (date-time) | required | |
| last_message.metadata | object | required | |
| last_message.created_at | string (date-time) | required | |
| last_message.wa_timestamp | string (date-time) | required | |
| last_message.is_imported | boolean | required | |
| last_message.media_state | "none" | "pending" | "stored" | "expired" | "unavailable" | required | |
| last_message.media_expires_at | string (date-time) | null | required | |
| last_message.media | object | null | required | The file this message carries. status is pending while Cosend fetches it from Meta, ready once it is stored (open it with GET /v1/media/{id} or /v1/media/{id}/content; id is null in the other two states), and failed with failure_reason saying why in plain words. kind is voice for a WhatsApp voice note. On a template message, the header’s image, video or document, when the send named a file uploaded to Cosend (caption is null). null on a message with no file Cosend keeps. |
| last_message.media.id | string | null | required | |
| last_message.media.kind | "image" | "video" | "audio" | "voice" | "document" | "sticker" | required | |
| last_message.media.mime_type | string | null | required | |
| last_message.media.size_bytes | integer | null | required | |
| last_message.media.filename | string | null | required | |
| last_message.media.caption | string | null | required | |
| last_message.media.animated | boolean | null | required | |
| last_message.media.status | "pending" | "ready" | "failed" | required | |
| last_message.media.failure_reason | string | null | required | |
| last_message.transcript | object | null | required | The words of an inbound voice note or audio file. null while Cosend transcribes it, and on every other message. ready carries text; failed says why in failure_reason; skipped means transcription is unavailable. The recording in media is the same whatever this says. |
| last_message.transcript.status | "ready" | "failed" | "skipped" | required | |
| last_message.transcript.text | string | null | required | |
| last_message.transcript.language | string | null | required | |
| last_message.transcript.model | string | null | required | |
| last_message.transcript.failure_reason | string | null | required | |
| last_message.client_token | string | null | required | |
| last_message.author_user_id | string | null | required | |
| last_message.automation_run_id | string | null | required | |
| last_message.campaign_id | string | null | required | |
| last_message.campaign_name | string | null | required | |
| last_message.error_code | integer | null | required | |
| last_message.error_title | string | null | required | |
| last_message.error_detail | string | null | required | |
| connection | object | null | required | |
| connection.id | string | required | |
| connection.verified_name | string | null | required | |
| connection.display_phone_number | string | required | |
| connection.delivery_mode | "stored" | "direct" | required | |
| last_read_at | string (date-time) | null | required |
POST /v1/conversations/{id}/read-receipt
Blue ticks for every unread inbound message in the thread
Scopes messages:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| ok | true | required |
POST /v1/conversations/{id}/resolve
Mark Resolved: nobody holds the chat, nothing is sent, and automations treat the next message as a first message
Scopes messages:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "conversation" | required | |
| connection_id | string | required | |
| contact_id | string | required | |
| state | "open" | "pending" | "snoozed" | "resolved" | required | |
| control | "bot" | "pending_human" | "human" | "app" | required | |
| assignee_id | string | null | required | |
| unread_count | integer | required | |
| message_count | integer | required | |
| last_message_at | string (date-time) | null | required | |
| snoozed_until | string (date-time) | null | required | |
| window | object | required | |
| window.service_window_open | boolean | required | |
| window.service_window_expires_at | string (date-time) | null | required | |
| window.free_entry_point_expires_at | string (date-time) | null | required | |
| window.can_send_freeform | boolean | required | |
| window.expires_in_seconds | integer | null | required | |
| window.state | "open" | "expiring" | "closed" | required | |
| window.band | "open" | "closing" | "expiring" | "closed" | required | |
| lock | object | required | |
| lock.held | boolean | required | |
| lock.held_by | string | null | required | |
| lock.held_by_name | string | null | required | |
| lock.idle | boolean | required | |
| lock.expires_at | string (date-time) | null | required | |
| lock.can_i_send | boolean | required | |
| lock.can_i_take_over | "yes" | "request" | "no" | required | |
| lock.pending_request | object | null | required | |
| lock.pending_request.id | string | required | |
| lock.pending_request.requested_by | string | required | |
| lock.pending_request.requested_by_name | string | null | required | |
| lock.pending_request.auto_grants_at | string (date-time) | required | |
| waiting | object | null | required | |
| waiting.since | string (date-time) | required | |
| waiting.reason | "unanswered" | "handed_over" | required | |
| waiting.summary | string | null | required | |
| needs_person | object | null | required | |
| needs_person.since | string (date-time) | required | |
| needs_person.reason | string | null | required | |
| needs_person.summary | string | null | required | |
| handoff | object | null | required | |
| handoff.at | string (date-time) | required | |
| handoff.reason | string | null | required | |
| handoff.summary | object | null | required | |
| handoff.summary.customer | string | null | required | |
| handoff.summary.wants | string | null | required | |
| handoff.summary.answered | string | null | required | |
| handoff.summary.still_open | string | null | required | |
| handoff.summary.mood | string | null | required | |
| handoff.summary.language | string | null | required | |
| handoff.summary.actions | object[] | required | |
| priority | "normal" | "priority" | "high_priority" | required | |
| resolved_at | string (date-time) | null | required | |
| resolved_by | string | null | required | |
| labels | string[] | required | |
| created_at | string (date-time) | required | |
| ad | object | null | required | |
| ad.source_id | string | required | |
| ad.source_type | string | required | |
| ad.source_url | string | null | required | |
| ad.headline | string | null | required | |
| ad.body | string | null | required | |
| ad.media_type | string | null | required | |
| ad.image_url | string | null | required | |
| ad.video_url | string | null | required | |
| ad.thumbnail_url | string | null | required | |
| ad.at | string (date-time) | required | |
| contact | object | null | required | |
| contact.id | string | required | |
| contact.object | "contact" | required | |
| contact.connection_id | string | required | |
| contact.portfolio_id | string | required | |
| contact.numbers | object[] | required | |
| contact.numbers[].connection_id | string | required | |
| contact.numbers[].first_seen_at | string (date-time) | required | |
| contact.numbers[].last_seen_at | string (date-time) | null | required | |
| contact.numbers[].is_blocked | boolean | required | |
| contact.numbers[].in_phone_contacts | boolean | required | |
| contact.numbers[].removed_in_app_at | string (date-time) | null | required | |
| contact.numbers[].history_imported | boolean | required | |
| contact.display_name | string | required | |
| contact.phone_e164 | string | null | required | |
| contact.wa_id | string | null | required | |
| contact.bsuid | string | null | required | |
| contact.username | string | null | required | |
| contact.name | string | null | required | |
| contact.profile_name | string | null | required | |
| contact.attributes | object | required | |
| contact.tags | string[] | required | |
| contact.locale | string | null | required | |
| contact.timezone | string | null | required | |
| contact.is_blocked | boolean | required | |
| contact.removed_in_app_at | string (date-time) | null | required | |
| contact.first_seen_at | string (date-time) | required | |
| contact.last_seen_at | string (date-time) | null | required | |
| contact.created_at | string (date-time) | required | |
| contact.ad | object | null | required | |
| contact.ad.source_id | string | required | |
| contact.ad.source_type | string | required | |
| contact.ad.source_url | string | null | required | |
| contact.ad.headline | string | null | required | |
| contact.ad.body | string | null | required | |
| contact.ad.media_type | string | null | required | |
| contact.ad.image_url | string | null | required | |
| contact.ad.video_url | string | null | required | |
| contact.ad.thumbnail_url | string | null | required | |
| contact.ad.at | string (date-time) | required | |
| last_message | object | null | required | |
| last_message.id | string | required | |
| last_message.object | "message" | required | |
| last_message.conversation_id | string | required | |
| last_message.contact_id | string | required | |
| last_message.contact | object | required | |
| last_message.contact.id | string | required | |
| last_message.contact.bsuid | string | null | required | |
| last_message.contact.phone | string | null | required | |
| last_message.contact.username | string | null | required | |
| last_message.contact.name | string | required | |
| last_message.connection_id | string | required | |
| last_message.wamid | string | null | required | |
| last_message.direction | "inbound" | "outbound" | required | |
| last_message.source | "customer" | "app" | "api" | "agent" | "automation" | "ai" | "notify" | "history" | … | required | |
| last_message.status | "queued" | "sending" | "sent" | "delivered" | "read" | "played" | "failed" | "deleted" | … | required | |
| last_message.type | string | required | |
| last_message.content | object | required | |
| last_message.location | object | null | required | |
| last_message.location.latitude | number | required | |
| last_message.location.longitude | number | required | |
| last_message.location.name | string | null | required | |
| last_message.location.address | string | null | required | |
| last_message.location.url | string | null | required | |
| last_message.contact_cards | object[] | null | required | |
| last_message.contact_cards[].name | string | null | required | |
| last_message.contact_cards[].phones | object[] | required | |
| last_message.contact_cards[].emails | object[] | required | |
| last_message.contact_cards[].org | object | null | required | |
| last_message.label | string | null | required | |
| last_message.forwarded | boolean | required | |
| last_message.frequently_forwarded | boolean | required | |
| last_message.tap | object | null | required | |
| last_message.tap.kind | "button_reply" | "list_reply" | "button" | required | |
| last_message.tap.id | string | required | |
| last_message.tap.title | string | required | |
| last_message.tap.description | string | null | required | |
| last_message.template_text | object | null | required | The words a template message showed the customer: the header and body with the values the send filled in, the footer, and the button labels. Rendered from the template Cosend holds and the values the send used. An authentication template never shows its one-time code: the placeholder stays as written. When Cosend no longer holds the template, body is the text stored when it was sent and the rest is empty. null on every other message, on a template Cosend has no words for, and on a direct-mode connection. |
| last_message.template_text.header | string | null | required | |
| last_message.template_text.body | string | null | required | |
| last_message.template_text.footer | string | null | required | |
| last_message.template_text.buttons | string[] | required | |
| last_message.reply_to | object | null | required | |
| last_message.reply_to.id | string | null | required | |
| last_message.reply_to.wamid | string | required | |
| last_message.reply_to.kind | string | null | required | |
| last_message.reply_to.from | "contact" | "business" | null | required | |
| last_message.reply_to.preview | string | required | |
| last_message.reactions | object[] | required | |
| last_message.reactions[].emoji | string | required | |
| last_message.reactions[].direction | "inbound" | "outbound" | required | |
| last_message.reactions[].message_id | string | required | |
| last_message.reactions[].created_at | string (date-time) | required | |
| last_message.metadata | object | required | |
| last_message.created_at | string (date-time) | required | |
| last_message.wa_timestamp | string (date-time) | required | |
| last_message.is_imported | boolean | required | |
| last_message.media_state | "none" | "pending" | "stored" | "expired" | "unavailable" | required | |
| last_message.media_expires_at | string (date-time) | null | required | |
| last_message.media | object | null | required | The file this message carries. status is pending while Cosend fetches it from Meta, ready once it is stored (open it with GET /v1/media/{id} or /v1/media/{id}/content; id is null in the other two states), and failed with failure_reason saying why in plain words. kind is voice for a WhatsApp voice note. On a template message, the header’s image, video or document, when the send named a file uploaded to Cosend (caption is null). null on a message with no file Cosend keeps. |
| last_message.media.id | string | null | required | |
| last_message.media.kind | "image" | "video" | "audio" | "voice" | "document" | "sticker" | required | |
| last_message.media.mime_type | string | null | required | |
| last_message.media.size_bytes | integer | null | required | |
| last_message.media.filename | string | null | required | |
| last_message.media.caption | string | null | required | |
| last_message.media.animated | boolean | null | required | |
| last_message.media.status | "pending" | "ready" | "failed" | required | |
| last_message.media.failure_reason | string | null | required | |
| last_message.transcript | object | null | required | The words of an inbound voice note or audio file. null while Cosend transcribes it, and on every other message. ready carries text; failed says why in failure_reason; skipped means transcription is unavailable. The recording in media is the same whatever this says. |
| last_message.transcript.status | "ready" | "failed" | "skipped" | required | |
| last_message.transcript.text | string | null | required | |
| last_message.transcript.language | string | null | required | |
| last_message.transcript.model | string | null | required | |
| last_message.transcript.failure_reason | string | null | required | |
| last_message.client_token | string | null | required | |
| last_message.author_user_id | string | null | required | |
| last_message.automation_run_id | string | null | required | |
| last_message.campaign_id | string | null | required | |
| last_message.campaign_name | string | null | required | |
| last_message.error_code | integer | null | required | |
| last_message.error_title | string | null | required | |
| last_message.error_detail | string | null | required | |
| connection | object | null | required | |
| connection.id | string | required | |
| connection.verified_name | string | null | required | |
| connection.display_phone_number | string | required | |
| connection.delivery_mode | "stored" | "direct" | required | |
| last_read_at | string (date-time) | null | required |
POST /v1/conversations/{id}/typing
Show a typing indicator to the contact
Scopes messages:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| ok | true | required |
POST /v1/conversations/bulk
One action on up to 100 chats (resolve as Done, assign, label, priority or read), with a result per chat
Scopes messages:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| ids | string[] | required | |
| action | "resolve" | "assign" | "label" | "priority" | "read" | required | |
| assignee_id | string | null | optional | |
| labels_add | string[] | optional | |
| labels_remove | string[] | optional | |
| priority | "normal" | "priority" | "high_priority" | optional | |
| read | boolean | optional |
Response 207
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| results | object[] | required | |
| results[].id | string | required | |
| results[].ok | boolean | required | |
| results[].code | string | optional | |
| results[].message | string | optional |
GET /v1/conversations/counts
Counts for the inbox: waiting, mine, unread, all and windows closing, per number and in total, and the approvals pending
Scopes messages:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| connection_id | query | string | string[] | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| waiting | integer | required | |
| mine | integer | required | |
| unread | integer | required | |
| all | integer | required | |
| windows_closing | integer | required | |
| object | "conversation_counts" | required | |
| approvals_pending | integer | required | |
| campaigns_needing_attention | integer | required | |
| per_connection | object | required | |
| computed_at | string (date-time) | required |
GET /v1/conversations/labels
The labels in use on each number, with how many open chats carry each
Scopes messages:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| connection_id | query | string | string[] | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].label | string | required | |
| data[].connection_id | string | required | |
| data[].open_count | integer | required |
/v1/cosend-numbers
GET /v1/cosend-numbers
The phone numbers this workspace has from Cosend
Scopes connections:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].phone_number | string | required | |
| data[].country | "US" | "CA" | required | |
| data[].locality | string | null | required | |
| data[].region | string | null | required | |
| data[].status | "buying" | "verifying" | "ready" | "stopping" | "releasing" | "released" | "failed" | required | |
| data[].preverified | boolean | required | |
| data[].preverified_phone_id | string | null | required | |
| data[].code_requested_at | string | null | required | |
| data[].code_wait_until | string | null | required | |
| data[].preverify_error | string | null | required | |
| data[].preverify_retry_at | string | null | required | |
| data[].connection_id | string | null | required | |
| data[].failure | string | null | required | |
| data[].release_at | string | null | required | |
| data[].released_at | string | null | required | |
| data[].created_at | string | required | |
| data[].setup | object | null | required | |
| data[].setup.steps | object[] | required | |
| data[].setup.slow | boolean | required | |
| used | integer | required | |
| limit | integer | null | required |
POST /v1/cosend-numbers
Buy a phone number from Cosend: charged now, then bought and verified with Meta
Scopes connections:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| phone_number | string | required | |
| country | "US" | "CA" | required | |
| locality | string | optional | |
| region | string | optional | |
| proration_date | string (date-time) | optional | |
| display_name | string | required | |
| category | "alcohol" | "apparel" | "automotive" | "beauty" | "education" | "entertainment" | "event_planning" | "finance" | … | required | |
| website | string (uri) | optional |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| phone_number | string | required | |
| country | "US" | "CA" | required | |
| locality | string | null | required | |
| region | string | null | required | |
| status | "buying" | "verifying" | "ready" | "stopping" | "releasing" | "released" | "failed" | required | |
| preverified | boolean | required | |
| preverified_phone_id | string | null | required | |
| code_requested_at | string | null | required | |
| code_wait_until | string | null | required | |
| preverify_error | string | null | required | |
| preverify_retry_at | string | null | required | |
| connection_id | string | null | required | |
| failure | string | null | required | |
| release_at | string | null | required | |
| released_at | string | null | required | |
| created_at | string | required | |
| setup | object | null | required | |
| setup.steps | object[] | required | |
| setup.steps[].key | "reserved" | "added" | "checking" | "ready" | required | |
| setup.steps[].state | "done" | "active" | "waiting" | required | |
| setup.slow | boolean | required |
GET /v1/cosend-numbers/{id}
One Cosend number: where it stands, its WhatsApp connection, and what Meta’s window gets
Scopes connections:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| phone_number | string | required | |
| country | "US" | "CA" | required | |
| locality | string | null | required | |
| region | string | null | required | |
| status | "buying" | "verifying" | "ready" | "stopping" | "releasing" | "released" | "failed" | required | |
| preverified | boolean | required | |
| preverified_phone_id | string | null | required | |
| code_requested_at | string | null | required | |
| code_wait_until | string | null | required | |
| preverify_error | string | null | required | |
| preverify_retry_at | string | null | required | |
| connection_id | string | null | required | |
| failure | string | null | required | |
| release_at | string | null | required | |
| released_at | string | null | required | |
| created_at | string | required | |
| setup | object | null | required | |
| setup.steps | object[] | required | |
| setup.steps[].key | "reserved" | "added" | "checking" | "ready" | required | |
| setup.steps[].state | "done" | "active" | "waiting" | required | |
| setup.slow | boolean | required | |
| meta_prefill | object | null | required | |
| meta_prefill.business | object | optional | |
| meta_prefill.business.id | string | required | |
| meta_prefill.business.name | string | required | |
| meta_prefill.business.email | string | required | |
| meta_prefill.business.website | string | required | |
| meta_prefill.business.address | object | required | |
| meta_prefill.business.timezone | string | required | |
| meta_prefill.business.phone | object | optional | |
| meta_prefill.phone | object | optional | |
| meta_prefill.phone.displayName | string | required | |
| meta_prefill.phone.category | string | required | |
| meta_prefill.phone.description | string | required | |
| meta_prefill.preVerifiedPhone | object | optional | |
| meta_prefill.preVerifiedPhone.ids | string[] | required |
POST /v1/cosend-numbers/{id}/keep
Keep a Cosend number that was stopped, before its last day
Scopes connections:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| phone_number | string | required | |
| country | "US" | "CA" | required | |
| locality | string | null | required | |
| region | string | null | required | |
| status | "buying" | "verifying" | "ready" | "stopping" | "releasing" | "released" | "failed" | required | |
| preverified | boolean | required | |
| preverified_phone_id | string | null | required | |
| code_requested_at | string | null | required | |
| code_wait_until | string | null | required | |
| preverify_error | string | null | required | |
| preverify_retry_at | string | null | required | |
| connection_id | string | null | required | |
| failure | string | null | required | |
| release_at | string | null | required | |
| released_at | string | null | required | |
| created_at | string | required | |
| setup | object | null | required | |
| setup.steps | object[] | required | |
| setup.steps[].key | "reserved" | "added" | "checking" | "ready" | required | |
| setup.steps[].state | "done" | "active" | "waiting" | required | |
| setup.slow | boolean | required |
POST /v1/cosend-numbers/{id}/preverify
Ask WhatsApp again for a code to verify a Cosend number, on the same number
Scopes connections:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| phone_number | string | required | |
| country | "US" | "CA" | required | |
| locality | string | null | required | |
| region | string | null | required | |
| status | "buying" | "verifying" | "ready" | "stopping" | "releasing" | "released" | "failed" | required | |
| preverified | boolean | required | |
| preverified_phone_id | string | null | required | |
| code_requested_at | string | null | required | |
| code_wait_until | string | null | required | |
| preverify_error | string | null | required | |
| preverify_retry_at | string | null | required | |
| connection_id | string | null | required | |
| failure | string | null | required | |
| release_at | string | null | required | |
| released_at | string | null | required | |
| created_at | string | required | |
| setup | object | null | required | |
| setup.steps | object[] | required | |
| setup.steps[].key | "reserved" | "added" | "checking" | "ready" | required | |
| setup.steps[].state | "done" | "active" | "waiting" | required | |
| setup.slow | boolean | required |
POST /v1/cosend-numbers/{id}/stop
Stop using a Cosend number: it is kept to the end of the billing period, then given back
Scopes connections:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| phone_number | string | required | |
| country | "US" | "CA" | required | |
| locality | string | null | required | |
| region | string | null | required | |
| status | "buying" | "verifying" | "ready" | "stopping" | "releasing" | "released" | "failed" | required | |
| preverified | boolean | required | |
| preverified_phone_id | string | null | required | |
| code_requested_at | string | null | required | |
| code_wait_until | string | null | required | |
| preverify_error | string | null | required | |
| preverify_retry_at | string | null | required | |
| connection_id | string | null | required | |
| failure | string | null | required | |
| release_at | string | null | required | |
| released_at | string | null | required | |
| created_at | string | required | |
| setup | object | null | required | |
| setup.steps | object[] | required | |
| setup.steps[].key | "reserved" | "added" | "checking" | "ready" | required | |
| setup.steps[].state | "done" | "active" | "waiting" | required | |
| setup.slow | boolean | required |
GET /v1/cosend-numbers/{id}/texts
The texts and calls a Cosend number received in the last 24 hours
Scopes connections:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| texts | object[] | required | |
| texts[].from | string | required | |
| texts[].body | string | required | |
| texts[].received_at | string | required | |
| texts[].code | string | null | required | |
| calls | object[] | required | |
| calls[].from | string | required | |
| calls[].received_at | string | required | |
| calls[].transcript | string | null | required | |
| calls[].code | string | null | required |
GET /v1/cosend-numbers/available
Local US or Canadian numbers Cosend can get for this workspace
Scopes connections:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| country | query | "US" | "CA" | required | |
| area_code | query | string | optional | |
| contains | query | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].phone_number | string | required | |
| data[].country | "US" | "CA" | required | |
| data[].locality | string | null | required | |
| data[].region | string | null | required |
POST /v1/cosend-numbers/preview
What one more Cosend number costs today, and each period after
Scopes connections:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| amount_due_minor | integer | required | |
| currency | string | required | |
| price_minor | integer | required | |
| interval | "month" | "year" | required | |
| renews_at | string | null | required | |
| proration_date | string (date-time) | required |
/v1/events
GET /v1/events
The workspace’s audit trail. Read-only
Scopes any credential
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| limit | query | integer | optional | |
| after | query | string | optional | |
| before | query | string | optional | |
| action | query | string | optional | |
| actor_id | query | string | optional | |
| target_id | query | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].object | "event" | required | |
| data[].action | string | required | |
| data[].actor_kind | string | required | |
| data[].actor_id | string | null | required | |
| data[].actor_label | string | null | required | |
| data[].target_kind | string | null | required | |
| data[].target_id | string | null | required | |
| data[].summary | string | null | required | |
| data[].request_id | string | null | required | |
| data[].created_at | string (date-time) | required | |
| has_more | boolean | required | |
| next_cursor | string | null | required |
/v1/exports
POST /v1/exports
Request an export of the workspace’s contacts, chats and log history, or of one person’s data
Scopes exports:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| from | string (date-time) | optional | |
| to | string (date-time) | optional | |
| tables | ("contacts" | "contact_numbers" | "contact_consents" | "conversations" | "messages" | "receptionist_actions" | "orders" | "order_items" | …)[] | optional | |
| contact_id | string | null | optional |
Response 202
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "export" | required | |
| status | "queued" | "running" | "ready" | "failed" | "expired" | required | |
| window_start | string | required | |
| window_end | string | required | |
| tables | ("contacts" | "contact_numbers" | "contact_consents" | "conversations" | "messages" | "receptionist_actions" | "orders" | "order_items" | …)[] | required | |
| contact_id | string | null | required | |
| row_count | integer | null | required | |
| byte_count | integer | null | required | |
| download_url | string | null | required | |
| created_at | string | required | |
| expires_at | string | null | required |
GET /v1/exports/{id}
Status of an export, with the download link once ready
Scopes exports:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "export" | required | |
| status | "queued" | "running" | "ready" | "failed" | "expired" | required | |
| window_start | string | required | |
| window_end | string | required | |
| tables | ("contacts" | "contact_numbers" | "contact_consents" | "conversations" | "messages" | "receptionist_actions" | "orders" | "order_items" | …)[] | required | |
| contact_id | string | null | required | |
| row_count | integer | null | required | |
| byte_count | integer | null | required | |
| download_url | string | null | required | |
| created_at | string | required | |
| expires_at | string | null | required |
/v1/follow-ups
GET /v1/follow-ups
Follow up today: the ad leads who went quiet after their first reply, oldest first, each with what one tap sends
Scopes messages:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| connection_id | query | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].object | "follow_up" | required | |
| data[].connection_id | string | required | |
| data[].conversation_id | string | required | |
| data[].contact_id | string | required | |
| data[].product_id | string | null | required | |
| data[].first_reply_at | string (date-time) | required | |
| data[].given_at | string (date-time) | required | |
| data[].window_open | boolean | required | |
| data[].suggested | object | required | |
| data[].suggested.kind | "saved_reply" | "template" | "none" | required | |
| data[].suggested.saved_reply_id | string | null | required | |
| data[].suggested.template | string | null | required |
POST /v1/follow-ups/{id}/send
Send a follow-up: the saved reply while WhatsApp’s window is open, else the marketing template, once
Scopes messages:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | required |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "follow_up_send" | required | |
| follow_up_id | string | required | |
| messages | object[] | required | |
| messages[].id | string | required | |
| messages[].object | "message" | required | |
| messages[].conversation_id | string | required | |
| messages[].contact_id | string | required | |
| messages[].contact | object | required | |
| messages[].contact.id | string | required | |
| messages[].contact.bsuid | string | null | required | |
| messages[].contact.phone | string | null | required | |
| messages[].contact.username | string | null | required | |
| messages[].contact.name | string | required | |
| messages[].connection_id | string | required | |
| messages[].wamid | string | null | required | |
| messages[].direction | "inbound" | "outbound" | required | |
| messages[].source | "customer" | "app" | "api" | "agent" | "automation" | "ai" | "notify" | "history" | … | required | |
| messages[].status | "queued" | "sending" | "sent" | "delivered" | "read" | "played" | "failed" | "deleted" | … | required | |
| messages[].type | string | required | |
| messages[].content | object | required | |
| messages[].location | object | null | required | |
| messages[].location.latitude | number | required | |
| messages[].location.longitude | number | required | |
| messages[].location.name | string | null | required | |
| messages[].location.address | string | null | required | |
| messages[].location.url | string | null | required | |
| messages[].contact_cards | object[] | null | required | |
| messages[].contact_cards[].name | string | null | required | |
| messages[].contact_cards[].phones | object[] | required | |
| messages[].contact_cards[].emails | object[] | required | |
| messages[].contact_cards[].org | object | null | required | |
| messages[].label | string | null | required | |
| messages[].forwarded | boolean | required | |
| messages[].frequently_forwarded | boolean | required | |
| messages[].tap | object | null | required | |
| messages[].tap.kind | "button_reply" | "list_reply" | "button" | required | |
| messages[].tap.id | string | required | |
| messages[].tap.title | string | required | |
| messages[].tap.description | string | null | required | |
| messages[].template_text | object | null | required | The words a template message showed the customer: the header and body with the values the send filled in, the footer, and the button labels. Rendered from the template Cosend holds and the values the send used. An authentication template never shows its one-time code: the placeholder stays as written. When Cosend no longer holds the template, body is the text stored when it was sent and the rest is empty. null on every other message, on a template Cosend has no words for, and on a direct-mode connection. |
| messages[].template_text.header | string | null | required | |
| messages[].template_text.body | string | null | required | |
| messages[].template_text.footer | string | null | required | |
| messages[].template_text.buttons | string[] | required | |
| messages[].reply_to | object | null | required | |
| messages[].reply_to.id | string | null | required | |
| messages[].reply_to.wamid | string | required | |
| messages[].reply_to.kind | string | null | required | |
| messages[].reply_to.from | "contact" | "business" | null | required | |
| messages[].reply_to.preview | string | required | |
| messages[].reactions | object[] | required | |
| messages[].reactions[].emoji | string | required | |
| messages[].reactions[].direction | "inbound" | "outbound" | required | |
| messages[].reactions[].message_id | string | required | |
| messages[].reactions[].created_at | string (date-time) | required | |
| messages[].metadata | object | required | |
| messages[].created_at | string (date-time) | required | |
| messages[].wa_timestamp | string (date-time) | required | |
| messages[].is_imported | boolean | required | |
| messages[].media_state | "none" | "pending" | "stored" | "expired" | "unavailable" | required | |
| messages[].media_expires_at | string (date-time) | null | required | |
| messages[].media | object | null | required | The file this message carries. status is pending while Cosend fetches it from Meta, ready once it is stored (open it with GET /v1/media/{id} or /v1/media/{id}/content; id is null in the other two states), and failed with failure_reason saying why in plain words. kind is voice for a WhatsApp voice note. On a template message, the header’s image, video or document, when the send named a file uploaded to Cosend (caption is null). null on a message with no file Cosend keeps. |
| messages[].media.id | string | null | required | |
| messages[].media.kind | "image" | "video" | "audio" | "voice" | "document" | "sticker" | required | |
| messages[].media.mime_type | string | null | required | |
| messages[].media.size_bytes | integer | null | required | |
| messages[].media.filename | string | null | required | |
| messages[].media.caption | string | null | required | |
| messages[].media.animated | boolean | null | required | |
| messages[].media.status | "pending" | "ready" | "failed" | required | |
| messages[].media.failure_reason | string | null | required | |
| messages[].transcript | object | null | required | The words of an inbound voice note or audio file. null while Cosend transcribes it, and on every other message. ready carries text; failed says why in failure_reason; skipped means transcription is unavailable. The recording in media is the same whatever this says. |
| messages[].transcript.status | "ready" | "failed" | "skipped" | required | |
| messages[].transcript.text | string | null | required | |
| messages[].transcript.language | string | null | required | |
| messages[].transcript.model | string | null | required | |
| messages[].transcript.failure_reason | string | null | required | |
| messages[].client_token | string | null | required | |
| messages[].author_user_id | string | null | required | |
| messages[].automation_run_id | string | null | required | |
| messages[].campaign_id | string | null | required | |
| messages[].campaign_name | string | null | required | |
| messages[].error_code | integer | null | required | |
| messages[].error_title | string | null | required | |
| messages[].error_detail | string | null | required | |
| warning | string | null | required |
/v1/inbox
POST /v1/inbox/session
Claim the caller’s Inbox seat: one window per person; take_over moves it here
Scopes messages:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| take_over | boolean | optional | |
| label | string | null | optional |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "inbox_session" | required | |
| user_id | string | required | |
| label | string | null | required | |
| claimed_at | string (date-time) | required | |
| renewed_at | string (date-time) | required |
DELETE /v1/inbox/session/{id}
Give the seat up. Fired on closing the Inbox and at sign-out
Scopes messages:write
Response 204
No content
POST /v1/inbox/session/{id}/heartbeat
Renew the seat; 409 inbox_session_replaced once another window took it
Scopes messages:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "inbox_session" | required | |
| user_id | string | required | |
| label | string | null | required | |
| claimed_at | string (date-time) | required | |
| renewed_at | string (date-time) | required |
Errors inbox_session_replaced
/v1/inbox-views
GET /v1/inbox-views
The saved Inbox views: the caller’s own and every one shared with the workspace
Scopes messages:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].object | "inbox_view" | required | |
| data[].name | string | required | |
| data[].filters | object | required | |
| data[].shared | "private" | "workspace" | required | |
| data[].created_by | string | required | |
| data[].created_at | string (date-time) | required | |
| data[].updated_at | string (date-time) | required |
POST /v1/inbox-views
Save an Inbox view: a name and the GET /v1/conversations filters it applies
Scopes messages:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | required | |
| filters | object | required | |
| filters.limit | integer | optional | |
| filters.q | string | optional | |
| filters.state | "open" | "pending" | "snoozed" | "resolved" | optional | |
| filters.control | "bot" | "pending_human" | "human" | "app" | optional | |
| filters.assignee_id | string | optional | |
| filters.assignee | "none" | "me" | optional | |
| filters.connection_id | string | string[] | optional | |
| filters.include_direct | string | optional | |
| filters.label | string | optional | |
| filters.unread | string | optional | |
| filters.waiting | string | optional | |
| filters.needs_person | string | optional | |
| filters.window_state | "open" | "closing" | "expiring" | "closed" | ("open" | "closing" | "expiring" | "closed")[] | optional | |
| filters.order | "recent" | "urgency" | "waiting_longest" | optional | |
| filters.priority | "normal" | "priority" | "high_priority" | optional | |
| filters.campaign_id | string | optional | |
| filters.expand | string | optional | |
| shared | "private" | "workspace" | optional |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "inbox_view" | required | |
| name | string | required | |
| filters | object | required | |
| shared | "private" | "workspace" | required | |
| created_by | string | required | |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required |
PATCH /v1/inbox-views/{id}
Rename a view, change its filters or who sees it. A shared view: its creator, an owner or an admin
Scopes messages:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | optional | |
| filters | object | optional | |
| filters.limit | integer | optional | |
| filters.q | string | optional | |
| filters.state | "open" | "pending" | "snoozed" | "resolved" | optional | |
| filters.control | "bot" | "pending_human" | "human" | "app" | optional | |
| filters.assignee_id | string | optional | |
| filters.assignee | "none" | "me" | optional | |
| filters.connection_id | string | string[] | optional | |
| filters.include_direct | string | optional | |
| filters.label | string | optional | |
| filters.unread | string | optional | |
| filters.waiting | string | optional | |
| filters.needs_person | string | optional | |
| filters.window_state | "open" | "closing" | "expiring" | "closed" | ("open" | "closing" | "expiring" | "closed")[] | optional | |
| filters.order | "recent" | "urgency" | "waiting_longest" | optional | |
| filters.priority | "normal" | "priority" | "high_priority" | optional | |
| filters.campaign_id | string | optional | |
| filters.expand | string | optional | |
| shared | "private" | "workspace" | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "inbox_view" | required | |
| name | string | required | |
| filters | object | required | |
| shared | "private" | "workspace" | required | |
| created_by | string | required | |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required |
DELETE /v1/inbox-views/{id}
Delete a view. A shared view: its creator, an owner or an admin
Scopes messages:write
Response 204
No content
/v1/lock-requests
POST /v1/lock-requests/{id}/decline
Holder refuses a takeover request
Scopes messages:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "lock_request" | required | |
| conversation_id | string | required | |
| expires_at | string (date-time) | required | |
| held_by | string | required | |
| requested_by | string | required | |
| state | "pending" | "granted" | "declined" | "expired" | "superseded" | required | |
| auto_grants | true | required |
POST /v1/lock-requests/{id}/grant
Holder hands the lock over now, without waiting out the 60s
Scopes messages:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "lock_request" | required | |
| conversation_id | string | required | |
| expires_at | string (date-time) | required | |
| held_by | string | required | |
| requested_by | string | required | |
| state | "pending" | "granted" | "declined" | "expired" | "superseded" | required | |
| auto_grants | true | required |
/v1/mcp
POST /v1/mcp/consent
Approve or refuse an AI app’s sign-in; answers the address to send the browser to
Scopes any credential
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| request | string | required | The request the dashboard was opened with: /authorize?request=…. |
| decision | "approve" | "deny" | required | |
| scopes | string[] | optional | The permissions the person kept ticked. Omitted: every one the app asked for that this person may give. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| redirect_to | string | required | Send the browser here. It carries the code, or the refusal, back to the AI app. |
| first_use | boolean | required |
POST /v1/mcp/consent/preview
What an AI app asks to do, for the consent screen, called from a signed-in dashboard session
Scopes any credential
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| request | string | required | The request the dashboard was opened with: /authorize?request=…. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| client | object | required | |
| client.name | string | required | What the app calls itself, as self-reported; the host beside it is the part a person can check. |
| client.host | string | required | Where the app’s details live, or where it will send you back to. Show it beside the name: it is the part a person can check. |
| client.kind | "metadata_document" | "registered" | "pre_registered" | required | pre_registered: a client Cosend made for an AI platform, whose name and addresses Cosend entered. |
| redirect_host | string | required | |
| scopes | object[] | required | |
| scopes[].scope | string | required | |
| scopes[].description | string | required | |
| scopes[].grantable | boolean | required | |
| scopes[].reason | string | null | required | |
| expires_at | string | required |
/v1/me
GET /v1/me
The calling credential, its workspace, plan and limits
Scopes any credential
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| user | object | null | required | |
| user.id | string | required | |
| user.email | string | required | |
| user.name | string | required | |
| language | "en" | "pt" | "es" | "ar" | null | required | |
| signup_method | "google" | "email" | optional | |
| internal | boolean | required | |
| organization | object | required | |
| organization.id | string | required | |
| organization.name | string | required | |
| organization.slug | string | required | |
| organization.timezone | string | required | |
| organization.country | string | null | required | |
| organization.currency | string | null | required | |
| organization.erasure_scheduled_for | string (date-time) | null | required | |
| credential | object | required | |
| credential.kind | "connection" | "organization" | "oauth" | "dashboard" | required | |
| credential.id | string | required | |
| credential.name | string | required | |
| credential.is_live | boolean | required | |
| credential.scopes | string[] | required | |
| credential.connection_id | string | null | required | |
| credential.connection_ids | string[] | required | |
| connections | object[] | required | The WhatsApp numbers this credential works with: every number of the workspace, or, for a key made for some numbers, those. A message is sent from one of them. |
| connections[].id | string | required | |
| connections[].display_phone_number | string | required | |
| connections[].verified_name | string | null | required | |
| connections[].mode | "coexistence" | "cloud_api" | required | |
| connections[].status | "pending" | "active" | "needs_reauth" | "payment_blocked" | "restricted" | "disconnected" | "offboarded" | required | |
| subscription | object | required | |
| subscription.plan | string | required | |
| subscription.status | string | required | |
| subscription.effective_plan_code | string | required | |
| subscription.trial | object | null | required | |
| subscription.trial.state | "eligible" | "not_eligible" | "active" | required | |
| subscription.trial.not_eligible_reason | "used" | "paid_before" | "number_used" | "business_used" | null | required | Why no trial can start: used (this workspace had its trial), paid_before (it has been on a paid plan), number_used or business_used (one of its numbers, or its Meta business, already had a trial). Null unless state is not_eligible. |
| subscription.trial.started_at | string (date-time) | null | required | |
| subscription.trial.ends_at | string (date-time) | null | required | |
| subscription.trial.ended_at | string (date-time) | null | required | |
| subscription.trial.started_by_connection_id | string | null | required | |
| subscription.trial.offer | object | required | |
| subscription.trial.choice | object | null | required | |
| subscription.trial.days_left | integer | null | required | |
| subscription.trial.reminder_due | boolean | required | |
| subscription.overdue | boolean | required | |
| subscription.overdue_since | string (date-time) | null | required | |
| subscription.current_period_end | string (date-time) | required | |
| subscription.free_limits_effective_at | string (date-time) | null | required | |
| subscription.overdue_stage | "grace" | "dropped" | null | required | |
| subscription.free_without_card | boolean | required | True when automations stop at the allowance: the Free plan, card or no card (a Free workspace that already had a card when this rule began keeps billed extras until 1 January 2028 and is false up to that date), or an account held to the Free plan’s limits after a failed payment. False when usage beyond the allowance is billed instead. |
| limits | object | required | |
| entitlements | object | required |
PATCH /v1/me
Change your own name or language
Scopes any credential
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | optional | |
| language | "en" | "pt" | "es" | "ar" | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| string | required | ||
| name | string | required |
GET /v1/me/feedback-identity
The signed identity the feedback board opens you in with
Scopes any credential
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| token | string | required | |
| string | required | ||
| first_name | string | null | required |
DELETE /v1/me/locks
Release every conversation lock the caller holds. Called at sign-out
Scopes messages:write
Response 204
No content
GET /v1/me/preferences
Your preferences in this workspace: appearance, remembered numbers, shortcuts
Scopes any credential
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| appearance | "system" | "light" | "dark" | required | |
| remembered_numbers | object | required | |
| remembered_numbers.inbox | "all" | string[] | required | |
| remembered_numbers.ai | string | null | required | |
| remembered_numbers.integrations | string | null | required | |
| single_key_shortcuts | boolean | required |
PATCH /v1/me/preferences
Change any of your preferences; the rest stay as they are
Scopes any credential
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| appearance | "system" | "light" | "dark" | optional | |
| remembered_numbers | object | optional | |
| remembered_numbers.inbox | "all" | string[] | optional | |
| remembered_numbers.ai | string | null | optional | |
| remembered_numbers.integrations | string | null | optional | |
| single_key_shortcuts | boolean | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| appearance | "system" | "light" | "dark" | required | |
| remembered_numbers | object | required | |
| remembered_numbers.inbox | "all" | string[] | required | |
| remembered_numbers.ai | string | null | required | |
| remembered_numbers.integrations | string | null | required | |
| single_key_shortcuts | boolean | required |
POST /v1/me/send-link
Email yourself a dashboard link, to open on a computer. Five an hour
Scopes any credential
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| url | string (uri) | required |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| sent_to | string | required |
/v1/media
POST /v1/media
Upload a file to Meta and store it in Cosend in one call. Every upload is its own file on its number, even with the same bytes; a name that number already has gets “ (2)”, “ (3)” … before the extension, as in Windows
Scopes messages:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | optional |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| connection_id | string | required | |
| mime_type | string | required | One of the types WhatsApp accepts, which also decides how the file is sent: image (image/jpeg, image/png; 5 MB), video (video/mp4, video/3gpp; 16 MB), audio (audio/aac, audio/amr, audio/mpeg, audio/mp4, audio/ogg; 16 MB), document (application/pdf, text/plain and the Word, Excel and PowerPoint types; 100 MB), sticker (image/webp; 100 KB static, 500 KB animated). Any other type, or a file over its limit, is refused before anything is stored. |
| filename | string | null | optional | |
| data_base64 | string | required |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "media" | required | |
| connection_id | string | required | |
| meta_media_id | string | null | required | |
| mime_type | string | required | |
| filename | string | null | required | |
| size_bytes | integer | required | |
| sha256 | string | required | |
| state | "none" | "pending" | "stored" | "expired" | "unavailable" | required | |
| expires_at | string (date-time) | null | required | |
| created_at | string (date-time) | required | |
| url | string | null | required |
GET /v1/media/{id}
Media metadata plus a signed 15-minute URL
Scopes messages:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "media" | required | |
| connection_id | string | required | |
| meta_media_id | string | null | required | |
| mime_type | string | required | |
| filename | string | null | required | |
| size_bytes | integer | required | |
| sha256 | string | required | |
| state | "none" | "pending" | "stored" | "expired" | "unavailable" | required | |
| expires_at | string (date-time) | null | required | |
| created_at | string (date-time) | required | |
| url | string | null | required |
GET /v1/media/{id}/content
Stream the bytes
Scopes messages:read
Response 200
The media object itself. The Content-Type header carries the real type Meta stored it under, and Content-Disposition names the file when one is known. application/octet-stream
/v1/memberships
GET /v1/memberships
Members, pending invites, and what the next seat costs. With connection_id, only those who see that number
Scopes members:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| connection_id | query | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].object | "membership" | required | |
| data[].user_id | string | required | |
| data[].email | string | required | |
| data[].display_name | string | null | required | |
| data[].role | "owner" | "admin" | "member" | required | |
| data[].status | "active" | "invited" | "removed" | required | |
| data[].invited_at | string (date-time) | null | required | |
| data[].invited_by | string | null | required | |
| data[].invited_by_name | string | null | required | |
| data[].invited_by_email | string | null | required | |
| data[].invite_expires_at | string (date-time) | null | required | |
| data[].accepted_at | string (date-time) | null | required | |
| data[].invite_expired | boolean | required | |
| data[].connection_access | "all" | string[] | required | |
| seats | object | required | |
| seats.seats_used | integer | required | |
| seats.seats_included | integer | null | required | |
| seats.pending_invites | integer | required | |
| seats.next_invoice_delta_minor | string | required |
PATCH /v1/memberships/{id}
Change a member’s role or numbers. Demoting the last owner is 409 sole_owner; a list of numbers for an owner or admin is 400
Scopes members:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| role | "owner" | "admin" | "member" | optional | |
| connection_access | "all" | string[] | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "membership" | required | |
| user_id | string | required | |
| string | required | ||
| display_name | string | null | required | |
| role | "owner" | "admin" | "member" | required | |
| status | "active" | "invited" | "removed" | required | |
| invited_at | string (date-time) | null | required | |
| invited_by | string | null | required | |
| invited_by_name | string | null | required | |
| invited_by_email | string | null | required | |
| invite_expires_at | string (date-time) | null | required | |
| accepted_at | string (date-time) | null | required | |
| invite_expired | boolean | required | |
| connection_access | "all" | string[] | required |
Errors sole_owner
DELETE /v1/memberships/{id}
Remove a member. Access ends immediately; billing at the period boundary
Scopes members:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "membership" | required | |
| status | "removed" | required | |
| user_id | string | required | |
| billing_effective_at | string (date-time) | required | |
| seats | object | required | |
| seats.seats_used | integer | required | |
| seats.seats_included | integer | null | required | |
| seats.pending_invites | integer | required | |
| seats.next_invoice_delta_minor | string | required |
POST /v1/memberships/invites
Invite someone. Past the included seats this is billed, never blocked
Scopes invites:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| string (email) | required | ||
| role | "owner" | "admin" | "member" | required | |
| connection_access | "all" | string[] | optional |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| membership | object | required | |
| membership.id | string | required | |
| membership.object | "membership" | required | |
| membership.user_id | string | required | |
| membership.email | string | required | |
| membership.display_name | string | null | required | |
| membership.role | "owner" | "admin" | "member" | required | |
| membership.status | "active" | "invited" | "removed" | required | |
| membership.invited_at | string (date-time) | null | required | |
| membership.invited_by | string | null | required | |
| membership.invited_by_name | string | null | required | |
| membership.invited_by_email | string | null | required | |
| membership.invite_expires_at | string (date-time) | null | required | |
| membership.accepted_at | string (date-time) | null | required | |
| membership.invite_expired | boolean | required | |
| membership.connection_access | "all" | string[] | required | |
| seats | object | required | |
| seats.seats_used | integer | required | |
| seats.seats_included | integer | null | required | |
| seats.pending_invites | integer | required | |
| seats.next_invoice_delta_minor | string | required | |
| first_use | boolean | required |
DELETE /v1/memberships/invites/{id}
Revoke a pending invite
Scopes invites:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "membership" | required | |
| status | "removed" | required |
GET /v1/memberships/join-requests
People on your email domain waiting to be let in
Scopes any credential
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].object | "join_request" | required | |
| data[].email | string | required | |
| data[].name | string | required | |
| data[].domain | string | required | |
| data[].status | "pending" | "approved" | "declined" | required | |
| data[].requested_at | string (date-time) | required | |
| data[].decided_at | string (date-time) | null | required | |
| data[].decided_by | string | null | required |
POST /v1/memberships/join-requests/{id}/approve
Approve a join request: admits the person as a member, with the numbers they work on, in one transaction
Scopes invites:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| connection_access | "all" | string[] | optional |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| join_request | object | required | |
| join_request.id | string | required | |
| join_request.object | "join_request" | required | |
| join_request.email | string | required | |
| join_request.name | string | required | |
| join_request.domain | string | required | |
| join_request.status | "pending" | "approved" | "declined" | required | |
| join_request.requested_at | string (date-time) | required | |
| join_request.decided_at | string (date-time) | null | required | |
| join_request.decided_by | string | null | required | |
| membership | object | required | |
| membership.id | string | required | |
| membership.object | "membership" | required | |
| membership.user_id | string | required | |
| membership.email | string | required | |
| membership.display_name | string | null | required | |
| membership.role | "owner" | "admin" | "member" | required | |
| membership.status | "active" | "invited" | "removed" | required | |
| membership.invited_at | string (date-time) | null | required | |
| membership.invited_by | string | null | required | |
| membership.invited_by_name | string | null | required | |
| membership.invited_by_email | string | null | required | |
| membership.invite_expires_at | string (date-time) | null | required | |
| membership.accepted_at | string (date-time) | null | required | |
| membership.invite_expired | boolean | required | |
| membership.connection_access | "all" | string[] | required | |
| seats | object | required | |
| seats.seats_used | integer | required | |
| seats.seats_included | integer | null | required | |
| seats.pending_invites | integer | required | |
| seats.next_invoice_delta_minor | string | required |
POST /v1/memberships/join-requests/{id}/decline
Decline a join request. The requester is told, never who decided
Scopes invites:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "join_request" | required | |
| string | required | ||
| name | string | required | |
| domain | string | required | |
| status | "pending" | "approved" | "declined" | required | |
| requested_at | string (date-time) | required | |
| decided_at | string (date-time) | null | required | |
| decided_by | string | null | required |
GET /v1/memberships/me/access-requests
When you asked the owners and admins for access to numbers, or null
Scopes any credential
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| asked_at | string (date-time) | null | required |
POST /v1/memberships/me/access-requests
Ask the owners and admins for access to numbers. Asking again is the same request
Scopes any credential
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| asked_at | string (date-time) | null | required |
POST /v1/memberships/transfer-owner
Make another member the owner; the current owner becomes an admin in the same step
Scopes any credential
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| membership_id | string | required |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| new_owner | object | required | |
| new_owner.id | string | required | |
| new_owner.object | "membership" | required | |
| new_owner.user_id | string | required | |
| new_owner.email | string | required | |
| new_owner.display_name | string | null | required | |
| new_owner.role | "owner" | "admin" | "member" | required | |
| new_owner.status | "active" | "invited" | "removed" | required | |
| new_owner.invited_at | string (date-time) | null | required | |
| new_owner.invited_by | string | null | required | |
| new_owner.invited_by_name | string | null | required | |
| new_owner.invited_by_email | string | null | required | |
| new_owner.invite_expires_at | string (date-time) | null | required | |
| new_owner.accepted_at | string (date-time) | null | required | |
| new_owner.invite_expired | boolean | required | |
| new_owner.connection_access | "all" | string[] | required | |
| previous_owner | object | required | |
| previous_owner.id | string | required | |
| previous_owner.object | "membership" | required | |
| previous_owner.user_id | string | required | |
| previous_owner.email | string | required | |
| previous_owner.display_name | string | null | required | |
| previous_owner.role | "owner" | "admin" | "member" | required | |
| previous_owner.status | "active" | "invited" | "removed" | required | |
| previous_owner.invited_at | string (date-time) | null | required | |
| previous_owner.invited_by | string | null | required | |
| previous_owner.invited_by_name | string | null | required | |
| previous_owner.invited_by_email | string | null | required | |
| previous_owner.invite_expires_at | string (date-time) | null | required | |
| previous_owner.accepted_at | string (date-time) | null | required | |
| previous_owner.invite_expired | boolean | required | |
| previous_owner.connection_access | "all" | string[] | required |
/v1/messages
GET /v1/messages
List messages; with q, search the text of every message instead (page size 20)
Scopes messages:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| limit | query | integer | optional | |
| after | query | string | optional | |
| before | query | string | optional | |
| order | query | "asc" | "desc" | optional | asc (the default) or desc. Not used with q: a search is newest first. |
| conversation_id | query | string | optional | |
| contact_id | query | string | optional | |
| connection_id | query | string | string[] | optional | A connection's id; repeat it for several numbers. |
| direction | query | "inbound" | "outbound" | optional | |
| source | query | "customer" | "app" | "api" | "agent" | "automation" | "ai" | "notify" | "history" | … | optional | |
| status | query | "queued" | "sending" | "sent" | "delivered" | "read" | "played" | "failed" | "deleted" | … | optional | |
| q | query | string | optional | Search the text of the workspace's messages for this, newest first; the answer is hits ({message_id, conversation_id, connection_id, snippet, created_at}), 20 to a page. Messages of a number whose delivery_mode is direct are never searched. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].object | "message" | required | |
| data[].conversation_id | string | required | |
| data[].contact_id | string | required | |
| data[].contact | object | required | |
| data[].contact.id | string | required | |
| data[].contact.bsuid | string | null | required | |
| data[].contact.phone | string | null | required | |
| data[].contact.username | string | null | required | |
| data[].contact.name | string | required | |
| data[].connection_id | string | required | |
| data[].wamid | string | null | required | |
| data[].direction | "inbound" | "outbound" | required | |
| data[].source | "customer" | "app" | "api" | "agent" | "automation" | "ai" | "notify" | "history" | … | required | |
| data[].status | "queued" | "sending" | "sent" | "delivered" | "read" | "played" | "failed" | "deleted" | … | required | |
| data[].type | string | required | |
| data[].content | object | required | |
| data[].location | object | null | required | |
| data[].location.latitude | number | required | |
| data[].location.longitude | number | required | |
| data[].location.name | string | null | required | |
| data[].location.address | string | null | required | |
| data[].location.url | string | null | required | |
| data[].contact_cards | object[] | null | required | |
| data[].contact_cards[].name | string | null | required | |
| data[].contact_cards[].phones | object[] | required | |
| data[].contact_cards[].emails | object[] | required | |
| data[].contact_cards[].org | object | null | required | |
| data[].label | string | null | required | |
| data[].forwarded | boolean | required | |
| data[].frequently_forwarded | boolean | required | |
| data[].tap | object | null | required | |
| data[].tap.kind | "button_reply" | "list_reply" | "button" | required | |
| data[].tap.id | string | required | |
| data[].tap.title | string | required | |
| data[].tap.description | string | null | required | |
| data[].template_text | object | null | required | The words a template message showed the customer: the header and body with the values the send filled in, the footer, and the button labels. Rendered from the template Cosend holds and the values the send used. An authentication template never shows its one-time code: the placeholder stays as written. When Cosend no longer holds the template, body is the text stored when it was sent and the rest is empty. null on every other message, on a template Cosend has no words for, and on a direct-mode connection. |
| data[].template_text.header | string | null | required | |
| data[].template_text.body | string | null | required | |
| data[].template_text.footer | string | null | required | |
| data[].template_text.buttons | string[] | required | |
| data[].reply_to | object | null | required | |
| data[].reply_to.id | string | null | required | |
| data[].reply_to.wamid | string | required | |
| data[].reply_to.kind | string | null | required | |
| data[].reply_to.from | "contact" | "business" | null | required | |
| data[].reply_to.preview | string | required | |
| data[].reactions | object[] | required | |
| data[].reactions[].emoji | string | required | |
| data[].reactions[].direction | "inbound" | "outbound" | required | |
| data[].reactions[].message_id | string | required | |
| data[].reactions[].created_at | string (date-time) | required | |
| data[].metadata | object | required | |
| data[].created_at | string (date-time) | required | |
| data[].wa_timestamp | string (date-time) | required | |
| data[].is_imported | boolean | required | |
| data[].media_state | "none" | "pending" | "stored" | "expired" | "unavailable" | required | |
| data[].media_expires_at | string (date-time) | null | required | |
| data[].media | object | null | required | The file this message carries. status is pending while Cosend fetches it from Meta, ready once it is stored (open it with GET /v1/media/{id} or /v1/media/{id}/content; id is null in the other two states), and failed with failure_reason saying why in plain words. kind is voice for a WhatsApp voice note. On a template message, the header’s image, video or document, when the send named a file uploaded to Cosend (caption is null). null on a message with no file Cosend keeps. |
| data[].media.id | string | null | required | |
| data[].media.kind | "image" | "video" | "audio" | "voice" | "document" | "sticker" | required | |
| data[].media.mime_type | string | null | required | |
| data[].media.size_bytes | integer | null | required | |
| data[].media.filename | string | null | required | |
| data[].media.caption | string | null | required | |
| data[].media.animated | boolean | null | required | |
| data[].media.status | "pending" | "ready" | "failed" | required | |
| data[].media.failure_reason | string | null | required | |
| data[].transcript | object | null | required | The words of an inbound voice note or audio file. null while Cosend transcribes it, and on every other message. ready carries text; failed says why in failure_reason; skipped means transcription is unavailable. The recording in media is the same whatever this says. |
| data[].transcript.status | "ready" | "failed" | "skipped" | required | |
| data[].transcript.text | string | null | required | |
| data[].transcript.language | string | null | required | |
| data[].transcript.model | string | null | required | |
| data[].transcript.failure_reason | string | null | required | |
| data[].client_token | string | null | required | |
| data[].author_user_id | string | null | required | |
| data[].automation_run_id | string | null | required | |
| data[].campaign_id | string | null | required | |
| data[].campaign_name | string | null | required | |
| data[].error_code | integer | null | required | |
| data[].error_title | string | null | required | |
| data[].error_detail | string | null | required | |
| has_more | boolean | required | |
| next_cursor | string | null | required |
POST /v1/messages
Send a message
Scopes messages:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | required |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| connection_id | string | optional | The WhatsApp number the message goes out from. Optional with a connection key, which already names it. A contact belongs to one business and is on its numbers: a contact_id, a to of ct_… or a conversation_id may be sent to from any number of that business, which then has the contact too; from a number of another business it is refused with 409 contact_portfolio_mismatch, whose body carries contact_id and connection_id. |
| to | string | optional | |
| contact_id | string | optional | |
| conversation_id | string | optional | |
| type | "text" | "image" | "audio" | "video" | "document" | "sticker" | "location" | "contacts" | … | required | |
| text | object | optional | |
| image | object | optional | Meta's media object. id may be a Cosend media id (med_…, from POST /v1/media): Cosend uploads the file to WhatsApp and sends it by WhatsApp's id, and the message's media block then names the file. With a Cosend id, caption is allowed on image, video and document (not on audio or sticker), and filename on document only (it defaults to the uploaded name). Meta's own id or link goes to WhatsApp unchanged. |
| audio | object | optional | Meta's media object. id may be a Cosend media id (med_…, from POST /v1/media): Cosend uploads the file to WhatsApp and sends it by WhatsApp's id, and the message's media block then names the file. With a Cosend id, caption is allowed on image, video and document (not on audio or sticker), and filename on document only (it defaults to the uploaded name). Meta's own id or link goes to WhatsApp unchanged. |
| video | object | optional | Meta's media object. id may be a Cosend media id (med_…, from POST /v1/media): Cosend uploads the file to WhatsApp and sends it by WhatsApp's id, and the message's media block then names the file. With a Cosend id, caption is allowed on image, video and document (not on audio or sticker), and filename on document only (it defaults to the uploaded name). Meta's own id or link goes to WhatsApp unchanged. |
| document | object | optional | Meta's media object. id may be a Cosend media id (med_…, from POST /v1/media): Cosend uploads the file to WhatsApp and sends it by WhatsApp's id, and the message's media block then names the file. With a Cosend id, caption is allowed on image, video and document (not on audio or sticker), and filename on document only (it defaults to the uploaded name). Meta's own id or link goes to WhatsApp unchanged. |
| sticker | object | optional | Meta's media object. id may be a Cosend media id (med_…, from POST /v1/media): Cosend uploads the file to WhatsApp and sends it by WhatsApp's id, and the message's media block then names the file. With a Cosend id, caption is allowed on image, video and document (not on audio or sticker), and filename on document only (it defaults to the uploaded name). Meta's own id or link goes to WhatsApp unchanged. |
| location | object | optional | |
| contacts | object[] | optional | |
| interactive | object | optional | Meta's interactive object. Checked against WhatsApp's limits before anything is written, and refused in words naming the field: a reply-button message (type "button", up to 3 buttons), a list message (type "list"), a catalogue message (type "catalog_message": body up to 1024 characters, footer up to 60, optional action.parameters.thumbnail_product_retailer_id), a single-product message (type "product": action.product_retailer_id, optional body and footer, no header) and a multi-product message (type "product_list": a text header up to 60 characters, a body, action.sections of product_items, at most 10 sections and 30 products, a title up to 24 characters on each section when there is more than one). A product message may leave out action.catalog_id, and Cosend sends the catalogue linked to the number's WhatsApp Business account in Meta's Commerce Manager; a catalogue message, and a product message without catalog_id, are refused in words when the number has none linked. A catalog_id you give is sent as given. Like every free-form message, they go only inside the 24-hour customer service window. Any other interactive type goes to WhatsApp unchanged. |
| interactive.type | "button" | required | |
| interactive.header | object | optional | |
| interactive.header.type | "text" | required | |
| interactive.header.text | string | required | |
| interactive.header.image | object | required | |
| interactive.header.video | object | required | |
| interactive.header.document | object | required | |
| interactive.body | object | required | |
| interactive.body.text | string | required | |
| interactive.footer | object | optional | |
| interactive.footer.text | string | required | |
| interactive.action | object | required | |
| interactive.action.buttons | object[] | required | |
| template | object | optional | Meta's template object: {"name", "language": {"code"}, "components"}. A header parameter of type image, video or document may name a file uploaded with POST /v1/media by its id ({"type": "image", "image": {"id": "med_…"}}): Cosend uploads it to Meta for this number and sends Meta's id; a link, or a media id from Meta, is sent as it is. A location parameter ({"type": "location", "location": {"latitude", "longitude", "name", "address"}}) needs a latitude from -90 to 90 and a longitude from -180 to 180, in decimal degrees; name and address are text. |
| reaction | object | optional | |
| reaction.message_id | string | required | |
| reaction.emoji | string | required | |
| reply_to | string | null | optional | |
| metadata | object | optional | |
| source | "customer" | "app" | "api" | "agent" | "automation" | "ai" | "notify" | "history" | … | optional | Who is sending. Left out, it is agent for a person (the dashboard Inbox, or an MCP client acting for one) and api for an API key. |
| send_mode | "auto" | "strict" | optional | |
| fallback_template | object | optional | |
| fallback_template.name | string | required | |
| fallback_template.language | string | required |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "message" | required | |
| conversation_id | string | required | |
| contact_id | string | required | |
| contact | object | required | |
| contact.id | string | required | |
| contact.bsuid | string | null | required | |
| contact.phone | string | null | required | |
| contact.username | string | null | required | |
| contact.name | string | required | |
| connection_id | string | required | |
| wamid | string | null | required | |
| direction | "inbound" | "outbound" | required | |
| source | "customer" | "app" | "api" | "agent" | "automation" | "ai" | "notify" | "history" | … | required | |
| status | "queued" | "sending" | "sent" | "delivered" | "read" | "played" | "failed" | "deleted" | … | required | |
| type | string | required | |
| content | object | required | |
| location | object | null | required | |
| location.latitude | number | required | |
| location.longitude | number | required | |
| location.name | string | null | required | |
| location.address | string | null | required | |
| location.url | string | null | required | |
| contact_cards | object[] | null | required | |
| contact_cards[].name | string | null | required | |
| contact_cards[].phones | object[] | required | |
| contact_cards[].phones[].phone | string | null | required | |
| contact_cards[].phones[].wa_id | string | null | required | |
| contact_cards[].phones[].type | string | null | required | |
| contact_cards[].emails | object[] | required | |
| contact_cards[].emails[].email | string | required | |
| contact_cards[].emails[].type | string | null | required | |
| contact_cards[].org | object | null | required | |
| contact_cards[].org.company | string | null | required | |
| contact_cards[].org.department | string | null | required | |
| contact_cards[].org.title | string | null | required | |
| label | string | null | required | |
| forwarded | boolean | required | |
| frequently_forwarded | boolean | required | |
| tap | object | null | required | |
| tap.kind | "button_reply" | "list_reply" | "button" | required | |
| tap.id | string | required | |
| tap.title | string | required | |
| tap.description | string | null | required | |
| template_text | object | null | required | The words a template message showed the customer: the header and body with the values the send filled in, the footer, and the button labels. Rendered from the template Cosend holds and the values the send used. An authentication template never shows its one-time code: the placeholder stays as written. When Cosend no longer holds the template, body is the text stored when it was sent and the rest is empty. null on every other message, on a template Cosend has no words for, and on a direct-mode connection. |
| template_text.header | string | null | required | |
| template_text.body | string | null | required | |
| template_text.footer | string | null | required | |
| template_text.buttons | string[] | required | |
| reply_to | object | null | required | |
| reply_to.id | string | null | required | |
| reply_to.wamid | string | required | |
| reply_to.kind | string | null | required | |
| reply_to.from | "contact" | "business" | null | required | |
| reply_to.preview | string | required | |
| reactions | object[] | required | |
| reactions[].emoji | string | required | |
| reactions[].direction | "inbound" | "outbound" | required | |
| reactions[].message_id | string | required | |
| reactions[].created_at | string (date-time) | required | |
| metadata | object | required | |
| created_at | string (date-time) | required | |
| wa_timestamp | string (date-time) | required | |
| is_imported | boolean | required | |
| media_state | "none" | "pending" | "stored" | "expired" | "unavailable" | required | |
| media_expires_at | string (date-time) | null | required | |
| media | object | null | required | The file this message carries. status is pending while Cosend fetches it from Meta, ready once it is stored (open it with GET /v1/media/{id} or /v1/media/{id}/content; id is null in the other two states), and failed with failure_reason saying why in plain words. kind is voice for a WhatsApp voice note. On a template message, the header’s image, video or document, when the send named a file uploaded to Cosend (caption is null). null on a message with no file Cosend keeps. |
| media.id | string | null | required | |
| media.kind | "image" | "video" | "audio" | "voice" | "document" | "sticker" | required | |
| media.mime_type | string | null | required | |
| media.size_bytes | integer | null | required | |
| media.filename | string | null | required | |
| media.caption | string | null | required | |
| media.animated | boolean | null | required | |
| media.status | "pending" | "ready" | "failed" | required | |
| media.failure_reason | string | null | required | |
| transcript | object | null | required | The words of an inbound voice note or audio file. null while Cosend transcribes it, and on every other message. ready carries text; failed says why in failure_reason; skipped means transcription is unavailable. The recording in media is the same whatever this says. |
| transcript.status | "ready" | "failed" | "skipped" | required | |
| transcript.text | string | null | required | |
| transcript.language | string | null | required | |
| transcript.model | string | null | required | |
| transcript.failure_reason | string | null | required | |
| client_token | string | null | required | |
| author_user_id | string | null | required | |
| automation_run_id | string | null | required | |
| campaign_id | string | null | required | |
| campaign_name | string | null | required | |
| error_code | integer | null | required | |
| error_title | string | null | required | |
| error_detail | string | null | required | |
| send_mode_used | "freeform" | "template" | required | |
| first_use | boolean | required |
GET /v1/messages/{id}
One message, by msg_… id or by wamid
Scopes messages:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "message" | required | |
| conversation_id | string | required | |
| contact_id | string | required | |
| contact | object | required | |
| contact.id | string | required | |
| contact.bsuid | string | null | required | |
| contact.phone | string | null | required | |
| contact.username | string | null | required | |
| contact.name | string | required | |
| connection_id | string | required | |
| wamid | string | null | required | |
| direction | "inbound" | "outbound" | required | |
| source | "customer" | "app" | "api" | "agent" | "automation" | "ai" | "notify" | "history" | … | required | |
| status | "queued" | "sending" | "sent" | "delivered" | "read" | "played" | "failed" | "deleted" | … | required | |
| type | string | required | |
| content | object | required | |
| location | object | null | required | |
| location.latitude | number | required | |
| location.longitude | number | required | |
| location.name | string | null | required | |
| location.address | string | null | required | |
| location.url | string | null | required | |
| contact_cards | object[] | null | required | |
| contact_cards[].name | string | null | required | |
| contact_cards[].phones | object[] | required | |
| contact_cards[].phones[].phone | string | null | required | |
| contact_cards[].phones[].wa_id | string | null | required | |
| contact_cards[].phones[].type | string | null | required | |
| contact_cards[].emails | object[] | required | |
| contact_cards[].emails[].email | string | required | |
| contact_cards[].emails[].type | string | null | required | |
| contact_cards[].org | object | null | required | |
| contact_cards[].org.company | string | null | required | |
| contact_cards[].org.department | string | null | required | |
| contact_cards[].org.title | string | null | required | |
| label | string | null | required | |
| forwarded | boolean | required | |
| frequently_forwarded | boolean | required | |
| tap | object | null | required | |
| tap.kind | "button_reply" | "list_reply" | "button" | required | |
| tap.id | string | required | |
| tap.title | string | required | |
| tap.description | string | null | required | |
| template_text | object | null | required | The words a template message showed the customer: the header and body with the values the send filled in, the footer, and the button labels. Rendered from the template Cosend holds and the values the send used. An authentication template never shows its one-time code: the placeholder stays as written. When Cosend no longer holds the template, body is the text stored when it was sent and the rest is empty. null on every other message, on a template Cosend has no words for, and on a direct-mode connection. |
| template_text.header | string | null | required | |
| template_text.body | string | null | required | |
| template_text.footer | string | null | required | |
| template_text.buttons | string[] | required | |
| reply_to | object | null | required | |
| reply_to.id | string | null | required | |
| reply_to.wamid | string | required | |
| reply_to.kind | string | null | required | |
| reply_to.from | "contact" | "business" | null | required | |
| reply_to.preview | string | required | |
| reactions | object[] | required | |
| reactions[].emoji | string | required | |
| reactions[].direction | "inbound" | "outbound" | required | |
| reactions[].message_id | string | required | |
| reactions[].created_at | string (date-time) | required | |
| metadata | object | required | |
| created_at | string (date-time) | required | |
| wa_timestamp | string (date-time) | required | |
| is_imported | boolean | required | |
| media_state | "none" | "pending" | "stored" | "expired" | "unavailable" | required | |
| media_expires_at | string (date-time) | null | required | |
| media | object | null | required | The file this message carries. status is pending while Cosend fetches it from Meta, ready once it is stored (open it with GET /v1/media/{id} or /v1/media/{id}/content; id is null in the other two states), and failed with failure_reason saying why in plain words. kind is voice for a WhatsApp voice note. On a template message, the header’s image, video or document, when the send named a file uploaded to Cosend (caption is null). null on a message with no file Cosend keeps. |
| media.id | string | null | required | |
| media.kind | "image" | "video" | "audio" | "voice" | "document" | "sticker" | required | |
| media.mime_type | string | null | required | |
| media.size_bytes | integer | null | required | |
| media.filename | string | null | required | |
| media.caption | string | null | required | |
| media.animated | boolean | null | required | |
| media.status | "pending" | "ready" | "failed" | required | |
| media.failure_reason | string | null | required | |
| transcript | object | null | required | The words of an inbound voice note or audio file. null while Cosend transcribes it, and on every other message. ready carries text; failed says why in failure_reason; skipped means transcription is unavailable. The recording in media is the same whatever this says. |
| transcript.status | "ready" | "failed" | "skipped" | required | |
| transcript.text | string | null | required | |
| transcript.language | string | null | required | |
| transcript.model | string | null | required | |
| transcript.failure_reason | string | null | required | |
| client_token | string | null | required | |
| author_user_id | string | null | required | |
| automation_run_id | string | null | required | |
| campaign_id | string | null | required | |
| campaign_name | string | null | required | |
| error_code | integer | null | required | |
| error_title | string | null | required | |
| error_detail | string | null | required |
POST /v1/messages/{id}/reactions
React to a message; an empty emoji removes the reaction
Scopes messages:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | required |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| emoji | string | required |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "message" | required | |
| conversation_id | string | required | |
| contact_id | string | required | |
| contact | object | required | |
| contact.id | string | required | |
| contact.bsuid | string | null | required | |
| contact.phone | string | null | required | |
| contact.username | string | null | required | |
| contact.name | string | required | |
| connection_id | string | required | |
| wamid | string | null | required | |
| direction | "inbound" | "outbound" | required | |
| source | "customer" | "app" | "api" | "agent" | "automation" | "ai" | "notify" | "history" | … | required | |
| status | "queued" | "sending" | "sent" | "delivered" | "read" | "played" | "failed" | "deleted" | … | required | |
| type | string | required | |
| content | object | required | |
| location | object | null | required | |
| location.latitude | number | required | |
| location.longitude | number | required | |
| location.name | string | null | required | |
| location.address | string | null | required | |
| location.url | string | null | required | |
| contact_cards | object[] | null | required | |
| contact_cards[].name | string | null | required | |
| contact_cards[].phones | object[] | required | |
| contact_cards[].phones[].phone | string | null | required | |
| contact_cards[].phones[].wa_id | string | null | required | |
| contact_cards[].phones[].type | string | null | required | |
| contact_cards[].emails | object[] | required | |
| contact_cards[].emails[].email | string | required | |
| contact_cards[].emails[].type | string | null | required | |
| contact_cards[].org | object | null | required | |
| contact_cards[].org.company | string | null | required | |
| contact_cards[].org.department | string | null | required | |
| contact_cards[].org.title | string | null | required | |
| label | string | null | required | |
| forwarded | boolean | required | |
| frequently_forwarded | boolean | required | |
| tap | object | null | required | |
| tap.kind | "button_reply" | "list_reply" | "button" | required | |
| tap.id | string | required | |
| tap.title | string | required | |
| tap.description | string | null | required | |
| template_text | object | null | required | The words a template message showed the customer: the header and body with the values the send filled in, the footer, and the button labels. Rendered from the template Cosend holds and the values the send used. An authentication template never shows its one-time code: the placeholder stays as written. When Cosend no longer holds the template, body is the text stored when it was sent and the rest is empty. null on every other message, on a template Cosend has no words for, and on a direct-mode connection. |
| template_text.header | string | null | required | |
| template_text.body | string | null | required | |
| template_text.footer | string | null | required | |
| template_text.buttons | string[] | required | |
| reply_to | object | null | required | |
| reply_to.id | string | null | required | |
| reply_to.wamid | string | required | |
| reply_to.kind | string | null | required | |
| reply_to.from | "contact" | "business" | null | required | |
| reply_to.preview | string | required | |
| reactions | object[] | required | |
| reactions[].emoji | string | required | |
| reactions[].direction | "inbound" | "outbound" | required | |
| reactions[].message_id | string | required | |
| reactions[].created_at | string (date-time) | required | |
| metadata | object | required | |
| created_at | string (date-time) | required | |
| wa_timestamp | string (date-time) | required | |
| is_imported | boolean | required | |
| media_state | "none" | "pending" | "stored" | "expired" | "unavailable" | required | |
| media_expires_at | string (date-time) | null | required | |
| media | object | null | required | The file this message carries. status is pending while Cosend fetches it from Meta, ready once it is stored (open it with GET /v1/media/{id} or /v1/media/{id}/content; id is null in the other two states), and failed with failure_reason saying why in plain words. kind is voice for a WhatsApp voice note. On a template message, the header’s image, video or document, when the send named a file uploaded to Cosend (caption is null). null on a message with no file Cosend keeps. |
| media.id | string | null | required | |
| media.kind | "image" | "video" | "audio" | "voice" | "document" | "sticker" | required | |
| media.mime_type | string | null | required | |
| media.size_bytes | integer | null | required | |
| media.filename | string | null | required | |
| media.caption | string | null | required | |
| media.animated | boolean | null | required | |
| media.status | "pending" | "ready" | "failed" | required | |
| media.failure_reason | string | null | required | |
| transcript | object | null | required | The words of an inbound voice note or audio file. null while Cosend transcribes it, and on every other message. ready carries text; failed says why in failure_reason; skipped means transcription is unavailable. The recording in media is the same whatever this says. |
| transcript.status | "ready" | "failed" | "skipped" | required | |
| transcript.text | string | null | required | |
| transcript.language | string | null | required | |
| transcript.model | string | null | required | |
| transcript.failure_reason | string | null | required | |
| client_token | string | null | required | |
| author_user_id | string | null | required | |
| automation_run_id | string | null | required | |
| campaign_id | string | null | required | |
| campaign_name | string | null | required | |
| error_code | integer | null | required | |
| error_title | string | null | required | |
| error_detail | string | null | required |
POST /v1/messages/{id}/read
Mark read: shows blue ticks on the contact’s phone
Scopes messages:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| ok | true | required |
POST /v1/messages/{id}/translate
Translate a message into another language (a tag such as es or pt-BR); read back from the cache after the first time. Nothing is sent
Scopes messages:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| target_language | string | required |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "message_translation" | required | |
| message_id | string | required | |
| target_language | string | required | |
| text | string | required | |
| detected_language | string | null | required | |
| cached | boolean | required |
POST /v1/messages/batch
Send up to 100 messages, with a per-item result
Scopes messages:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | required |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| messages | object[] | required | |
| messages[].connection_id | string | optional | The WhatsApp number the message goes out from. Optional with a connection key, which already names it. A contact belongs to one business and is on its numbers: a contact_id, a to of ct_… or a conversation_id may be sent to from any number of that business, which then has the contact too; from a number of another business it is refused with 409 contact_portfolio_mismatch, whose body carries contact_id and connection_id. |
| messages[].to | string | optional | |
| messages[].contact_id | string | optional | |
| messages[].conversation_id | string | optional | |
| messages[].type | "text" | "image" | "audio" | "video" | "document" | "sticker" | "location" | "contacts" | … | required | |
| messages[].text | object | optional | |
| messages[].image | object | optional | Meta's media object. id may be a Cosend media id (med_…, from POST /v1/media): Cosend uploads the file to WhatsApp and sends it by WhatsApp's id, and the message's media block then names the file. With a Cosend id, caption is allowed on image, video and document (not on audio or sticker), and filename on document only (it defaults to the uploaded name). Meta's own id or link goes to WhatsApp unchanged. |
| messages[].audio | object | optional | Meta's media object. id may be a Cosend media id (med_…, from POST /v1/media): Cosend uploads the file to WhatsApp and sends it by WhatsApp's id, and the message's media block then names the file. With a Cosend id, caption is allowed on image, video and document (not on audio or sticker), and filename on document only (it defaults to the uploaded name). Meta's own id or link goes to WhatsApp unchanged. |
| messages[].video | object | optional | Meta's media object. id may be a Cosend media id (med_…, from POST /v1/media): Cosend uploads the file to WhatsApp and sends it by WhatsApp's id, and the message's media block then names the file. With a Cosend id, caption is allowed on image, video and document (not on audio or sticker), and filename on document only (it defaults to the uploaded name). Meta's own id or link goes to WhatsApp unchanged. |
| messages[].document | object | optional | Meta's media object. id may be a Cosend media id (med_…, from POST /v1/media): Cosend uploads the file to WhatsApp and sends it by WhatsApp's id, and the message's media block then names the file. With a Cosend id, caption is allowed on image, video and document (not on audio or sticker), and filename on document only (it defaults to the uploaded name). Meta's own id or link goes to WhatsApp unchanged. |
| messages[].sticker | object | optional | Meta's media object. id may be a Cosend media id (med_…, from POST /v1/media): Cosend uploads the file to WhatsApp and sends it by WhatsApp's id, and the message's media block then names the file. With a Cosend id, caption is allowed on image, video and document (not on audio or sticker), and filename on document only (it defaults to the uploaded name). Meta's own id or link goes to WhatsApp unchanged. |
| messages[].location | object | optional | |
| messages[].contacts | object[] | optional | |
| messages[].interactive | object | optional | Meta's interactive object. Checked against WhatsApp's limits before anything is written, and refused in words naming the field: a reply-button message (type "button", up to 3 buttons), a list message (type "list"), a catalogue message (type "catalog_message": body up to 1024 characters, footer up to 60, optional action.parameters.thumbnail_product_retailer_id), a single-product message (type "product": action.product_retailer_id, optional body and footer, no header) and a multi-product message (type "product_list": a text header up to 60 characters, a body, action.sections of product_items, at most 10 sections and 30 products, a title up to 24 characters on each section when there is more than one). A product message may leave out action.catalog_id, and Cosend sends the catalogue linked to the number's WhatsApp Business account in Meta's Commerce Manager; a catalogue message, and a product message without catalog_id, are refused in words when the number has none linked. A catalog_id you give is sent as given. Like every free-form message, they go only inside the 24-hour customer service window. Any other interactive type goes to WhatsApp unchanged. |
| messages[].interactive.type | "button" | required | |
| messages[].interactive.header | object | optional | |
| messages[].interactive.body | object | required | |
| messages[].interactive.footer | object | optional | |
| messages[].interactive.action | object | required | |
| messages[].template | object | optional | Meta's template object: {"name", "language": {"code"}, "components"}. A header parameter of type image, video or document may name a file uploaded with POST /v1/media by its id ({"type": "image", "image": {"id": "med_…"}}): Cosend uploads it to Meta for this number and sends Meta's id; a link, or a media id from Meta, is sent as it is. A location parameter ({"type": "location", "location": {"latitude", "longitude", "name", "address"}}) needs a latitude from -90 to 90 and a longitude from -180 to 180, in decimal degrees; name and address are text. |
| messages[].reaction | object | optional | |
| messages[].reaction.message_id | string | required | |
| messages[].reaction.emoji | string | required | |
| messages[].reply_to | string | null | optional | |
| messages[].metadata | object | optional | |
| messages[].source | "customer" | "app" | "api" | "agent" | "automation" | "ai" | "notify" | "history" | … | optional | Who is sending. Left out, it is agent for a person (the dashboard Inbox, or an MCP client acting for one) and api for an API key. |
| messages[].send_mode | "auto" | "strict" | optional | |
| messages[].fallback_template | object | optional | |
| messages[].fallback_template.name | string | required | |
| messages[].fallback_template.language | string | required | |
| messages[].idempotency_key | string | optional | |
| skip_others_chats | boolean | optional | When true, a chat assigned to another person or that another person is replying in is not sent, and its result is 409 chat_is_someone_elses. |
Response 207
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| results | object[] | required | |
| results[].index | integer | required | |
| results[].status | integer | required | |
| results[].id | string | optional | |
| results[].error | object | optional | |
| results[].error.type | string | required | |
| results[].error.code | string | required | |
| results[].error.message | string | required |
/v1/notifications
GET /v1/notifications
List notifications
Scopes notifications:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| limit | query | integer | optional | |
| after | query | string | optional | |
| before | query | string | optional | |
| state | query | string | optional | |
| recipient | query | string | optional | |
| dedup_key | query | string | optional | |
| source_ref_id | query | string | optional | |
| contact_id | query | string | optional | |
| connection_id | query | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].object | "notification" | required | |
| data[].connection_id | string | required | |
| data[].to | string | null | required | |
| data[].state | string | required | |
| data[].priority | integer | required | |
| data[].send_mode | string | required | |
| data[].send_mode_used | string | null | required | |
| data[].template_name | string | null | required | |
| data[].template_language | string | null | required | |
| data[].dedup_key | string | null | required | |
| data[].deduplicated | boolean | required | |
| data[].scheduled_for | string (date-time) | null | required | |
| data[].expires_at | string (date-time) | null | required | |
| data[].source_ref | any | null | required | |
| data[].wamid | string | null | required | |
| data[].latest_status | string | null | required | |
| data[].suppress_reason | string | null | required | |
| data[].failure_class | string | null | required | |
| data[].error_code | integer | null | required | |
| data[].billable | boolean | null | required | |
| data[].attempts | integer | required | |
| data[].replay_of | string | null | required | |
| data[].sent_at | string (date-time) | null | required | |
| data[].delivered_at | string (date-time) | null | required | |
| data[].read_at | string (date-time) | null | required | |
| data[].created_at | string (date-time) | required | |
| has_more | boolean | required | |
| next_cursor | string | null | required |
POST /v1/notifications
Queue one notification
Scopes notifications:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | required |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| connection_id | string | required | |
| to | string | required | |
| send_mode | "auto" | "template" | "freeform" | optional | |
| template | object | optional | |
| template.name | string | required | |
| template.language | string | required | |
| template.params | object | optional | |
| fallback_body | object | optional | |
| fallback_body.type | string | required | |
| scheduled_for | string (date-time) | null | optional | |
| expires_at | string (date-time) | null | optional | |
| dedup_key | string | null | optional | |
| priority | integer | optional | |
| source_ref | object | null | optional | |
| source_ref.type | string | required | |
| source_ref.id | string | required |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "notification" | required | |
| connection_id | string | required | |
| to | string | null | required | |
| state | string | required | |
| priority | integer | required | |
| send_mode | string | required | |
| send_mode_used | string | null | required | |
| template_name | string | null | required | |
| template_language | string | null | required | |
| dedup_key | string | null | required | |
| deduplicated | boolean | required | |
| scheduled_for | string (date-time) | null | required | |
| expires_at | string (date-time) | null | required | |
| source_ref | any | null | required | |
| wamid | string | null | required | |
| latest_status | string | null | required | |
| suppress_reason | string | null | required | |
| failure_class | string | null | required | |
| error_code | integer | null | required | |
| billable | boolean | null | required | |
| attempts | integer | required | |
| replay_of | string | null | required | |
| sent_at | string (date-time) | null | required | |
| delivered_at | string (date-time) | null | required | |
| read_at | string (date-time) | null | required | |
| created_at | string (date-time) | required |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "notification" | required | |
| connection_id | string | required | |
| to | string | null | required | |
| state | string | required | |
| priority | integer | required | |
| send_mode | string | required | |
| send_mode_used | string | null | required | |
| template_name | string | null | required | |
| template_language | string | null | required | |
| dedup_key | string | null | required | |
| deduplicated | boolean | required | |
| scheduled_for | string (date-time) | null | required | |
| expires_at | string (date-time) | null | required | |
| source_ref | any | null | required | |
| wamid | string | null | required | |
| latest_status | string | null | required | |
| suppress_reason | string | null | required | |
| failure_class | string | null | required | |
| error_code | integer | null | required | |
| billable | boolean | null | required | |
| attempts | integer | required | |
| replay_of | string | null | required | |
| sent_at | string (date-time) | null | required | |
| delivered_at | string (date-time) | null | required | |
| read_at | string (date-time) | null | required | |
| created_at | string (date-time) | required |
GET /v1/notifications/{id}
One notification, with its receipt timeline
Scopes notifications:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "notification" | required | |
| connection_id | string | required | |
| to | string | null | required | |
| state | string | required | |
| priority | integer | required | |
| send_mode | string | required | |
| send_mode_used | string | null | required | |
| template_name | string | null | required | |
| template_language | string | null | required | |
| dedup_key | string | null | required | |
| deduplicated | boolean | required | |
| scheduled_for | string (date-time) | null | required | |
| expires_at | string (date-time) | null | required | |
| source_ref | any | null | required | |
| wamid | string | null | required | |
| latest_status | string | null | required | |
| suppress_reason | string | null | required | |
| failure_class | string | null | required | |
| error_code | integer | null | required | |
| billable | boolean | null | required | |
| attempts | integer | required | |
| replay_of | string | null | required | |
| sent_at | string (date-time) | null | required | |
| delivered_at | string (date-time) | null | required | |
| read_at | string (date-time) | null | required | |
| created_at | string (date-time) | required | |
| receipts | object[] | required | |
| receipts[].object | "notify_receipt" | required | |
| receipts[].status | string | required | |
| receipts[].status_at | string (date-time) | required | |
| receipts[].received_at | string (date-time) | required | |
| receipts[].pricing_billable | boolean | null | required | |
| receipts[].pricing_category | string | null | required | |
| receipts[].error_code | integer | null | required | |
| receipts[].error_title | string | null | required |
POST /v1/notifications/{id}/cancel
Cancel a scheduled or queued notification
Scopes notifications:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "notification" | required | |
| connection_id | string | required | |
| to | string | null | required | |
| state | string | required | |
| priority | integer | required | |
| send_mode | string | required | |
| send_mode_used | string | null | required | |
| template_name | string | null | required | |
| template_language | string | null | required | |
| dedup_key | string | null | required | |
| deduplicated | boolean | required | |
| scheduled_for | string (date-time) | null | required | |
| expires_at | string (date-time) | null | required | |
| source_ref | any | null | required | |
| wamid | string | null | required | |
| latest_status | string | null | required | |
| suppress_reason | string | null | required | |
| failure_class | string | null | required | |
| error_code | integer | null | required | |
| billable | boolean | null | required | |
| attempts | integer | required | |
| replay_of | string | null | required | |
| sent_at | string (date-time) | null | required | |
| delivered_at | string (date-time) | null | required | |
| read_at | string (date-time) | null | required | |
| created_at | string (date-time) | required |
POST /v1/notifications/{id}/replay
Clone a dead-lettered notification as a new attempt
Scopes notifications:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | required |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "notification" | required | |
| connection_id | string | required | |
| to | string | null | required | |
| state | string | required | |
| priority | integer | required | |
| send_mode | string | required | |
| send_mode_used | string | null | required | |
| template_name | string | null | required | |
| template_language | string | null | required | |
| dedup_key | string | null | required | |
| deduplicated | boolean | required | |
| scheduled_for | string (date-time) | null | required | |
| expires_at | string (date-time) | null | required | |
| source_ref | any | null | required | |
| wamid | string | null | required | |
| latest_status | string | null | required | |
| suppress_reason | string | null | required | |
| failure_class | string | null | required | |
| error_code | integer | null | required | |
| billable | boolean | null | required | |
| attempts | integer | required | |
| replay_of | string | null | required | |
| sent_at | string (date-time) | null | required | |
| delivered_at | string (date-time) | null | required | |
| read_at | string (date-time) | null | required | |
| created_at | string (date-time) | required |
POST /v1/notifications/batch
Queue up to 500 notifications
Scopes notifications:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | required |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| notifications | object[] | required | |
| notifications[].connection_id | string | required | |
| notifications[].to | string | required | |
| notifications[].send_mode | "auto" | "template" | "freeform" | optional | |
| notifications[].template | object | optional | |
| notifications[].template.name | string | required | |
| notifications[].template.language | string | required | |
| notifications[].template.params | object | optional | |
| notifications[].fallback_body | object | optional | |
| notifications[].fallback_body.type | string | required | |
| notifications[].scheduled_for | string (date-time) | null | optional | |
| notifications[].expires_at | string (date-time) | null | optional | |
| notifications[].dedup_key | string | null | optional | |
| notifications[].priority | integer | optional | |
| notifications[].source_ref | object | null | optional | |
| notifications[].source_ref.type | string | required | |
| notifications[].source_ref.id | string | required |
Response 207
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "batch" | required | |
| results | object[] | required | |
| results[].index | integer | required | |
| results[].status | integer | required | |
| results[].notification | object | optional | |
| results[].notification.id | string | required | |
| results[].notification.object | "notification" | required | |
| results[].notification.connection_id | string | required | |
| results[].notification.to | string | null | required | |
| results[].notification.state | string | required | |
| results[].notification.priority | integer | required | |
| results[].notification.send_mode | string | required | |
| results[].notification.send_mode_used | string | null | required | |
| results[].notification.template_name | string | null | required | |
| results[].notification.template_language | string | null | required | |
| results[].notification.dedup_key | string | null | required | |
| results[].notification.deduplicated | boolean | required | |
| results[].notification.scheduled_for | string (date-time) | null | required | |
| results[].notification.expires_at | string (date-time) | null | required | |
| results[].notification.source_ref | any | null | required | |
| results[].notification.wamid | string | null | required | |
| results[].notification.latest_status | string | null | required | |
| results[].notification.suppress_reason | string | null | required | |
| results[].notification.failure_class | string | null | required | |
| results[].notification.error_code | integer | null | required | |
| results[].notification.billable | boolean | null | required | |
| results[].notification.attempts | integer | required | |
| results[].notification.replay_of | string | null | required | |
| results[].notification.sent_at | string (date-time) | null | required | |
| results[].notification.delivered_at | string (date-time) | null | required | |
| results[].notification.read_at | string (date-time) | null | required | |
| results[].notification.created_at | string (date-time) | required | |
| results[].error | object | optional | |
| results[].error.code | string | required | |
| results[].error.message | string | required |
/v1/orders
GET /v1/orders
The orders of the workspace’s numbers: the order desk’s tabs with their counts, filters and sort by age
Scopes messages:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| connection_id | query | string | optional | Only this number’s orders. |
| conversation_id | query | string | optional | |
| contact_id | query | string | optional | |
| status | query | "draft" | "awaiting_customer" | "confirmed" | "out_for_delivery" | "delivered" | "cancelled" | "returned" | "problem" | optional | |
| payment_status | query | "unpaid" | "deposit_paid" | "paid" | "cod_collected" | "refunded" | optional | |
| view | query | "needs_ok" | "awaiting_customer" | "to_ship" | "out_for_delivery" | "delivered" | "problems" | "unconfirmed" | optional | An order desk tab: needs_ok (drafts), awaiting_customer, to_ship (confirmed), out_for_delivery, delivered, problems (problem or returned), or unconfirmed (no answer 20 hours after it was sent). |
| from | query | string (date) | optional | Made on or after this day, in the workspace’s time zone. |
| to | query | string (date) | optional | Made on or before this day, in the workspace’s time zone. |
| city | query | string | optional | The delivery city. |
| ad_id | query | string | optional | Only orders whose chat came from this Click-to-WhatsApp ad (its ad_ id). |
| sort | query | "newest" | "oldest" | optional | By age: newest first (the default) or oldest first. |
| limit | query | integer | optional | |
| after | query | string | optional | |
| before | query | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].object | "order" | required | |
| data[].number | integer | required | The order number the customer reads, per number. |
| data[].connection_id | string | required | |
| data[].contact_id | string | required | |
| data[].conversation_id | string | null | required | |
| data[].status | "draft" | "awaiting_customer" | "confirmed" | "out_for_delivery" | "delivered" | "cancelled" | "returned" | "problem" | required | |
| data[].payment_status | "unpaid" | "deposit_paid" | "paid" | "cod_collected" | "refunded" | required | |
| data[].payment_method | "cod" | "payment_link" | "bank_transfer" | null | required | |
| data[].source | "chat" | "seller" | "composer" | "location" | "api" | "mcp" | "quote" | required | |
| data[].currency | string | null | required | |
| data[].items | object[] | required | |
| data[].items[].product_id | string | null | required | |
| data[].items[].variant | string | null | required | |
| data[].items[].name | string | required | |
| data[].items[].quantity | integer | required | |
| data[].items[].unit_price | string | null | required | |
| data[].items[].tier_quantity | integer | null | required | |
| data[].items[].price_source | string | null | required | Where the price came from: product_list, seller_message:<message id>, or seller (typed by a person). Null is no price. |
| data[].items[].line_total | string | null | required | |
| data[].items[].custom | boolean | required | Not on the number’s product list. |
| data[].items[].confidence | number | null | required | |
| data[].items[].evidence | string[] | required | The messages the line was read from. |
| data[].items[].check | boolean | required | Shown with "Check": the seller should look at it. |
| data[].subtotal | string | null | required | |
| data[].discount_amount | string | null | required | What the discount of the quote this order was made from takes off its subtotal. Null on an order no quote made, or with no discount. |
| data[].tax_amount | string | null | required | The tax of the quote this order was made from, on its subtotal less the discount. Null on an order no quote made, or with no tax. |
| data[].delivery_fee | string | null | required | |
| data[].total | string | null | required | |
| data[].deposit_amount | string | null | required | |
| data[].delivery | object | required | |
| data[].delivery.address_text | string | null | required | |
| data[].delivery.city | string | null | required | |
| data[].delivery.postcode | string | null | required | |
| data[].delivery.location | object | null | required | |
| data[].delivery.recipient_name | string | null | required | |
| data[].delivery.preferred_day | string | null | required | |
| data[].delivery.delivery_date | string | null | required | |
| data[].delivery.courier | string | null | required | |
| data[].delivery.tracking_number | string | null | required | |
| data[].customer | object | required | |
| data[].customer.name | string | null | required | |
| data[].customer.phone | string | null | required | |
| data[].ad_source | object | null | required | The Click-to-WhatsApp ad the order’s chat came from, when it has one. |
| data[].ad_source.id | string | required | |
| data[].ad_source.headline | string | null | required | |
| data[].ad_source.source_url | string | null | required | |
| data[].assignee_id | string | null | required | The member the order is assigned to. |
| data[].assigned_at | string | null | required | |
| data[].notes | string | null | required | |
| data[].language | string | null | required | |
| data[].missing | string[] | required | |
| data[].checks | string[] | required | |
| data[].evidence | object | required | |
| data[].risk | object[] | required | |
| data[].risk[].code | "first_order" | "earlier_returns" | "did_not_confirm" | "address_incomplete" | "outside_delivery_zone" | required | |
| data[].risk[].text | string | required | |
| data[].unconfirmed | boolean | required | No answer 20 hours after it was sent: "Unconfirmed: don’t ship". |
| data[].payment_screenshots | object[] | required | |
| data[].payment_screenshots[].message_id | string | required | |
| data[].payment_screenshots[].amount | string | null | required | |
| data[].payment_screenshots[].currency | string | null | required | |
| data[].payment_screenshots[].reference | string | null | required | |
| data[].payment_screenshots[].date | string | null | required | |
| data[].payment_screenshots[].bank | string | null | required | |
| data[].payment_screenshots[].matches_total | boolean | required | |
| data[].change_requests | object[] | required | |
| data[].change_requests[].message_id | string | required | |
| data[].change_requests[].at | string | required | |
| data[].last_change | object | null | required | |
| data[].last_change.kind | string | required | |
| data[].last_change.actor | string | required | |
| data[].last_change.at | string | required | |
| data[].last_change.changes | object | null | required | |
| data[].expires_at | string | null | required | |
| data[].sent_at | string | null | required | |
| data[].reminded_at | string | null | required | |
| data[].unconfirmed_at | string | null | required | |
| data[].confirmed_at | string | null | required | |
| data[].delivered_at | string | null | required | |
| data[].cancelled_at | string | null | required | |
| data[].cancel_reason | "changed_mind" | "too_expensive" | "too_slow" | "ordered_elsewhere" | "other" | "expired" | "seller" | null | required | |
| data[].crm | object | null | required | |
| data[].crm.connector_account_id | string | null | required | |
| data[].crm.contact_id | string | null | required | The customer’s contact in the CRM. |
| data[].crm.deal_id | string | null | required | |
| data[].crm.deal_url | string | null | required | The deal in the CRM: the link to show. |
| data[].crm.synced_at | string | null | required | |
| data[].crm.problem | string | null | required | Why the last change was not sent to the CRM, in plain words. Null once one is. |
| data[].created_at | string | required | |
| data[].updated_at | string | required | |
| has_more | boolean | required | |
| next_cursor | string | null | required | |
| counts | object | required | How many orders each tab of the order desk holds, under the same filters but the view and the status. |
| counts.needs_ok | integer | required | |
| counts.awaiting_customer | integer | required | |
| counts.to_ship | integer | required | |
| counts.out_for_delivery | integer | required | |
| counts.delivered | integer | required | |
| counts.problems | integer | required | |
| counts.unconfirmed | integer | required |
POST /v1/orders
Write an order by hand in a chat: a draft, priced by the number’s product list
Scopes messages:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | optional |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| conversation_id | string | required | The chat the order is for: its number and its customer. |
| items | object[] | required | |
| items[].product_id | string | null | optional | A product of the chat’s number. Left out or null: a custom item. |
| items[].variant | string | null | optional | |
| items[].name | string | optional | A custom item’s name. A product’s is the list’s. |
| items[].quantity | integer | required | |
| items[].unit_price | string | null | optional | A custom item’s price, typed by the seller. A product of the list is priced by the list. |
| delivery | object | optional | |
| delivery.address_text | string | null | optional | |
| delivery.city | string | null | optional | |
| delivery.postcode | string | null | optional | |
| delivery.recipient_name | string | null | optional | |
| delivery.preferred_day | string | null | optional | |
| delivery.delivery_date | string (date) | null | optional | The arrival day. The day before it the customer is told "Out for delivery tomorrow". |
| delivery.courier | string | null | optional | Who delivers it. Set at any time, like the arrival day. |
| delivery.tracking_number | string | null | optional | The courier’s tracking number. Set at any time, like the arrival day. |
| payment_method | "cod" | "payment_link" | "bank_transfer" | null | optional | |
| notes | string | null | optional |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "order" | required | |
| number | integer | required | The order number the customer reads, per number. |
| connection_id | string | required | |
| contact_id | string | required | |
| conversation_id | string | null | required | |
| status | "draft" | "awaiting_customer" | "confirmed" | "out_for_delivery" | "delivered" | "cancelled" | "returned" | "problem" | required | |
| payment_status | "unpaid" | "deposit_paid" | "paid" | "cod_collected" | "refunded" | required | |
| payment_method | "cod" | "payment_link" | "bank_transfer" | null | required | |
| source | "chat" | "seller" | "composer" | "location" | "api" | "mcp" | "quote" | required | |
| currency | string | null | required | |
| items | object[] | required | |
| items[].product_id | string | null | required | |
| items[].variant | string | null | required | |
| items[].name | string | required | |
| items[].quantity | integer | required | |
| items[].unit_price | string | null | required | |
| items[].tier_quantity | integer | null | required | |
| items[].price_source | string | null | required | Where the price came from: product_list, seller_message:<message id>, or seller (typed by a person). Null is no price. |
| items[].line_total | string | null | required | |
| items[].custom | boolean | required | Not on the number’s product list. |
| items[].confidence | number | null | required | |
| items[].evidence | string[] | required | The messages the line was read from. |
| items[].check | boolean | required | Shown with "Check": the seller should look at it. |
| subtotal | string | null | required | |
| discount_amount | string | null | required | What the discount of the quote this order was made from takes off its subtotal. Null on an order no quote made, or with no discount. |
| tax_amount | string | null | required | The tax of the quote this order was made from, on its subtotal less the discount. Null on an order no quote made, or with no tax. |
| delivery_fee | string | null | required | |
| total | string | null | required | |
| deposit_amount | string | null | required | |
| delivery | object | required | |
| delivery.address_text | string | null | required | |
| delivery.city | string | null | required | |
| delivery.postcode | string | null | required | |
| delivery.location | object | null | required | |
| delivery.location.latitude | number | required | |
| delivery.location.longitude | number | required | |
| delivery.recipient_name | string | null | required | |
| delivery.preferred_day | string | null | required | |
| delivery.delivery_date | string | null | required | |
| delivery.courier | string | null | required | |
| delivery.tracking_number | string | null | required | |
| customer | object | required | |
| customer.name | string | null | required | |
| customer.phone | string | null | required | |
| ad_source | object | null | required | The Click-to-WhatsApp ad the order’s chat came from, when it has one. |
| ad_source.id | string | required | |
| ad_source.headline | string | null | required | |
| ad_source.source_url | string | null | required | |
| assignee_id | string | null | required | The member the order is assigned to. |
| assigned_at | string | null | required | |
| notes | string | null | required | |
| language | string | null | required | |
| missing | string[] | required | |
| checks | string[] | required | |
| evidence | object | required | |
| risk | object[] | required | |
| risk[].code | "first_order" | "earlier_returns" | "did_not_confirm" | "address_incomplete" | "outside_delivery_zone" | required | |
| risk[].text | string | required | |
| unconfirmed | boolean | required | No answer 20 hours after it was sent: "Unconfirmed: don’t ship". |
| payment_screenshots | object[] | required | |
| payment_screenshots[].message_id | string | required | |
| payment_screenshots[].amount | string | null | required | |
| payment_screenshots[].currency | string | null | required | |
| payment_screenshots[].reference | string | null | required | |
| payment_screenshots[].date | string | null | required | |
| payment_screenshots[].bank | string | null | required | |
| payment_screenshots[].matches_total | boolean | required | |
| change_requests | object[] | required | |
| change_requests[].message_id | string | required | |
| change_requests[].at | string | required | |
| last_change | object | null | required | |
| last_change.kind | string | required | |
| last_change.actor | string | required | |
| last_change.at | string | required | |
| last_change.changes | object | null | required | |
| expires_at | string | null | required | |
| sent_at | string | null | required | |
| reminded_at | string | null | required | |
| unconfirmed_at | string | null | required | |
| confirmed_at | string | null | required | |
| delivered_at | string | null | required | |
| cancelled_at | string | null | required | |
| cancel_reason | "changed_mind" | "too_expensive" | "too_slow" | "ordered_elsewhere" | "other" | "expired" | "seller" | null | required | |
| crm | object | null | required | |
| crm.connector_account_id | string | null | required | |
| crm.contact_id | string | null | required | The customer’s contact in the CRM. |
| crm.deal_id | string | null | required | |
| crm.deal_url | string | null | required | The deal in the CRM: the link to show. |
| crm.synced_at | string | null | required | |
| crm.problem | string | null | required | Why the last change was not sent to the CRM, in plain words. Null once one is. |
| created_at | string | required | |
| updated_at | string | required |
GET /v1/orders/{id}
One order: its lines, delivery, payment, risk notes and every change made to it
Scopes messages:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "order" | required | |
| number | integer | required | The order number the customer reads, per number. |
| connection_id | string | required | |
| contact_id | string | required | |
| conversation_id | string | null | required | |
| status | "draft" | "awaiting_customer" | "confirmed" | "out_for_delivery" | "delivered" | "cancelled" | "returned" | "problem" | required | |
| payment_status | "unpaid" | "deposit_paid" | "paid" | "cod_collected" | "refunded" | required | |
| payment_method | "cod" | "payment_link" | "bank_transfer" | null | required | |
| source | "chat" | "seller" | "composer" | "location" | "api" | "mcp" | "quote" | required | |
| currency | string | null | required | |
| items | object[] | required | |
| items[].product_id | string | null | required | |
| items[].variant | string | null | required | |
| items[].name | string | required | |
| items[].quantity | integer | required | |
| items[].unit_price | string | null | required | |
| items[].tier_quantity | integer | null | required | |
| items[].price_source | string | null | required | Where the price came from: product_list, seller_message:<message id>, or seller (typed by a person). Null is no price. |
| items[].line_total | string | null | required | |
| items[].custom | boolean | required | Not on the number’s product list. |
| items[].confidence | number | null | required | |
| items[].evidence | string[] | required | The messages the line was read from. |
| items[].check | boolean | required | Shown with "Check": the seller should look at it. |
| subtotal | string | null | required | |
| discount_amount | string | null | required | What the discount of the quote this order was made from takes off its subtotal. Null on an order no quote made, or with no discount. |
| tax_amount | string | null | required | The tax of the quote this order was made from, on its subtotal less the discount. Null on an order no quote made, or with no tax. |
| delivery_fee | string | null | required | |
| total | string | null | required | |
| deposit_amount | string | null | required | |
| delivery | object | required | |
| delivery.address_text | string | null | required | |
| delivery.city | string | null | required | |
| delivery.postcode | string | null | required | |
| delivery.location | object | null | required | |
| delivery.location.latitude | number | required | |
| delivery.location.longitude | number | required | |
| delivery.recipient_name | string | null | required | |
| delivery.preferred_day | string | null | required | |
| delivery.delivery_date | string | null | required | |
| delivery.courier | string | null | required | |
| delivery.tracking_number | string | null | required | |
| customer | object | required | |
| customer.name | string | null | required | |
| customer.phone | string | null | required | |
| ad_source | object | null | required | The Click-to-WhatsApp ad the order’s chat came from, when it has one. |
| ad_source.id | string | required | |
| ad_source.headline | string | null | required | |
| ad_source.source_url | string | null | required | |
| assignee_id | string | null | required | The member the order is assigned to. |
| assigned_at | string | null | required | |
| notes | string | null | required | |
| language | string | null | required | |
| missing | string[] | required | |
| checks | string[] | required | |
| evidence | object | required | |
| risk | object[] | required | |
| risk[].code | "first_order" | "earlier_returns" | "did_not_confirm" | "address_incomplete" | "outside_delivery_zone" | required | |
| risk[].text | string | required | |
| unconfirmed | boolean | required | No answer 20 hours after it was sent: "Unconfirmed: don’t ship". |
| payment_screenshots | object[] | required | |
| payment_screenshots[].message_id | string | required | |
| payment_screenshots[].amount | string | null | required | |
| payment_screenshots[].currency | string | null | required | |
| payment_screenshots[].reference | string | null | required | |
| payment_screenshots[].date | string | null | required | |
| payment_screenshots[].bank | string | null | required | |
| payment_screenshots[].matches_total | boolean | required | |
| change_requests | object[] | required | |
| change_requests[].message_id | string | required | |
| change_requests[].at | string | required | |
| last_change | object | null | required | |
| last_change.kind | string | required | |
| last_change.actor | string | required | |
| last_change.at | string | required | |
| last_change.changes | object | null | required | |
| expires_at | string | null | required | |
| sent_at | string | null | required | |
| reminded_at | string | null | required | |
| unconfirmed_at | string | null | required | |
| confirmed_at | string | null | required | |
| delivered_at | string | null | required | |
| cancelled_at | string | null | required | |
| cancel_reason | "changed_mind" | "too_expensive" | "too_slow" | "ordered_elsewhere" | "other" | "expired" | "seller" | null | required | |
| crm | object | null | required | |
| crm.connector_account_id | string | null | required | |
| crm.contact_id | string | null | required | The customer’s contact in the CRM. |
| crm.deal_id | string | null | required | |
| crm.deal_url | string | null | required | The deal in the CRM: the link to show. |
| crm.synced_at | string | null | required | |
| crm.problem | string | null | required | Why the last change was not sent to the CRM, in plain words. Null once one is. |
| created_at | string | required | |
| updated_at | string | required | |
| events | object[] | required | |
| events[].kind | string | required | |
| events[].actor | "customer" | "seller" | "ai" | "system" | "api" | required | |
| events[].user_id | string | null | required | |
| events[].from_status | string | null | required | |
| events[].to_status | string | null | required | |
| events[].from_payment | string | null | required | |
| events[].to_payment | string | null | required | |
| events[].message_id | string | null | required | |
| events[].tap | string | null | required | |
| events[].changes | object | null | required | |
| events[].at | string | required | |
| timeline | object[] | required | |
| timeline[].kind | string | required | |
| timeline[].actor | "customer" | "seller" | "ai" | "system" | "api" | required | |
| timeline[].user_id | string | null | required | |
| timeline[].from_status | string | null | required | |
| timeline[].to_status | string | null | required | |
| timeline[].from_payment | string | null | required | |
| timeline[].to_payment | string | null | required | |
| timeline[].message_id | string | null | required | |
| timeline[].tap | string | null | required | |
| timeline[].changes | object | null | required | |
| timeline[].at | string | required | |
| timeline[].source | "ai" | "seller" | "customer" | "automation" | "provider" | required | |
| customer_record | object | required | |
| customer_record.contact_id | string | required | |
| customer_record.name | string | null | required | |
| customer_record.phone | string | null | required | |
| customer_record.saved_addresses | object[] | required | |
| customer_record.saved_addresses[].address_text | string | null | required | |
| customer_record.saved_addresses[].city | string | null | required | |
| customer_record.saved_addresses[].postcode | string | null | required | |
| customer_record.saved_addresses[].recipient_name | string | null | required | |
| customer_record.earlier_orders | object[] | required | |
| customer_record.earlier_orders[].id | string | required | |
| customer_record.earlier_orders[].number | integer | required | |
| customer_record.earlier_orders[].status | "draft" | "awaiting_customer" | "confirmed" | "out_for_delivery" | "delivered" | "cancelled" | "returned" | "problem" | required | |
| customer_record.earlier_orders[].total | string | null | required | |
| customer_record.earlier_orders[].currency | string | null | required | |
| customer_record.earlier_orders[].created_at | string | required | |
| customer_record.returns | integer | required | |
| customer_record.total_spent | string | null | required | What the customer’s delivered orders came to, in this order’s currency. |
| customer_record.tags | string[] | required | |
| customer_record.notes | object[] | required | |
| customer_record.notes[].id | string | required | |
| customer_record.notes[].body | string | required | |
| customer_record.notes[].created_at | string | required | |
| customer_record.chat_url | string | null | required | |
| map_url | string | null | required | The delivery place on a map. |
| payment | object | required | |
| payment.method | "cod" | "payment_link" | "bank_transfer" | null | required | |
| payment.status | "unpaid" | "deposit_paid" | "paid" | "cod_collected" | "refunded" | required | |
| payment.link | object | null | required | The newest payment link sent for the order, and whether it was paid. |
| payment.link.url | string | required | |
| payment.link.kind | "full" | "deposit" | required | |
| payment.link.amount | string | null | required | |
| payment.link.status | "sent" | "paid" | required | |
| payment.link.sent_at | string | required | |
| payment.provider_reference | string | null | required | The payment provider’s own id for the payment that paid the order. |
PATCH /v1/orders/{id}
Change an order, its status or its payment. awaiting_customer sends it to the customer to confirm
Scopes messages:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | optional |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| status | "draft" | "awaiting_customer" | "confirmed" | "out_for_delivery" | "delivered" | "cancelled" | "returned" | "problem" | optional | awaiting_customer sends the order to the customer for their Confirm tap. The other statuses are recorded as they are set. |
| payment_status | "unpaid" | "deposit_paid" | "paid" | "cod_collected" | "refunded" | optional | Set by the seller. A payment screenshot alone does not mark it paid. |
| payment_method | "cod" | "payment_link" | "bank_transfer" | null | optional | |
| items | object[] | optional | |
| items[].product_id | string | null | optional | A product of the chat’s number. Left out or null: a custom item. |
| items[].variant | string | null | optional | |
| items[].name | string | optional | A custom item’s name. A product’s is the list’s. |
| items[].quantity | integer | required | |
| items[].unit_price | string | null | optional | A custom item’s price, typed by the seller. A product of the list is priced by the list. |
| delivery | object | optional | |
| delivery.address_text | string | null | optional | |
| delivery.city | string | null | optional | |
| delivery.postcode | string | null | optional | |
| delivery.recipient_name | string | null | optional | |
| delivery.preferred_day | string | null | optional | |
| delivery.delivery_date | string (date) | null | optional | The arrival day. The day before it the customer is told "Out for delivery tomorrow". |
| delivery.courier | string | null | optional | Who delivers it. Set at any time, like the arrival day. |
| delivery.tracking_number | string | null | optional | The courier’s tracking number. Set at any time, like the arrival day. |
| notes | string | null | optional | |
| cancel_reason | "changed_mind" | "too_expensive" | "too_slow" | "ordered_elsewhere" | "other" | "expired" | "seller" | null | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "order" | required | |
| number | integer | required | The order number the customer reads, per number. |
| connection_id | string | required | |
| contact_id | string | required | |
| conversation_id | string | null | required | |
| status | "draft" | "awaiting_customer" | "confirmed" | "out_for_delivery" | "delivered" | "cancelled" | "returned" | "problem" | required | |
| payment_status | "unpaid" | "deposit_paid" | "paid" | "cod_collected" | "refunded" | required | |
| payment_method | "cod" | "payment_link" | "bank_transfer" | null | required | |
| source | "chat" | "seller" | "composer" | "location" | "api" | "mcp" | "quote" | required | |
| currency | string | null | required | |
| items | object[] | required | |
| items[].product_id | string | null | required | |
| items[].variant | string | null | required | |
| items[].name | string | required | |
| items[].quantity | integer | required | |
| items[].unit_price | string | null | required | |
| items[].tier_quantity | integer | null | required | |
| items[].price_source | string | null | required | Where the price came from: product_list, seller_message:<message id>, or seller (typed by a person). Null is no price. |
| items[].line_total | string | null | required | |
| items[].custom | boolean | required | Not on the number’s product list. |
| items[].confidence | number | null | required | |
| items[].evidence | string[] | required | The messages the line was read from. |
| items[].check | boolean | required | Shown with "Check": the seller should look at it. |
| subtotal | string | null | required | |
| discount_amount | string | null | required | What the discount of the quote this order was made from takes off its subtotal. Null on an order no quote made, or with no discount. |
| tax_amount | string | null | required | The tax of the quote this order was made from, on its subtotal less the discount. Null on an order no quote made, or with no tax. |
| delivery_fee | string | null | required | |
| total | string | null | required | |
| deposit_amount | string | null | required | |
| delivery | object | required | |
| delivery.address_text | string | null | required | |
| delivery.city | string | null | required | |
| delivery.postcode | string | null | required | |
| delivery.location | object | null | required | |
| delivery.location.latitude | number | required | |
| delivery.location.longitude | number | required | |
| delivery.recipient_name | string | null | required | |
| delivery.preferred_day | string | null | required | |
| delivery.delivery_date | string | null | required | |
| delivery.courier | string | null | required | |
| delivery.tracking_number | string | null | required | |
| customer | object | required | |
| customer.name | string | null | required | |
| customer.phone | string | null | required | |
| ad_source | object | null | required | The Click-to-WhatsApp ad the order’s chat came from, when it has one. |
| ad_source.id | string | required | |
| ad_source.headline | string | null | required | |
| ad_source.source_url | string | null | required | |
| assignee_id | string | null | required | The member the order is assigned to. |
| assigned_at | string | null | required | |
| notes | string | null | required | |
| language | string | null | required | |
| missing | string[] | required | |
| checks | string[] | required | |
| evidence | object | required | |
| risk | object[] | required | |
| risk[].code | "first_order" | "earlier_returns" | "did_not_confirm" | "address_incomplete" | "outside_delivery_zone" | required | |
| risk[].text | string | required | |
| unconfirmed | boolean | required | No answer 20 hours after it was sent: "Unconfirmed: don’t ship". |
| payment_screenshots | object[] | required | |
| payment_screenshots[].message_id | string | required | |
| payment_screenshots[].amount | string | null | required | |
| payment_screenshots[].currency | string | null | required | |
| payment_screenshots[].reference | string | null | required | |
| payment_screenshots[].date | string | null | required | |
| payment_screenshots[].bank | string | null | required | |
| payment_screenshots[].matches_total | boolean | required | |
| change_requests | object[] | required | |
| change_requests[].message_id | string | required | |
| change_requests[].at | string | required | |
| last_change | object | null | required | |
| last_change.kind | string | required | |
| last_change.actor | string | required | |
| last_change.at | string | required | |
| last_change.changes | object | null | required | |
| expires_at | string | null | required | |
| sent_at | string | null | required | |
| reminded_at | string | null | required | |
| unconfirmed_at | string | null | required | |
| confirmed_at | string | null | required | |
| delivered_at | string | null | required | |
| cancelled_at | string | null | required | |
| cancel_reason | "changed_mind" | "too_expensive" | "too_slow" | "ordered_elsewhere" | "other" | "expired" | "seller" | null | required | |
| crm | object | null | required | |
| crm.connector_account_id | string | null | required | |
| crm.contact_id | string | null | required | The customer’s contact in the CRM. |
| crm.deal_id | string | null | required | |
| crm.deal_url | string | null | required | The deal in the CRM: the link to show. |
| crm.synced_at | string | null | required | |
| crm.problem | string | null | required | Why the last change was not sent to the CRM, in plain words. Null once one is. |
| created_at | string | required | |
| updated_at | string | required |
POST /v1/orders/bulk
One action on up to 100 orders (mark out for delivery, assign, the courier CSV or the packing slips), with a result per order
Scopes messages:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| ids | string[] | required | The orders, by ord_ id. |
| action | "out_for_delivery" | "assign" | "export_csv" | "packing_slips" | required | |
| assignee_id | string | null | optional | For assign: a member’s usr_ id, or null to take the assignee off. |
Response 207
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "order_bulk" | required | |
| action | "out_for_delivery" | "assign" | "export_csv" | "packing_slips" | required | |
| results | object[] | required | |
| results[].id | string | required | |
| results[].ok | boolean | required | |
| results[].code | string | optional | |
| results[].message | string | optional | |
| results[].message_sent | boolean | optional | For out_for_delivery: the customer was sent the message. Outside the chat’s 24-hour window it is not sent. |
| file | object | null | required | |
| file.name | string | required | |
| file.content_type | string | required | |
| file.url | string | required | |
| file.expires_at | string | required |
/v1/organizations
GET /v1/organizations
The workspaces this user belongs to, for a workspace switcher
Scopes any credential
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].object | "organization" | required | |
| data[].name | string | required | |
| data[].slug | string | required | |
| data[].timezone | string | required | |
| data[].country | string | null | required | |
| data[].role | "owner" | "admin" | "member" | "support" | required | |
| data[].status | "active" | "invited" | required | |
| data[].attention | object | null | required | |
| data[].attention.approvals_pending | integer | required | |
| data[].support_ends_at | string (date-time) | null | required |
POST /v1/organizations
Create a workspace; the caller becomes its owner
Scopes any credential
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | required |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "organization" | required | |
| name | string | required | |
| slug | string | required | |
| timezone | string | required | |
| country | string | null | required | |
| role | "owner" | "admin" | "member" | required | |
| status | "active" | "invited" | required |
PATCH /v1/organizations/{id}
Rename a workspace (owner), or change its time zone or product currency (owner or admin)
Scopes any credential
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | optional | |
| timezone | string | optional | |
| currency | string | optional | The currency for products that have none of their own, as ISO 4217. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "organization" | required | |
| name | string | required | |
| timezone | string | required | |
| currency | string | null | required |
/v1/products
GET /v1/products
The products of the workspace’s numbers, by number, words and whether they are on
Scopes messages:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| connection_id | query | string | optional | Only this number’s products. |
| q | query | string | optional | Products whose name, SKU or a tag has a word starting with each word given. |
| active | query | "true" | "false" | optional | |
| limit | query | integer | optional | |
| after | query | string | optional | |
| before | query | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].object | "product" | required | |
| data[].connection_id | string | required | |
| data[].name | string | required | |
| data[].photos | object[] | required | |
| data[].photos[].media_id | string | required | |
| data[].photos[].mime_type | string | required | |
| data[].photos[].filename | string | null | required | |
| data[].variants | object[] | required | |
| data[].variants[].name | string | required | |
| data[].variants[].price | string | required | |
| data[].variants[].sku | string | null | required | |
| data[].price_tiers | object[] | required | |
| data[].price_tiers[].quantity | integer | required | |
| data[].price_tiers[].price | string | required | |
| data[].currency | string | null | required | The product’s own currency; null when it uses the workspace’s. |
| data[].effective_currency | string | null | required | The currency its prices are in: its own, or the workspace’s. Null when neither is set. |
| data[].short_description | string | null | required | |
| data[].details | string | null | required | |
| data[].stock | "in_stock" | "low" | "out_of_stock" | required | |
| data[].stock_count | integer | null | required | |
| data[].delivery_note | string | null | required | |
| data[].tags | string[] | required | |
| data[].sku | string | null | required | |
| data[].active | boolean | required | |
| data[].answers | object[] | required | |
| data[].answers[].question | string | required | |
| data[].answers[].answer | string | required | |
| data[].created_at | string (date-time) | required | |
| data[].updated_at | string (date-time) | required | |
| has_more | boolean | required | |
| next_cursor | string | null | required |
POST /v1/products
Add a product to a number: name, photos, variants, price tiers, stock and answers
Scopes messages:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | optional |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| connection_id | string | optional | The number the product belongs to. Optional with an API key made for one number, which already names it. |
| name | string | required | |
| photos | string[] | optional | Up to 10 photos, by the id POST /v1/media gave each (image/jpeg or image/png, uploaded on the product’s number). The first is the cover. Written whole: the list replaces the one before. |
| variants | object[] | optional | Sizes, flavours or colours, each with its own price and SKU. Written whole. |
| variants[].name | string | required | |
| variants[].price | string | required | |
| variants[].sku | string | null | optional | |
| price_tiers | object[] | optional | The price of a quantity, e.g. 1 for 590 and 3 for 1500. Each quantity once. Written whole. |
| price_tiers[].quantity | integer | required | |
| price_tiers[].price | string | required | |
| currency | string | null | optional | ISO 4217. Null uses the workspace’s currency (PATCH /v1/organizations/{id}). |
| short_description | string | null | optional | 1 to 3 lines, shown on the product card. |
| details | string | null | optional | |
| stock | "in_stock" | "low" | "out_of_stock" | optional | |
| stock_count | integer | null | optional | |
| delivery_note | string | null | optional | |
| tags | string[] | optional | |
| sku | string | null | optional | |
| active | boolean | optional | |
| answers | object[] | optional | Questions and the answers the business approved. Only these are ever sent automatically. Written whole. |
| answers[].question | string | required | |
| answers[].answer | string | required |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "product" | required | |
| connection_id | string | required | |
| name | string | required | |
| photos | object[] | required | |
| photos[].media_id | string | required | |
| photos[].mime_type | string | required | |
| photos[].filename | string | null | required | |
| variants | object[] | required | |
| variants[].name | string | required | |
| variants[].price | string | required | |
| variants[].sku | string | null | required | |
| price_tiers | object[] | required | |
| price_tiers[].quantity | integer | required | |
| price_tiers[].price | string | required | |
| currency | string | null | required | The product’s own currency; null when it uses the workspace’s. |
| effective_currency | string | null | required | The currency its prices are in: its own, or the workspace’s. Null when neither is set. |
| short_description | string | null | required | |
| details | string | null | required | |
| stock | "in_stock" | "low" | "out_of_stock" | required | |
| stock_count | integer | null | required | |
| delivery_note | string | null | required | |
| tags | string[] | required | |
| sku | string | null | required | |
| active | boolean | required | |
| answers | object[] | required | |
| answers[].question | string | required | |
| answers[].answer | string | required | |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required |
GET /v1/products/{id}
One product, with its photos, variants, price tiers and approved answers
Scopes messages:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "product" | required | |
| connection_id | string | required | |
| name | string | required | |
| photos | object[] | required | |
| photos[].media_id | string | required | |
| photos[].mime_type | string | required | |
| photos[].filename | string | null | required | |
| variants | object[] | required | |
| variants[].name | string | required | |
| variants[].price | string | required | |
| variants[].sku | string | null | required | |
| price_tiers | object[] | required | |
| price_tiers[].quantity | integer | required | |
| price_tiers[].price | string | required | |
| currency | string | null | required | The product’s own currency; null when it uses the workspace’s. |
| effective_currency | string | null | required | The currency its prices are in: its own, or the workspace’s. Null when neither is set. |
| short_description | string | null | required | |
| details | string | null | required | |
| stock | "in_stock" | "low" | "out_of_stock" | required | |
| stock_count | integer | null | required | |
| delivery_note | string | null | required | |
| tags | string[] | required | |
| sku | string | null | required | |
| active | boolean | required | |
| answers | object[] | required | |
| answers[].question | string | required | |
| answers[].answer | string | required | |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required |
PATCH /v1/products/{id}
Change a product; each list given replaces the one before, in the order given
Scopes messages:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | optional |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | optional | |
| photos | string[] | optional | Up to 10 photos, by the id POST /v1/media gave each (image/jpeg or image/png, uploaded on the product’s number). The first is the cover. Written whole: the list replaces the one before. |
| variants | object[] | optional | Sizes, flavours or colours, each with its own price and SKU. Written whole. |
| variants[].name | string | required | |
| variants[].price | string | required | |
| variants[].sku | string | null | optional | |
| price_tiers | object[] | optional | The price of a quantity, e.g. 1 for 590 and 3 for 1500. Each quantity once. Written whole. |
| price_tiers[].quantity | integer | required | |
| price_tiers[].price | string | required | |
| currency | string | null | optional | ISO 4217. Null uses the workspace’s currency (PATCH /v1/organizations/{id}). |
| short_description | string | null | optional | 1 to 3 lines, shown on the product card. |
| details | string | null | optional | |
| stock | "in_stock" | "low" | "out_of_stock" | optional | |
| stock_count | integer | null | optional | |
| delivery_note | string | null | optional | |
| tags | string[] | optional | |
| sku | string | null | optional | |
| active | boolean | optional | |
| answers | object[] | optional | Questions and the answers the business approved. Only these are ever sent automatically. Written whole. |
| answers[].question | string | required | |
| answers[].answer | string | required |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "product" | required | |
| connection_id | string | required | |
| name | string | required | |
| photos | object[] | required | |
| photos[].media_id | string | required | |
| photos[].mime_type | string | required | |
| photos[].filename | string | null | required | |
| variants | object[] | required | |
| variants[].name | string | required | |
| variants[].price | string | required | |
| variants[].sku | string | null | required | |
| price_tiers | object[] | required | |
| price_tiers[].quantity | integer | required | |
| price_tiers[].price | string | required | |
| currency | string | null | required | The product’s own currency; null when it uses the workspace’s. |
| effective_currency | string | null | required | The currency its prices are in: its own, or the workspace’s. Null when neither is set. |
| short_description | string | null | required | |
| details | string | null | required | |
| stock | "in_stock" | "low" | "out_of_stock" | required | |
| stock_count | integer | null | required | |
| delivery_note | string | null | required | |
| tags | string[] | required | |
| sku | string | null | required | |
| active | boolean | required | |
| answers | object[] | required | |
| answers[].question | string | required | |
| answers[].answer | string | required | |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required |
DELETE /v1/products/{id}
Delete a product with its lists; its photos stay files of the number
Scopes messages:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "product" | required | |
| deleted | true | required |
POST /v1/products/{id}/copy
Copy a product to another number of the workspace, with its variants, tiers, photos and answers
Scopes messages:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | optional |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| connection_id | string | required | Another number of this workspace. Everything is copied: variants, tiers, photos and answers. |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "product" | required | |
| connection_id | string | required | |
| name | string | required | |
| photos | object[] | required | |
| photos[].media_id | string | required | |
| photos[].mime_type | string | required | |
| photos[].filename | string | null | required | |
| variants | object[] | required | |
| variants[].name | string | required | |
| variants[].price | string | required | |
| variants[].sku | string | null | required | |
| price_tiers | object[] | required | |
| price_tiers[].quantity | integer | required | |
| price_tiers[].price | string | required | |
| currency | string | null | required | The product’s own currency; null when it uses the workspace’s. |
| effective_currency | string | null | required | The currency its prices are in: its own, or the workspace’s. Null when neither is set. |
| short_description | string | null | required | |
| details | string | null | required | |
| stock | "in_stock" | "low" | "out_of_stock" | required | |
| stock_count | integer | null | required | |
| delivery_note | string | null | required | |
| tags | string[] | required | |
| sku | string | null | required | |
| active | boolean | required | |
| answers | object[] | required | |
| answers[].question | string | required | |
| answers[].answer | string | required | |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required |
POST /v1/products/{id}/send
Send a product card into a chat: its cover, name, short description, prices and buttons
Scopes messages:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | required |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| conversation_id | string | required | |
| source | "customer" | "app" | "api" | "agent" | "automation" | "ai" | "notify" | "history" | … | optional | Who is sending. Left out, it is agent for a person (the dashboard Inbox, or an MCP client acting for one) and api for an API key. |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "message" | required | |
| conversation_id | string | required | |
| contact_id | string | required | |
| contact | object | required | |
| contact.id | string | required | |
| contact.bsuid | string | null | required | |
| contact.phone | string | null | required | |
| contact.username | string | null | required | |
| contact.name | string | required | |
| connection_id | string | required | |
| wamid | string | null | required | |
| direction | "inbound" | "outbound" | required | |
| source | "customer" | "app" | "api" | "agent" | "automation" | "ai" | "notify" | "history" | … | required | |
| status | "queued" | "sending" | "sent" | "delivered" | "read" | "played" | "failed" | "deleted" | … | required | |
| type | string | required | |
| content | object | required | |
| location | object | null | required | |
| location.latitude | number | required | |
| location.longitude | number | required | |
| location.name | string | null | required | |
| location.address | string | null | required | |
| location.url | string | null | required | |
| contact_cards | object[] | null | required | |
| contact_cards[].name | string | null | required | |
| contact_cards[].phones | object[] | required | |
| contact_cards[].phones[].phone | string | null | required | |
| contact_cards[].phones[].wa_id | string | null | required | |
| contact_cards[].phones[].type | string | null | required | |
| contact_cards[].emails | object[] | required | |
| contact_cards[].emails[].email | string | required | |
| contact_cards[].emails[].type | string | null | required | |
| contact_cards[].org | object | null | required | |
| contact_cards[].org.company | string | null | required | |
| contact_cards[].org.department | string | null | required | |
| contact_cards[].org.title | string | null | required | |
| label | string | null | required | |
| forwarded | boolean | required | |
| frequently_forwarded | boolean | required | |
| tap | object | null | required | |
| tap.kind | "button_reply" | "list_reply" | "button" | required | |
| tap.id | string | required | |
| tap.title | string | required | |
| tap.description | string | null | required | |
| template_text | object | null | required | The words a template message showed the customer: the header and body with the values the send filled in, the footer, and the button labels. Rendered from the template Cosend holds and the values the send used. An authentication template never shows its one-time code: the placeholder stays as written. When Cosend no longer holds the template, body is the text stored when it was sent and the rest is empty. null on every other message, on a template Cosend has no words for, and on a direct-mode connection. |
| template_text.header | string | null | required | |
| template_text.body | string | null | required | |
| template_text.footer | string | null | required | |
| template_text.buttons | string[] | required | |
| reply_to | object | null | required | |
| reply_to.id | string | null | required | |
| reply_to.wamid | string | required | |
| reply_to.kind | string | null | required | |
| reply_to.from | "contact" | "business" | null | required | |
| reply_to.preview | string | required | |
| reactions | object[] | required | |
| reactions[].emoji | string | required | |
| reactions[].direction | "inbound" | "outbound" | required | |
| reactions[].message_id | string | required | |
| reactions[].created_at | string (date-time) | required | |
| metadata | object | required | |
| created_at | string (date-time) | required | |
| wa_timestamp | string (date-time) | required | |
| is_imported | boolean | required | |
| media_state | "none" | "pending" | "stored" | "expired" | "unavailable" | required | |
| media_expires_at | string (date-time) | null | required | |
| media | object | null | required | The file this message carries. status is pending while Cosend fetches it from Meta, ready once it is stored (open it with GET /v1/media/{id} or /v1/media/{id}/content; id is null in the other two states), and failed with failure_reason saying why in plain words. kind is voice for a WhatsApp voice note. On a template message, the header’s image, video or document, when the send named a file uploaded to Cosend (caption is null). null on a message with no file Cosend keeps. |
| media.id | string | null | required | |
| media.kind | "image" | "video" | "audio" | "voice" | "document" | "sticker" | required | |
| media.mime_type | string | null | required | |
| media.size_bytes | integer | null | required | |
| media.filename | string | null | required | |
| media.caption | string | null | required | |
| media.animated | boolean | null | required | |
| media.status | "pending" | "ready" | "failed" | required | |
| media.failure_reason | string | null | required | |
| transcript | object | null | required | The words of an inbound voice note or audio file. null while Cosend transcribes it, and on every other message. ready carries text; failed says why in failure_reason; skipped means transcription is unavailable. The recording in media is the same whatever this says. |
| transcript.status | "ready" | "failed" | "skipped" | required | |
| transcript.text | string | null | required | |
| transcript.language | string | null | required | |
| transcript.model | string | null | required | |
| transcript.failure_reason | string | null | required | |
| client_token | string | null | required | |
| author_user_id | string | null | required | |
| automation_run_id | string | null | required | |
| campaign_id | string | null | required | |
| campaign_name | string | null | required | |
| error_code | integer | null | required | |
| error_title | string | null | required | |
| error_detail | string | null | required |
Errors service_window_closed
/v1/quotes
GET /v1/quotes
The quotes of the workspace’s numbers, newest first, by number, chat, customer and status
Scopes messages:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| connection_id | query | string | optional | Only this number’s quotes. |
| conversation_id | query | string | optional | |
| contact_id | query | string | optional | |
| status | query | "draft" | "sent" | "accepted" | "declined" | "expired" | optional | |
| follow_up | query | "due" | optional | due: the sent quotes to follow up today (day 2 or day 5 with no answer). |
| limit | query | integer | optional | |
| after | query | string | optional | |
| before | query | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].object | "quote" | required | |
| data[].number | string | required | The quote number the customer reads: Q, the year and the workspace’s count in that year. |
| data[].connection_id | string | required | |
| data[].contact_id | string | required | |
| data[].conversation_id | string | null | required | |
| data[].status | "draft" | "sent" | "accepted" | "declined" | "expired" | required | |
| data[].currency | string | null | required | |
| data[].items | object[] | required | |
| data[].items[].product_id | string | null | required | |
| data[].items[].variant | string | null | required | |
| data[].items[].name | string | required | |
| data[].items[].quantity | integer | required | |
| data[].items[].unit_price | string | null | required | |
| data[].items[].tier_quantity | integer | null | required | |
| data[].items[].price_source | "product_list" | "seller" | null | required | Where the price came from: product_list, or seller (a custom line, typed by a person). Null is no price. |
| data[].items[].line_total | string | null | required | |
| data[].items[].custom | boolean | required | Not on the number’s product list. |
| data[].items[].check | boolean | required | Shown with "Check": the line has no price. |
| data[].subtotal | string | null | required | |
| data[].discount | object | null | required | |
| data[].discount.kind | "amount" | required | |
| data[].discount.value | string | required | |
| data[].discount_amount | string | null | required | |
| data[].tax_rate | string | null | required | |
| data[].tax_amount | string | null | required | |
| data[].total | string | null | required | |
| data[].deposit | object | null | required | |
| data[].deposit.kind | "amount" | required | |
| data[].deposit.value | string | required | |
| data[].deposit_amount | string | null | required | |
| data[].valid_until | string | null | required | |
| data[].terms | string | null | required | |
| data[].notes | string | null | required | |
| data[].language | string | null | required | |
| data[].answers | object[] | required | |
| data[].answers[].key | string | required | |
| data[].answers[].label | string | required | |
| data[].answers[].value | string | null | required | |
| data[].answers[].confidence | number | null | required | |
| data[].answers[].evidence | string[] | required | The messages the answer was read from: the customer said it there. |
| data[].answers[].by | "ai" | "seller" | required | |
| data[].answers[].check | boolean | required | The AI was unsure: shown with "Check". |
| data[].missing | string[] | required | The keys of the questions with no answer. |
| data[].suggested_question | string | null | required | One question asking every missing answer, for the seller to send. |
| data[].order_id | string | null | required | The order an accepted quote became. |
| data[].pdf_media_id | string | null | required | The PDF the customer was sent. |
| data[].follow_up | object | null | required | Day 2 or day 5 with no word from the customer: follow up today. |
| data[].follow_up.day | 2 | 5 | required | |
| data[].follow_up.due_at | string | required | |
| data[].sent_at | string | null | required | |
| data[].accepted_at | string | null | required | |
| data[].declined_at | string | null | required | |
| data[].decline_reason | "too_expensive" | "not_needed" | "found_another" | "other" | null | required | |
| data[].expired_at | string | null | required | |
| data[].created_at | string | required | |
| data[].updated_at | string | required | |
| has_more | boolean | required | |
| next_cursor | string | null | required |
POST /v1/quotes
Build a quote in a chat: lines from the number’s products and custom lines, a draft
Scopes messages:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | optional |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| conversation_id | string | required | The chat the quote is for: its number and its customer. |
| items | object[] | required | |
| items[].product_id | string | null | optional | A product of the chat’s number, priced by its list. Left out or null: a custom line. |
| items[].variant | string | null | optional | |
| items[].name | string | optional | A custom line’s name. A product’s is the list’s. |
| items[].quantity | integer | required | |
| items[].unit_price | string | null | optional | A custom line’s price, typed by the seller. A product is priced by the list. |
| discount | object | null | optional | |
| discount.kind | "amount" | required | |
| discount.value | string | required | |
| tax_rate | string | null | optional | A percentage of the subtotal after the discount, like "16". |
| deposit | object | null | optional | Asked by payment link once the customer accepts: an amount, or a percentage of the total. |
| deposit.kind | "amount" | required | |
| deposit.value | string | required | |
| valid_until | string (date) | null | optional | The last day the customer can accept it. Needed to send it. |
| terms | string | null | optional | |
| notes | string | null | optional |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "quote" | required | |
| number | string | required | The quote number the customer reads: Q, the year and the workspace’s count in that year. |
| connection_id | string | required | |
| contact_id | string | required | |
| conversation_id | string | null | required | |
| status | "draft" | "sent" | "accepted" | "declined" | "expired" | required | |
| currency | string | null | required | |
| items | object[] | required | |
| items[].product_id | string | null | required | |
| items[].variant | string | null | required | |
| items[].name | string | required | |
| items[].quantity | integer | required | |
| items[].unit_price | string | null | required | |
| items[].tier_quantity | integer | null | required | |
| items[].price_source | "product_list" | "seller" | null | required | Where the price came from: product_list, or seller (a custom line, typed by a person). Null is no price. |
| items[].line_total | string | null | required | |
| items[].custom | boolean | required | Not on the number’s product list. |
| items[].check | boolean | required | Shown with "Check": the line has no price. |
| subtotal | string | null | required | |
| discount | object | null | required | |
| discount.kind | "amount" | required | |
| discount.value | string | required | |
| discount_amount | string | null | required | |
| tax_rate | string | null | required | |
| tax_amount | string | null | required | |
| total | string | null | required | |
| deposit | object | null | required | |
| deposit.kind | "amount" | required | |
| deposit.value | string | required | |
| deposit_amount | string | null | required | |
| valid_until | string | null | required | |
| terms | string | null | required | |
| notes | string | null | required | |
| language | string | null | required | |
| answers | object[] | required | |
| answers[].key | string | required | |
| answers[].label | string | required | |
| answers[].value | string | null | required | |
| answers[].confidence | number | null | required | |
| answers[].evidence | string[] | required | The messages the answer was read from: the customer said it there. |
| answers[].by | "ai" | "seller" | required | |
| answers[].check | boolean | required | The AI was unsure: shown with "Check". |
| missing | string[] | required | The keys of the questions with no answer. |
| suggested_question | string | null | required | One question asking every missing answer, for the seller to send. |
| order_id | string | null | required | The order an accepted quote became. |
| pdf_media_id | string | null | required | The PDF the customer was sent. |
| follow_up | object | null | required | Day 2 or day 5 with no word from the customer: follow up today. |
| follow_up.day | 2 | 5 | required | |
| follow_up.due_at | string | required | |
| sent_at | string | null | required | |
| accepted_at | string | null | required | |
| declined_at | string | null | required | |
| decline_reason | "too_expensive" | "not_needed" | "found_another" | "other" | null | required | |
| expired_at | string | null | required | |
| created_at | string | required | |
| updated_at | string | required |
GET /v1/quotes/{id}
One quote: its lines, totals, the answers read from the chat and every change made to it
Scopes messages:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "quote" | required | |
| number | string | required | The quote number the customer reads: Q, the year and the workspace’s count in that year. |
| connection_id | string | required | |
| contact_id | string | required | |
| conversation_id | string | null | required | |
| status | "draft" | "sent" | "accepted" | "declined" | "expired" | required | |
| currency | string | null | required | |
| items | object[] | required | |
| items[].product_id | string | null | required | |
| items[].variant | string | null | required | |
| items[].name | string | required | |
| items[].quantity | integer | required | |
| items[].unit_price | string | null | required | |
| items[].tier_quantity | integer | null | required | |
| items[].price_source | "product_list" | "seller" | null | required | Where the price came from: product_list, or seller (a custom line, typed by a person). Null is no price. |
| items[].line_total | string | null | required | |
| items[].custom | boolean | required | Not on the number’s product list. |
| items[].check | boolean | required | Shown with "Check": the line has no price. |
| subtotal | string | null | required | |
| discount | object | null | required | |
| discount.kind | "amount" | required | |
| discount.value | string | required | |
| discount_amount | string | null | required | |
| tax_rate | string | null | required | |
| tax_amount | string | null | required | |
| total | string | null | required | |
| deposit | object | null | required | |
| deposit.kind | "amount" | required | |
| deposit.value | string | required | |
| deposit_amount | string | null | required | |
| valid_until | string | null | required | |
| terms | string | null | required | |
| notes | string | null | required | |
| language | string | null | required | |
| answers | object[] | required | |
| answers[].key | string | required | |
| answers[].label | string | required | |
| answers[].value | string | null | required | |
| answers[].confidence | number | null | required | |
| answers[].evidence | string[] | required | The messages the answer was read from: the customer said it there. |
| answers[].by | "ai" | "seller" | required | |
| answers[].check | boolean | required | The AI was unsure: shown with "Check". |
| missing | string[] | required | The keys of the questions with no answer. |
| suggested_question | string | null | required | One question asking every missing answer, for the seller to send. |
| order_id | string | null | required | The order an accepted quote became. |
| pdf_media_id | string | null | required | The PDF the customer was sent. |
| follow_up | object | null | required | Day 2 or day 5 with no word from the customer: follow up today. |
| follow_up.day | 2 | 5 | required | |
| follow_up.due_at | string | required | |
| sent_at | string | null | required | |
| accepted_at | string | null | required | |
| declined_at | string | null | required | |
| decline_reason | "too_expensive" | "not_needed" | "found_another" | "other" | null | required | |
| expired_at | string | null | required | |
| created_at | string | required | |
| updated_at | string | required | |
| events | object[] | required | |
| events[].kind | string | required | |
| events[].actor | "customer" | "seller" | "ai" | "system" | "api" | required | |
| events[].user_id | string | null | required | |
| events[].from_status | string | null | required | |
| events[].to_status | string | null | required | |
| events[].message_id | string | null | required | |
| events[].tap | string | null | required | |
| events[].changes | object | null | required | |
| events[].at | string | required |
PATCH /v1/quotes/{id}
Change a draft quote: its lines, discount, tax, deposit, validity, terms and answers
Scopes messages:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | optional |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| items | object[] | optional | |
| items[].product_id | string | null | optional | A product of the chat’s number, priced by its list. Left out or null: a custom line. |
| items[].variant | string | null | optional | |
| items[].name | string | optional | A custom line’s name. A product’s is the list’s. |
| items[].quantity | integer | required | |
| items[].unit_price | string | null | optional | A custom line’s price, typed by the seller. A product is priced by the list. |
| discount | object | null | optional | |
| discount.kind | "amount" | required | |
| discount.value | string | required | |
| tax_rate | string | null | optional | A percentage of the subtotal after the discount, like "16". |
| deposit | object | null | optional | Asked by payment link once the customer accepts: an amount, or a percentage of the total. |
| deposit.kind | "amount" | required | |
| deposit.value | string | required | |
| valid_until | string (date) | null | optional | The last day the customer can accept it. Needed to send it. |
| terms | string | null | optional | |
| notes | string | null | optional | |
| answers | object | optional | Answers the seller typed or cleared, by question key. A typed answer replaces the AI’s. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "quote" | required | |
| number | string | required | The quote number the customer reads: Q, the year and the workspace’s count in that year. |
| connection_id | string | required | |
| contact_id | string | required | |
| conversation_id | string | null | required | |
| status | "draft" | "sent" | "accepted" | "declined" | "expired" | required | |
| currency | string | null | required | |
| items | object[] | required | |
| items[].product_id | string | null | required | |
| items[].variant | string | null | required | |
| items[].name | string | required | |
| items[].quantity | integer | required | |
| items[].unit_price | string | null | required | |
| items[].tier_quantity | integer | null | required | |
| items[].price_source | "product_list" | "seller" | null | required | Where the price came from: product_list, or seller (a custom line, typed by a person). Null is no price. |
| items[].line_total | string | null | required | |
| items[].custom | boolean | required | Not on the number’s product list. |
| items[].check | boolean | required | Shown with "Check": the line has no price. |
| subtotal | string | null | required | |
| discount | object | null | required | |
| discount.kind | "amount" | required | |
| discount.value | string | required | |
| discount_amount | string | null | required | |
| tax_rate | string | null | required | |
| tax_amount | string | null | required | |
| total | string | null | required | |
| deposit | object | null | required | |
| deposit.kind | "amount" | required | |
| deposit.value | string | required | |
| deposit_amount | string | null | required | |
| valid_until | string | null | required | |
| terms | string | null | required | |
| notes | string | null | required | |
| language | string | null | required | |
| answers | object[] | required | |
| answers[].key | string | required | |
| answers[].label | string | required | |
| answers[].value | string | null | required | |
| answers[].confidence | number | null | required | |
| answers[].evidence | string[] | required | The messages the answer was read from: the customer said it there. |
| answers[].by | "ai" | "seller" | required | |
| answers[].check | boolean | required | The AI was unsure: shown with "Check". |
| missing | string[] | required | The keys of the questions with no answer. |
| suggested_question | string | null | required | One question asking every missing answer, for the seller to send. |
| order_id | string | null | required | The order an accepted quote became. |
| pdf_media_id | string | null | required | The PDF the customer was sent. |
| follow_up | object | null | required | Day 2 or day 5 with no word from the customer: follow up today. |
| follow_up.day | 2 | 5 | required | |
| follow_up.due_at | string | required | |
| sent_at | string | null | required | |
| accepted_at | string | null | required | |
| declined_at | string | null | required | |
| decline_reason | "too_expensive" | "not_needed" | "found_another" | "other" | null | required | |
| expired_at | string | null | required | |
| created_at | string | required | |
| updated_at | string | required |
GET /v1/quotes/{id}/pdf
The quote as its PDF, as the customer gets it
Scopes messages:read
Response 200
The quote’s PDF. Content-Disposition names the file after the quote’s number. application/pdf
POST /v1/quotes/{id}/send
Send a quote to the customer: its PDF with Accept, Ask a question and Not now
Scopes messages:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "quote" | required | |
| number | string | required | The quote number the customer reads: Q, the year and the workspace’s count in that year. |
| connection_id | string | required | |
| contact_id | string | required | |
| conversation_id | string | null | required | |
| status | "draft" | "sent" | "accepted" | "declined" | "expired" | required | |
| currency | string | null | required | |
| items | object[] | required | |
| items[].product_id | string | null | required | |
| items[].variant | string | null | required | |
| items[].name | string | required | |
| items[].quantity | integer | required | |
| items[].unit_price | string | null | required | |
| items[].tier_quantity | integer | null | required | |
| items[].price_source | "product_list" | "seller" | null | required | Where the price came from: product_list, or seller (a custom line, typed by a person). Null is no price. |
| items[].line_total | string | null | required | |
| items[].custom | boolean | required | Not on the number’s product list. |
| items[].check | boolean | required | Shown with "Check": the line has no price. |
| subtotal | string | null | required | |
| discount | object | null | required | |
| discount.kind | "amount" | required | |
| discount.value | string | required | |
| discount_amount | string | null | required | |
| tax_rate | string | null | required | |
| tax_amount | string | null | required | |
| total | string | null | required | |
| deposit | object | null | required | |
| deposit.kind | "amount" | required | |
| deposit.value | string | required | |
| deposit_amount | string | null | required | |
| valid_until | string | null | required | |
| terms | string | null | required | |
| notes | string | null | required | |
| language | string | null | required | |
| answers | object[] | required | |
| answers[].key | string | required | |
| answers[].label | string | required | |
| answers[].value | string | null | required | |
| answers[].confidence | number | null | required | |
| answers[].evidence | string[] | required | The messages the answer was read from: the customer said it there. |
| answers[].by | "ai" | "seller" | required | |
| answers[].check | boolean | required | The AI was unsure: shown with "Check". |
| missing | string[] | required | The keys of the questions with no answer. |
| suggested_question | string | null | required | One question asking every missing answer, for the seller to send. |
| order_id | string | null | required | The order an accepted quote became. |
| pdf_media_id | string | null | required | The PDF the customer was sent. |
| follow_up | object | null | required | Day 2 or day 5 with no word from the customer: follow up today. |
| follow_up.day | 2 | 5 | required | |
| follow_up.due_at | string | required | |
| sent_at | string | null | required | |
| accepted_at | string | null | required | |
| declined_at | string | null | required | |
| decline_reason | "too_expensive" | "not_needed" | "found_another" | "other" | null | required | |
| expired_at | string | null | required | |
| created_at | string | required | |
| updated_at | string | required |
/v1/receptionist-actions
GET /v1/receptionist-actions
What the AI receptionist did and proposed for customers, newest first, filterable by WhatsApp number, conversation, state, capability and test
Scopes automations:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| limit | query | integer | optional | |
| after | query | string | optional | |
| before | query | string | optional | |
| connection_id | query | string | string[] | optional | WhatsApp numbers (connection ids), repeatable: the rows for any of them. Automations: those on it, and those with no number, which run on every number. Runs: those that ran on it, and those that name no number of their own whose automation is one of these. |
| conversation_id | query | string | optional | Only the actions in this conversation (a cnv_ id). |
| state | query | "done" | "failed" | "checking" | "awaiting_send" | "awaiting_customer" | "awaiting_owner" | "executing" | "cancelled" | … | optional | Only actions in this state. A proposal waits for the customer’s Confirm tap (awaiting_customer) for 15 minutes, and is expired after that. An order or booking the number holds for a person to send first waits as awaiting_send until the customer’s WhatsApp window closes. |
| capability | query | "booking" | "crm" | "payments" | "orders" | "selling" | optional | Only the actions of this capability. |
| test | query | "true" | "false" | optional | Only the actions taken from Try it (true), or only the real ones (false). |
| include_lookups | query | "true" | "false" | optional | Lookups are what the AI read to answer, such as free times (kind read). Left out unless this is true. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].object | "receptionist_action" | required | |
| data[].automation_id | string | null | required | |
| data[].connection_id | string | required | |
| data[].conversation_id | string | null | required | |
| data[].contact_id | string | required | |
| data[].capability | "booking" | "crm" | "payments" | "orders" | "selling" | required | |
| data[].tool | string | required | |
| data[].kind | "read" | "final" | "write" | required | read: it looked something up. final: the customer confirms it with a tap. write: done at once with no tap (a CRM write, the customer’s saved details, a booking while booking confirmation is off). |
| data[].connector | string | required | |
| data[].connector_account_id | string | null | required | |
| data[].state | "done" | "failed" | "checking" | "awaiting_send" | "awaiting_customer" | "awaiting_owner" | "executing" | "cancelled" | … | required | |
| data[].facts | string | null | required | |
| data[].summary | string | null | required | |
| data[].failure | string | null | required | |
| data[].test | boolean | required | |
| data[].undoable | boolean | required | A booking made or moved that is done: POST /v1/receptionist-actions/{id}/undo cancels it or moves it back. |
| data[].record_url | string | null | required | Where the record a CRM write made or changed opens in the CRM, when the CRM gives one: a CRM write has no undo. |
| data[].payment_status | "paid" | "expired" | "failed" | null | required | |
| data[].approval_id | string | null | required | |
| data[].expires_at | string | null | required | |
| data[].executed_at | string | null | required | |
| data[].created_at | string | required | |
| data[].updated_at | string | required | |
| has_more | boolean | required | |
| next_cursor | string | null | required |
GET /v1/receptionist-actions/{id}
One thing the AI receptionist did or proposed for a customer
Scopes automations:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "receptionist_action" | required | |
| automation_id | string | null | required | |
| connection_id | string | required | |
| conversation_id | string | null | required | |
| contact_id | string | required | |
| capability | "booking" | "crm" | "payments" | "orders" | "selling" | required | |
| tool | string | required | |
| kind | "read" | "final" | "write" | required | read: it looked something up. final: the customer confirms it with a tap. write: done at once with no tap (a CRM write, the customer’s saved details, a booking while booking confirmation is off). |
| connector | string | required | |
| connector_account_id | string | null | required | |
| state | "done" | "failed" | "checking" | "awaiting_send" | "awaiting_customer" | "awaiting_owner" | "executing" | "cancelled" | … | required | |
| facts | string | null | required | |
| summary | string | null | required | |
| failure | string | null | required | |
| test | boolean | required | |
| undoable | boolean | required | A booking made or moved that is done: POST /v1/receptionist-actions/{id}/undo cancels it or moves it back. |
| record_url | string | null | required | Where the record a CRM write made or changed opens in the CRM, when the CRM gives one: a CRM write has no undo. |
| payment_status | "paid" | "expired" | "failed" | null | required | |
| approval_id | string | null | required | |
| expires_at | string | null | required | |
| executed_at | string | null | required | |
| created_at | string | required | |
| updated_at | string | required |
POST /v1/receptionist-actions/{id}/send
Send an order or booking the AI receptionist made, which the number holds for a person to check first: the customer gets it with Confirm and Change
Scopes messages:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "receptionist_action" | required | |
| automation_id | string | null | required | |
| connection_id | string | required | |
| conversation_id | string | null | required | |
| contact_id | string | required | |
| capability | "booking" | "crm" | "payments" | "orders" | "selling" | required | |
| tool | string | required | |
| kind | "read" | "final" | "write" | required | read: it looked something up. final: the customer confirms it with a tap. write: done at once with no tap (a CRM write, the customer’s saved details, a booking while booking confirmation is off). |
| connector | string | required | |
| connector_account_id | string | null | required | |
| state | "done" | "failed" | "checking" | "awaiting_send" | "awaiting_customer" | "awaiting_owner" | "executing" | "cancelled" | … | required | |
| facts | string | null | required | |
| summary | string | null | required | |
| failure | string | null | required | |
| test | boolean | required | |
| undoable | boolean | required | A booking made or moved that is done: POST /v1/receptionist-actions/{id}/undo cancels it or moves it back. |
| record_url | string | null | required | Where the record a CRM write made or changed opens in the CRM, when the CRM gives one: a CRM write has no undo. |
| payment_status | "paid" | "expired" | "failed" | null | required | |
| approval_id | string | null | required | |
| expires_at | string | null | required | |
| executed_at | string | null | required | |
| created_at | string | required | |
| updated_at | string | required |
POST /v1/receptionist-actions/{id}/undo
Undo what the AI receptionist did: cancel a booking it made, or move a booking it moved back to its earlier time
Scopes automations:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | required |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| tell_customer | boolean | optional | Send the customer a WhatsApp message saying the team undid it (while WhatsApp lets a message through). On unless set to false. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "receptionist_action" | required | |
| automation_id | string | null | required | |
| connection_id | string | required | |
| conversation_id | string | null | required | |
| contact_id | string | required | |
| capability | "booking" | "crm" | "payments" | "orders" | "selling" | required | |
| tool | string | required | |
| kind | "read" | "final" | "write" | required | read: it looked something up. final: the customer confirms it with a tap. write: done at once with no tap (a CRM write, the customer’s saved details, a booking while booking confirmation is off). |
| connector | string | required | |
| connector_account_id | string | null | required | |
| state | "done" | "failed" | "checking" | "awaiting_send" | "awaiting_customer" | "awaiting_owner" | "executing" | "cancelled" | … | required | |
| facts | string | null | required | |
| summary | string | null | required | |
| failure | string | null | required | |
| test | boolean | required | |
| undoable | boolean | required | A booking made or moved that is done: POST /v1/receptionist-actions/{id}/undo cancels it or moves it back. |
| record_url | string | null | required | Where the record a CRM write made or changed opens in the CRM, when the CRM gives one: a CRM write has no undo. |
| payment_status | "paid" | "expired" | "failed" | null | required | |
| approval_id | string | null | required | |
| expires_at | string | null | required | |
| executed_at | string | null | required | |
| created_at | string | required | |
| updated_at | string | required |
/v1/receptionist-setups
GET /v1/receptionist-setups
The types of business an AI receptionist can start from: what each fills in, its typical services, urgent words and closed message
Scopes automations:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].object | "receptionist_setup" | required | |
| data[].key | string | required | What POST /v1/automations/{id}/receptionist/setup takes. |
| data[].name | string | required | |
| data[].description | string | required | |
| data[].what_you_do | string | required | The persona’s “what you do” it fills. |
| data[].tone | "friendly" | "neutral" | "formal" | required | |
| data[].may_quote_prices | boolean | required | |
| data[].services | object[] | required | Typical services and how long each takes, for the owner’s own list. |
| data[].services[].name | string | required | |
| data[].services[].minutes | integer | required | |
| data[].urgent_words | string[] | required | Words that pass a chat to a person at once: what the receptionist’s own “Words that pass a chat to you” start from. |
| data[].closed_message | string | required | What the receptionist’s own closed message starts from. |
| data[].capabilities | ("booking" | "crm" | "payments" | "orders" | "selling")[] | required | What a receptionist of this type may do once it is switched on and connected. A clinic books and nothing else. |
| data[].procedures | object[] | required | The procedures it fills. |
| data[].procedures[].number | integer | required | |
| data[].procedures[].when | object | required | |
| data[].procedures[].steps | object[] | required | |
| has_more | boolean | required | |
| next_cursor | string | null | required |
/v1/recipes
GET /v1/recipes
The published recipe library. Cards, and no ir. ?connection_id= marks the recipes that cannot work on that number
Scopes automations:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| limit | query | integer | optional | |
| after | query | string | optional | |
| before | query | string | optional | |
| connection_id | query | string | optional | One WhatsApp number's (connection id). A recipe that cannot work on that number carries unavailable. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].object | "recipe" | required | |
| data[].slug | string | required | |
| data[].version | integer | required | |
| data[].name | string | required | |
| data[].description | string | null | required | |
| data[].category | string | null | required | |
| data[].inputs_schema | object | required | The form, as a JSON Schema. A template field (picker: "template") carries ready_made: {template, owner_adds?}. template is the body POST /v1/templates takes, less connection_id: display_name, category, language, components and, when it has variables, example_values. owner_adds, when present, is [{pointer, title, description}]: what only the owner can give, each a JSON pointer into template (the review request's link), which the create refuses until it is there. A language field (picker: "language") carries templates, the template fields it is for: its value is a language every one of the templates chosen in them is approved in on the number, as GET /v1/templates?connection_id= lists them (name, language, status), or "" for none chosen. Another is refused at save with automation_invalid. |
| data[].inputs_schema.order | string[] | optional | The order the settings are shown in: the name of every setting in properties, first to last, as declared. properties itself comes back in no particular order. Every recipe in the library, and every automation that declares settings, carries it. |
| data[].inputs_schema.properties | object | optional | |
| data[].sheet | object | null | required | The Google Sheet this recipe reads: its name, its tab, its columns and an example row. Send it as it is to POST /v1/connector-accounts/{id}/sheets to make that sheet. null: the recipe reads no sheet. |
| data[].sheet.title | string | required | The spreadsheet’s name. |
| data[].sheet.tab | string | required | The one tab’s name. |
| data[].sheet.columns | object[] | required | The header row the recipe reads, first column first. |
| data[].sheet.example_row | string[] | optional | The example row under the header, as wide as columns. Absent: header row only. |
| data[].unavailable | object | optional | Present only when the request named a WhatsApp number (?connection_id=) and the recipe cannot work on it. reason is needs_cloud_api: the number is also in the WhatsApp Business app, and the recipe needs WhatsApp calling, which Meta offers only on a number that runs on Cloud API. message says so in words. Setting it up on that number is refused with 403 not_supported_on_coexistence, and so is switching it on. Absent: available on that number, or no number was named. |
| data[].unavailable.reason | "needs_cloud_api" | required | |
| data[].unavailable.message | string | required | |
| data[].multiple | object | optional | Present when the recipe can be set up several times on one WhatsApp number, one copy per source: by is the setting that names the source (a sheet, a tag, a shop, a calendar) and label is that setting's title. A second copy for a source another copy on the number has is refused with 409 recipe_source_taken. Absent: once per number. |
| data[].multiple.by | string | required | |
| data[].multiple.label | string | required | |
| has_more | boolean | required | |
| next_cursor | string | null | required |
Errors automation_invalid not_supported_on_coexistence recipe_source_taken
POST /v1/recipes/{slug}/instantiate
Instantiate a recipe into an IR. Cosend fills in the settings and validates the result
Scopes automations:read
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| params | object | optional | |
| connection_id | string | optional | The WhatsApp number (connection id) it is being set up on. Given, a recipe already set up on that number, or already set up there for the same source, is refused as POST /v1/automations refuses it. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| ir | object | required | |
| validation | object | required | |
| validation.valid | boolean | required | |
| validation.compiler_version | string | required | |
| validation.catalogue_version | string | required | |
| validation.errors | object[] | required | |
| validation.errors[].pointer | string | required | |
| validation.errors[].code | string | required | |
| validation.errors[].message | string | required | |
| validation.errors[].fix | object | optional | |
| validation.errors[].detail | string | optional | When message is in plain words for the owner, the technical text it was said in place of, for Details. |
| validation.warnings | object[] | required | |
| validation.warnings[].pointer | string | required | |
| validation.warnings[].code | string | required | |
| validation.warnings[].message | string | required | |
| validation.warnings[].fix | object | optional | |
| validation.warnings[].detail | string | optional | When message is in plain words for the owner, the technical text it was said in place of, for Details. |
| validation.derived | object | optional | |
| validation.derived.acts | string[] | required | |
| validation.derived.budget | object | required | |
| validation.derived.segment_count | integer | required |
/v1/reports
GET /v1/reports/ads
Each Click-to-WhatsApp ad’s chats, first answer, orders, deliveries, cancellations, returns and revenue, and its spend when an ad account is chosen
Scopes messages:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| connection_id | query | string | string[] | optional | WhatsApp numbers (connection ids), repeatable: the rows for any of them. Automations: those on it, and those with no number, which run on every number. Runs: those that ran on it, and those that name no number of their own whose automation is one of these. |
| period | query | string | optional | today, 7d (today and the 6 days before it, the default), 30d, or a calendar month as month:YYYY-MM, in the workspace’s time zone. Not with from and to. |
| from | query | string (date) | optional | A custom period’s first day, in the workspace’s time zone, with to. At most 366 days, both included. |
| to | query | string (date) | optional | A custom period’s last day, with from. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| period | object | required | The days answered for, both included, in the workspace’s time zone. |
| period.from | string (date) | required | |
| period.to | string (date) | required | |
| period.tz | string | required | |
| data_through | string (date-time) | null | required | The figures hold everything up to this moment; they are worked out every five minutes. Null before the first time. |
| approximate | boolean | required | True while the figures are worked out again after a time zone change, or when the period reaches days counted in an earlier time zone. |
| notes | object[] | required | |
| notes[].code | "reports_started" | required | |
| notes[].date | string (date) | required | Reports count from this day on; the days before it have no figures. |
| spend | object | required | |
| spend.status | "ok" | "not_in_plan" | "no_ad_account" | "unavailable" | required | |
| spend.words | string | null | required | Why there is no spend, in words to show in its place. Null with spend. |
| totals | object | required | |
| totals.chats | integer | required | Chats started from this ad: a customer wrote from it, the first time or after Done. |
| totals.replied | integer | required | Of them, chats answered at least once: by the AI receptionist, a person, the phone, an automation or the API. |
| totals.handed_over | integer | required | Of them, chats handed over to a person. |
| totals.first_reply_seconds | integer | null | required | The median, in whole seconds, from the customer’s first message to the first answer, over the chats started from this ad. Null when none was answered. |
| totals.drafts | integer | required | Orders written from these chats in the period. |
| totals.confirmed | integer | required | Orders confirmed in the period. |
| totals.delivered | integer | required | Orders delivered in the period. |
| totals.cancelled | integer | required | Orders cancelled in the period. A draft that no one sent is not one. |
| totals.returned | integer | required | Orders returned in the period. |
| totals.revenue | object[] | required | The totals of the orders paid or delivered in the period (whichever came first), one entry per currency. Returns are not taken off. |
| totals.revenue[].amount | string | required | |
| totals.revenue[].currency | string | required | |
| totals.spend | object[] | required | The spend of every ad listed, one entry per currency. An ad that spent and brought no chat in the period is listed with its spend; an ad that never brought a chat to Cosend is not counted. |
| totals.spend[].amount | string | required | |
| totals.spend[].currency | string | required | |
| totals.cost_per_delivered_order | object | null | required | The spend over the orders delivered. Null without spend or deliveries. |
| totals.cost_per_delivered_order.amount | string | required | |
| totals.cost_per_delivered_order.currency | string | required | |
| totals.roas | number | null | required | Return on ad spend: the revenue over the spend, when both are in one currency. Null otherwise. |
| ads | object[] | required | |
| ads[].ad | object | required | |
| ads[].ad.source_id | string | required | Meta’s ad id. |
| ads[].ad.source_type | string | required | |
| ads[].ad.source_url | string | null | required | |
| ads[].ad.headline | string | null | required | |
| ads[].ad.body | string | null | required | |
| ads[].ad.media_type | string | null | required | |
| ads[].ad.image_url | string | null | required | |
| ads[].ad.video_url | string | null | required | |
| ads[].ad.thumbnail_url | string | null | required | |
| ads[].chats | integer | required | Chats started from this ad: a customer wrote from it, the first time or after Done. |
| ads[].replied | integer | required | Of them, chats answered at least once: by the AI receptionist, a person, the phone, an automation or the API. |
| ads[].handed_over | integer | required | Of them, chats handed over to a person. |
| ads[].first_reply_seconds | integer | null | required | The median, in whole seconds, from the customer’s first message to the first answer, over the chats started from this ad. Null when none was answered. |
| ads[].drafts | integer | required | Orders written from these chats in the period. |
| ads[].confirmed | integer | required | Orders confirmed in the period. |
| ads[].delivered | integer | required | Orders delivered in the period. |
| ads[].cancelled | integer | required | Orders cancelled in the period. A draft that no one sent is not one. |
| ads[].returned | integer | required | Orders returned in the period. |
| ads[].revenue | object[] | required | The totals of the orders paid or delivered in the period (whichever came first), one entry per currency. Returns are not taken off. |
| ads[].revenue[].amount | string | required | |
| ads[].revenue[].currency | string | required | |
| ads[].spend | object | null | required | What Meta says the ad cost in the period, in the ad account’s currency. Null without it: spend.status says why. |
| ads[].spend.amount | string | required | |
| ads[].spend.currency | string | required | |
| ads[].cost_per_delivered_order | object | null | required | The spend over the orders delivered. Null without spend or deliveries. |
| ads[].cost_per_delivered_order.amount | string | required | |
| ads[].cost_per_delivered_order.currency | string | required | |
| ads[].roas | number | null | required | Return on ad spend: the revenue over the spend, when both are in one currency. Null otherwise. |
GET /v1/reports/hours
Chats started by hour of the day in the workspace’s time zone, and how many the AI receptionist and people answered
Scopes messages:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| connection_id | query | string | string[] | optional | WhatsApp numbers (connection ids), repeatable: the rows for any of them. Automations: those on it, and those with no number, which run on every number. Runs: those that ran on it, and those that name no number of their own whose automation is one of these. |
| period | query | string | optional | today, 7d (today and the 6 days before it, the default), 30d, or a calendar month as month:YYYY-MM, in the workspace’s time zone. Not with from and to. |
| from | query | string (date) | optional | A custom period’s first day, in the workspace’s time zone, with to. At most 366 days, both included. |
| to | query | string (date) | optional | A custom period’s last day, with from. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| period | object | required | The days answered for, both included, in the workspace’s time zone. |
| period.from | string (date) | required | |
| period.to | string (date) | required | |
| period.tz | string | required | |
| data_through | string (date-time) | null | required | The figures hold everything up to this moment; they are worked out every five minutes. Null before the first time. |
| approximate | boolean | required | True while the figures are worked out again after a time zone change, or when the period reaches days counted in an earlier time zone. |
| notes | object[] | required | |
| notes[].code | "reports_started" | required | |
| notes[].date | string (date) | required | Reports count from this day on; the days before it have no figures. |
| hours | object[] | required | |
| hours[].hour | integer | required | |
| hours[].chats | integer | required | Chats started in this hour of the day. |
| hours[].ai | integer | required | Of them, chats the AI receptionist answered. |
| hours[].people | integer | required | Of them, chats a person answered. |
GET /v1/reports/numbers
Each WhatsApp number’s chats, the AI receptionist’s share and people’s first response, busiest first
Scopes messages:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| connection_id | query | string | string[] | optional | WhatsApp numbers (connection ids), repeatable: the rows for any of them. Automations: those on it, and those with no number, which run on every number. Runs: those that ran on it, and those that name no number of their own whose automation is one of these. |
| period | query | string | optional | today, 7d (today and the 6 days before it, the default), 30d, or a calendar month as month:YYYY-MM, in the workspace’s time zone. Not with from and to. |
| from | query | string (date) | optional | A custom period’s first day, in the workspace’s time zone, with to. At most 366 days, both included. |
| to | query | string (date) | optional | A custom period’s last day, with from. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| period | object | required | The days answered for, both included, in the workspace’s time zone. |
| period.from | string (date) | required | |
| period.to | string (date) | required | |
| period.tz | string | required | |
| data_through | string (date-time) | null | required | The figures hold everything up to this moment; they are worked out every five minutes. Null before the first time. |
| approximate | boolean | required | True while the figures are worked out again after a time zone change, or when the period reaches days counted in an earlier time zone. |
| notes | object[] | required | |
| notes[].code | "reports_started" | required | |
| notes[].date | string (date) | required | Reports count from this day on; the days before it have no figures. |
| numbers | object[] | required | |
| numbers[].connection_id | string | required | |
| numbers[].name | string | null | required | |
| numbers[].phone | string | required | |
| numbers[].chats | integer | required | |
| numbers[].ai_share | number | null | required | The share of its chats the AI receptionist answered. Null with no chats. |
| numbers[].people_handled | integer | required | Of its chats, those a person answered, in the inbox or from the phone: the count "People only" shows (people_handled on /receptionist). |
| numbers[].people_first_response_seconds | integer | null | required |
GET /v1/reports/receptionist
Chats started, how many the AI receptionist answered, answered alone and handed over, a day and over the period, and the top reasons in words
Scopes messages:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| connection_id | query | string | string[] | optional | WhatsApp numbers (connection ids), repeatable: the rows for any of them. Automations: those on it, and those with no number, which run on every number. Runs: those that ran on it, and those that name no number of their own whose automation is one of these. |
| period | query | string | optional | today, 7d (today and the 6 days before it, the default), 30d, or a calendar month as month:YYYY-MM, in the workspace’s time zone. Not with from and to. |
| from | query | string (date) | optional | A custom period’s first day, in the workspace’s time zone, with to. At most 366 days, both included. |
| to | query | string (date) | optional | A custom period’s last day, with from. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| period | object | required | The days answered for, both included, in the workspace’s time zone. |
| period.from | string (date) | required | |
| period.to | string (date) | required | |
| period.tz | string | required | |
| data_through | string (date-time) | null | required | The figures hold everything up to this moment; they are worked out every five minutes. Null before the first time. |
| approximate | boolean | required | True while the figures are worked out again after a time zone change, or when the period reaches days counted in an earlier time zone. |
| notes | object[] | required | |
| notes[].code | "reports_started" | required | |
| notes[].date | string (date) | required | Reports count from this day on; the days before it have no figures. |
| chats | integer | required | Chats started: a customer wrote, the first time or after Done. |
| ai_handled | integer | required | Chats the AI receptionist answered or passed to a person in the period (a day: on the day of its last hand-over, or of the AI’s last reply): answered_alone plus handed_over, as its own page and Home count them. |
| people_handled | integer | required | Of the chats started, chats a person answered, in the inbox or from the phone. |
| answered_alone | integer | required | Of the AI’s chats, those it answered and nobody passed to a person. |
| handed_over | integer | required | Of the AI’s chats, those passed to a person: by the AI receptionist, or by anyone in a chat the AI answered. |
| days | object[] | required | |
| days[].date | string (date) | required | |
| days[].chats | integer | required | Chats started: a customer wrote, the first time or after Done. |
| days[].ai_handled | integer | required | Chats the AI receptionist answered or passed to a person in the period (a day: on the day of its last hand-over, or of the AI’s last reply): answered_alone plus handed_over, as its own page and Home count them. |
| days[].people_handled | integer | required | Of the chats started, chats a person answered, in the inbox or from the phone. |
| days[].answered_alone | integer | required | Of the AI’s chats, those it answered and nobody passed to a person. |
| days[].handed_over | integer | required | Of the AI’s chats, those passed to a person: by the AI receptionist, or by anyone in a chat the AI answered. |
| top_reasons | object[] | required | |
| top_reasons[].reason | string | null | required | Why the chats were handed over, in words. Null: no reason in words. |
| top_reasons[].chats | integer | required |
GET /v1/reports/response
How fast chats were answered, by the AI receptionist and by people: the median a day and over the period
Scopes messages:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| connection_id | query | string | string[] | optional | WhatsApp numbers (connection ids), repeatable: the rows for any of them. Automations: those on it, and those with no number, which run on every number. Runs: those that ran on it, and those that name no number of their own whose automation is one of these. |
| period | query | string | optional | today, 7d (today and the 6 days before it, the default), 30d, or a calendar month as month:YYYY-MM, in the workspace’s time zone. Not with from and to. |
| from | query | string (date) | optional | A custom period’s first day, in the workspace’s time zone, with to. At most 366 days, both included. |
| to | query | string (date) | optional | A custom period’s last day, with from. |
| kind | query | "first" | "every" | optional | first (the default): each chat’s first answer by the AI receptionist, and its first answer by people. every: every answer. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| period | object | required | The days answered for, both included, in the workspace’s time zone. |
| period.from | string (date) | required | |
| period.to | string (date) | required | |
| period.tz | string | required | |
| data_through | string (date-time) | null | required | The figures hold everything up to this moment; they are worked out every five minutes. Null before the first time. |
| approximate | boolean | required | True while the figures are worked out again after a time zone change, or when the period reaches days counted in an earlier time zone. |
| notes | object[] | required | |
| notes[].code | "reports_started" | required | |
| notes[].date | string (date) | required | Reports count from this day on; the days before it have no figures. |
| kind | "first" | "every" | required | |
| ai | object | required | |
| ai.median_seconds | integer | null | required | The median, in whole seconds, of the answers by the AI receptionist. Null when there were none. |
| ai.answers | integer | required | |
| people | object | required | |
| people.median_seconds | integer | null | required | The median, in whole seconds, of the answers by people, in the inbox or from the phone. Null when there were none. |
| people.answers | integer | required | |
| days | object[] | required | |
| days[].date | string (date) | required | |
| days[].ai_median_seconds | integer | null | required | |
| days[].ai_answers | integer | required | |
| days[].people_median_seconds | integer | null | required | |
| days[].people_answers | integer | required |
GET /v1/reports/team
Each member’s chats answered, first response, response time and chats marked Done, busiest first
Scopes messages:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| connection_id | query | string | string[] | optional | WhatsApp numbers (connection ids), repeatable: the rows for any of them. Automations: those on it, and those with no number, which run on every number. Runs: those that ran on it, and those that name no number of their own whose automation is one of these. |
| period | query | string | optional | today, 7d (today and the 6 days before it, the default), 30d, or a calendar month as month:YYYY-MM, in the workspace’s time zone. Not with from and to. |
| from | query | string (date) | optional | A custom period’s first day, in the workspace’s time zone, with to. At most 366 days, both included. |
| to | query | string (date) | optional | A custom period’s last day, with from. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| period | object | required | The days answered for, both included, in the workspace’s time zone. |
| period.from | string (date) | required | |
| period.to | string (date) | required | |
| period.tz | string | required | |
| data_through | string (date-time) | null | required | The figures hold everything up to this moment; they are worked out every five minutes. Null before the first time. |
| approximate | boolean | required | True while the figures are worked out again after a time zone change, or when the period reaches days counted in an earlier time zone. |
| notes | object[] | required | |
| notes[].code | "reports_started" | required | |
| notes[].date | string (date) | required | Reports count from this day on; the days before it have no figures. |
| members | object[] | required | |
| members[].user_id | string | required | |
| members[].membership_id | string | null | required | |
| members[].name | string | null | required | |
| members[].status | "active" | "removed" | required | |
| members[].chats | integer | required | Chats they answered. |
| members[].first_response_seconds | integer | null | required | |
| members[].response_seconds | integer | null | required | |
| members[].done | integer | required | Chats they marked Done. |
/v1/runs
GET /v1/runs
Runs, filterable by automation, status, WhatsApp number and date
Scopes runs:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| limit | query | integer | optional | |
| after | query | string | optional | |
| before | query | string | optional | |
| automation_id | query | string | optional | |
| status | query | "queued" | "running" | "waiting" | "success" | "failure" | "cancelled" | "timeout" | "skipped" | … | optional | |
| connection_id | query | string | string[] | optional | WhatsApp numbers (connection ids), repeatable: the rows for any of them. Automations: those on it, and those with no number, which run on every number. Runs: those that ran on it, and those that name no number of their own whose automation is one of these. |
| created_after | query | string (date-time) | optional | Only runs triggered at or after this instant: their created_at, not started_at. ISO-8601 with its timezone (send a + offset as %2B), read to the millisecond. |
| created_before | query | string (date-time) | optional | Only runs triggered before this instant: their created_at, not started_at. ISO-8601 with its timezone (send a + offset as %2B), read to the millisecond. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].object | "run" | required | |
| data[].automation_id | string | required | |
| data[].automation_name | string | required | The name its owner knows the automation by: for one installed with another, that one’s name, and a deleted automation keeps its own. So a run is named even when its automation is not in the automations list. |
| data[].connection_id | string | null | required | |
| data[].version_no | integer | required | |
| data[].status | "queued" | "running" | "waiting" | "success" | "failure" | "cancelled" | "timeout" | "skipped" | … | required | |
| data[].skip_reason | "quota_exceeded" | "ai_capped" | "bot_disabled" | "outside_service_window" | "opted_out" | "connection_not_active" | "concurrency_limit" | "duplicate" | … | null | required | |
| data[].trigger | object | required | |
| data[].trigger.kind | string | required | |
| data[].trigger.message_id | string | null | required | |
| data[].started_at | string (date-time) | null | required | |
| data[].finished_at | string (date-time) | null | required | |
| data[].duration_ms | integer | null | required | |
| data[].steps_failed | integer | required | |
| data[].usage | object | required | |
| data[].usage.run_units | integer | required | |
| data[].usage.ai_conversation_id | string | null | required | |
| data[].usage.external_sends | integer | required | |
| data[].sent_messages | object[] | required | The WhatsApp messages this run sent, in the order sent: the first ten, each with whether WhatsApp accepted it (delivery). Empty for a test run, which sends nothing. |
| data[].sent_messages[].message_id | string | required | |
| data[].sent_messages[].type | "template" | "text" | "interactive" | "image" | "document" | "audio" | "video" | "sticker" | required | What was sent. A template names its template in template; every other kind is a message written in the automation, and its template is null. |
| data[].sent_messages[].template | object | null | required | |
| data[].sent_messages[].to | object | required | |
| data[].sent_messages[].delivery | object | required | |
| data[].result | any | null | required | |
| data[].error | any | null | required | |
| data[].failed_step | object | null | required | |
| data[].failed_step.step_id | string | null | required | |
| data[].failed_step.step_action | string | null | required | |
| data[].failed_step.error | object | null | required | |
| data[].failure | object | null | required | |
| data[].failure.reason | string | required | Why the run failed, in plain words. |
| data[].failure.detail | string | null | required | The technical text the reason was said in place of, in full, for Details. Null when the reason is all there is. |
| data[].failure.step_id | string | null | required | The step it stopped at; null when no step failed. |
| data[].failure.step_action | string | null | required | |
| data[].failure.before_first_step | boolean | required | True when the run stopped before it recorded any step. |
| data[].executor_error | object | null | required | The automation engine’s own account of why it failed or cancelled this run: the step, its error and the end of its log. name and message are null when the engine gave no reason. Null for a run the engine did not report failed or cancelled. |
| data[].executor_error.job_id | string | required | The automation engine's job the error was read from: the failed step's, or the run's own. |
| data[].executor_error.step_id | string | null | required | The flow step the automation engine marked failed; null when none did. |
| data[].executor_error.step_action | string | null | required | That step’s catalogue action, when it maps to one. |
| data[].executor_error.name | string | null | required | The automation engine’s error name. |
| data[].executor_error.message | string | null | required | The automation engine’s error message, at most 1000 characters, with secrets removed. |
| data[].executor_error.log_tail | string | null | required | The last lines of that step’s log, at most 20 lines and 2000 characters, with secrets removed. Null when the automation engine gave none. |
| data[].test | object | null | required | |
| data[].test.customer | object | null | required | |
| data[].test.trigger_type | string | null | required | |
| data[].test.payload | object | required | |
| data[].test.error_branch_preview | object | null | required | V4-H2: set when this Test made a step fail on purpose (fail_step) and its error branch ran to its end. The run then shows what the error branch would do: nothing failed, and its failure names the step made to fail. Null for every other Test, and for one whose error branch itself failed. |
| has_more | boolean | required | |
| next_cursor | string | null | required |
POST /v1/runs
Trigger an automation by hand
Scopes runs:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | required |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| automation_id | string | required | |
| payload | object | optional | |
| actions | string[] | optional | Every action the automation’s steps take, and those of a second automation set up with it, each once: what a person approves it doing. A list that leaves one out, or names one the steps do not take, is refused, and the refusal gives the list in error.actions. A version’s actions lists them too. |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "run" | required | |
| automation_id | string | required | |
| automation_name | string | required | The name its owner knows the automation by: for one installed with another, that one’s name, and a deleted automation keeps its own. So a run is named even when its automation is not in the automations list. |
| connection_id | string | null | required | |
| version_no | integer | required | |
| status | "queued" | "running" | "waiting" | "success" | "failure" | "cancelled" | "timeout" | "skipped" | … | required | |
| skip_reason | "quota_exceeded" | "ai_capped" | "bot_disabled" | "outside_service_window" | "opted_out" | "connection_not_active" | "concurrency_limit" | "duplicate" | … | null | required | |
| trigger | object | required | |
| trigger.kind | string | required | |
| trigger.message_id | string | null | required | |
| started_at | string (date-time) | null | required | |
| finished_at | string (date-time) | null | required | |
| duration_ms | integer | null | required | |
| steps_failed | integer | required | |
| usage | object | required | |
| usage.run_units | integer | required | |
| usage.ai_conversation_id | string | null | required | |
| usage.external_sends | integer | required | |
| sent_messages | object[] | required | The WhatsApp messages this run sent, in the order sent: the first ten, each with whether WhatsApp accepted it (delivery). Empty for a test run, which sends nothing. |
| sent_messages[].message_id | string | required | |
| sent_messages[].type | "template" | "text" | "interactive" | "image" | "document" | "audio" | "video" | "sticker" | required | What was sent. A template names its template in template; every other kind is a message written in the automation, and its template is null. |
| sent_messages[].template | object | null | required | |
| sent_messages[].template.id | string | required | |
| sent_messages[].template.display_name | string | required | The name the owner gave the template, as the Templates page shows it. |
| sent_messages[].to | object | required | |
| sent_messages[].to.contact_id | string | required | |
| sent_messages[].to.name | string | null | required | The customer's name as the Inbox shows it; null when they have none. |
| sent_messages[].to.phone | string | null | required | Their number in E.164; null when they are known only by their WhatsApp id. |
| sent_messages[].delivery | object | required | |
| sent_messages[].delivery.state | "sending" | "sent" | "not_sent" | required | sent once WhatsApp accepted the message; sending while it is still on its way; not_sent when it was stopped: the customer opted out, the owner answered from the WhatsApp Business app, or WhatsApp refused it. |
| sent_messages[].delivery.reason | string | null | required | Why it was not sent, in plain words. Null unless state is not_sent. |
| sent_messages[].delivery.detail | string | null | required | WhatsApp’s or Cosend’s own text for a message that was not sent, for developers. Null otherwise. |
| result | any | null | required | |
| error | any | null | required | |
| failed_step | object | null | required | |
| failed_step.step_id | string | null | required | |
| failed_step.step_action | string | null | required | |
| failed_step.error | object | null | required | |
| failed_step.error.code | string | required | |
| failed_step.error.message | string | required | What went wrong, in plain words. |
| failed_step.error.detail | string | null | required | The technical text, in full, for Details. Null when the message is all there is, and for an error on our side. |
| failure | object | null | required | |
| failure.reason | string | required | Why the run failed, in plain words. |
| failure.detail | string | null | required | The technical text the reason was said in place of, in full, for Details. Null when the reason is all there is. |
| failure.step_id | string | null | required | The step it stopped at; null when no step failed. |
| failure.step_action | string | null | required | |
| failure.before_first_step | boolean | required | True when the run stopped before it recorded any step. |
| executor_error | object | null | required | The automation engine’s own account of why it failed or cancelled this run: the step, its error and the end of its log. name and message are null when the engine gave no reason. Null for a run the engine did not report failed or cancelled. |
| executor_error.job_id | string | required | The automation engine's job the error was read from: the failed step's, or the run's own. |
| executor_error.step_id | string | null | required | The flow step the automation engine marked failed; null when none did. |
| executor_error.step_action | string | null | required | That step’s catalogue action, when it maps to one. |
| executor_error.name | string | null | required | The automation engine’s error name. |
| executor_error.message | string | null | required | The automation engine’s error message, at most 1000 characters, with secrets removed. |
| executor_error.log_tail | string | null | required | The last lines of that step’s log, at most 20 lines and 2000 characters, with secrets removed. Null when the automation engine gave none. |
| test | object | null | required | |
| test.customer | object | null | required | |
| test.customer.name | string | required | |
| test.customer.phone | string | required | |
| test.trigger_type | string | null | required | |
| test.payload | object | required | |
| test.error_branch_preview | object | null | required | V4-H2: set when this Test made a step fail on purpose (fail_step) and its error branch ran to its end. The run then shows what the error branch would do: nothing failed, and its failure names the step made to fail. Null for every other Test, and for one whose error branch itself failed. |
| test.error_branch_preview.step_id | string | required | The step the Test made fail on purpose. |
| test.error_branch_preview.says | string | required | What the preview is, in plain words. |
GET /v1/runs/{id}
One run
Scopes runs:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "run" | required | |
| automation_id | string | required | |
| automation_name | string | required | The name its owner knows the automation by: for one installed with another, that one’s name, and a deleted automation keeps its own. So a run is named even when its automation is not in the automations list. |
| connection_id | string | null | required | |
| version_no | integer | required | |
| status | "queued" | "running" | "waiting" | "success" | "failure" | "cancelled" | "timeout" | "skipped" | … | required | |
| skip_reason | "quota_exceeded" | "ai_capped" | "bot_disabled" | "outside_service_window" | "opted_out" | "connection_not_active" | "concurrency_limit" | "duplicate" | … | null | required | |
| trigger | object | required | |
| trigger.kind | string | required | |
| trigger.message_id | string | null | required | |
| started_at | string (date-time) | null | required | |
| finished_at | string (date-time) | null | required | |
| duration_ms | integer | null | required | |
| steps_failed | integer | required | |
| usage | object | required | |
| usage.run_units | integer | required | |
| usage.ai_conversation_id | string | null | required | |
| usage.external_sends | integer | required | |
| sent_messages | object[] | required | The WhatsApp messages this run sent, in the order sent: the first ten, each with whether WhatsApp accepted it (delivery). Empty for a test run, which sends nothing. |
| sent_messages[].message_id | string | required | |
| sent_messages[].type | "template" | "text" | "interactive" | "image" | "document" | "audio" | "video" | "sticker" | required | What was sent. A template names its template in template; every other kind is a message written in the automation, and its template is null. |
| sent_messages[].template | object | null | required | |
| sent_messages[].template.id | string | required | |
| sent_messages[].template.display_name | string | required | The name the owner gave the template, as the Templates page shows it. |
| sent_messages[].to | object | required | |
| sent_messages[].to.contact_id | string | required | |
| sent_messages[].to.name | string | null | required | The customer's name as the Inbox shows it; null when they have none. |
| sent_messages[].to.phone | string | null | required | Their number in E.164; null when they are known only by their WhatsApp id. |
| sent_messages[].delivery | object | required | |
| sent_messages[].delivery.state | "sending" | "sent" | "not_sent" | required | sent once WhatsApp accepted the message; sending while it is still on its way; not_sent when it was stopped: the customer opted out, the owner answered from the WhatsApp Business app, or WhatsApp refused it. |
| sent_messages[].delivery.reason | string | null | required | Why it was not sent, in plain words. Null unless state is not_sent. |
| sent_messages[].delivery.detail | string | null | required | WhatsApp’s or Cosend’s own text for a message that was not sent, for developers. Null otherwise. |
| result | any | null | required | |
| error | any | null | required | |
| failed_step | object | null | required | |
| failed_step.step_id | string | null | required | |
| failed_step.step_action | string | null | required | |
| failed_step.error | object | null | required | |
| failed_step.error.code | string | required | |
| failed_step.error.message | string | required | What went wrong, in plain words. |
| failed_step.error.detail | string | null | required | The technical text, in full, for Details. Null when the message is all there is, and for an error on our side. |
| failure | object | null | required | |
| failure.reason | string | required | Why the run failed, in plain words. |
| failure.detail | string | null | required | The technical text the reason was said in place of, in full, for Details. Null when the reason is all there is. |
| failure.step_id | string | null | required | The step it stopped at; null when no step failed. |
| failure.step_action | string | null | required | |
| failure.before_first_step | boolean | required | True when the run stopped before it recorded any step. |
| executor_error | object | null | required | The automation engine’s own account of why it failed or cancelled this run: the step, its error and the end of its log. name and message are null when the engine gave no reason. Null for a run the engine did not report failed or cancelled. |
| executor_error.job_id | string | required | The automation engine's job the error was read from: the failed step's, or the run's own. |
| executor_error.step_id | string | null | required | The flow step the automation engine marked failed; null when none did. |
| executor_error.step_action | string | null | required | That step’s catalogue action, when it maps to one. |
| executor_error.name | string | null | required | The automation engine’s error name. |
| executor_error.message | string | null | required | The automation engine’s error message, at most 1000 characters, with secrets removed. |
| executor_error.log_tail | string | null | required | The last lines of that step’s log, at most 20 lines and 2000 characters, with secrets removed. Null when the automation engine gave none. |
| test | object | null | required | |
| test.customer | object | null | required | |
| test.customer.name | string | required | |
| test.customer.phone | string | required | |
| test.trigger_type | string | null | required | |
| test.payload | object | required | |
| test.error_branch_preview | object | null | required | V4-H2: set when this Test made a step fail on purpose (fail_step) and its error branch ran to its end. The run then shows what the error branch would do: nothing failed, and its failure names the step made to fail. Null for every other Test, and for one whose error branch itself failed. |
| test.error_branch_preview.step_id | string | required | The step the Test made fail on purpose. |
| test.error_branch_preview.says | string | required | What the preview is, in plain words. |
POST /v1/runs/{id}/cancel
Cancel a run that has not finished
Scopes runs:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "run" | required | |
| automation_id | string | required | |
| automation_name | string | required | The name its owner knows the automation by: for one installed with another, that one’s name, and a deleted automation keeps its own. So a run is named even when its automation is not in the automations list. |
| connection_id | string | null | required | |
| version_no | integer | required | |
| status | "queued" | "running" | "waiting" | "success" | "failure" | "cancelled" | "timeout" | "skipped" | … | required | |
| skip_reason | "quota_exceeded" | "ai_capped" | "bot_disabled" | "outside_service_window" | "opted_out" | "connection_not_active" | "concurrency_limit" | "duplicate" | … | null | required | |
| trigger | object | required | |
| trigger.kind | string | required | |
| trigger.message_id | string | null | required | |
| started_at | string (date-time) | null | required | |
| finished_at | string (date-time) | null | required | |
| duration_ms | integer | null | required | |
| steps_failed | integer | required | |
| usage | object | required | |
| usage.run_units | integer | required | |
| usage.ai_conversation_id | string | null | required | |
| usage.external_sends | integer | required | |
| sent_messages | object[] | required | The WhatsApp messages this run sent, in the order sent: the first ten, each with whether WhatsApp accepted it (delivery). Empty for a test run, which sends nothing. |
| sent_messages[].message_id | string | required | |
| sent_messages[].type | "template" | "text" | "interactive" | "image" | "document" | "audio" | "video" | "sticker" | required | What was sent. A template names its template in template; every other kind is a message written in the automation, and its template is null. |
| sent_messages[].template | object | null | required | |
| sent_messages[].template.id | string | required | |
| sent_messages[].template.display_name | string | required | The name the owner gave the template, as the Templates page shows it. |
| sent_messages[].to | object | required | |
| sent_messages[].to.contact_id | string | required | |
| sent_messages[].to.name | string | null | required | The customer's name as the Inbox shows it; null when they have none. |
| sent_messages[].to.phone | string | null | required | Their number in E.164; null when they are known only by their WhatsApp id. |
| sent_messages[].delivery | object | required | |
| sent_messages[].delivery.state | "sending" | "sent" | "not_sent" | required | sent once WhatsApp accepted the message; sending while it is still on its way; not_sent when it was stopped: the customer opted out, the owner answered from the WhatsApp Business app, or WhatsApp refused it. |
| sent_messages[].delivery.reason | string | null | required | Why it was not sent, in plain words. Null unless state is not_sent. |
| sent_messages[].delivery.detail | string | null | required | WhatsApp’s or Cosend’s own text for a message that was not sent, for developers. Null otherwise. |
| result | any | null | required | |
| error | any | null | required | |
| failed_step | object | null | required | |
| failed_step.step_id | string | null | required | |
| failed_step.step_action | string | null | required | |
| failed_step.error | object | null | required | |
| failed_step.error.code | string | required | |
| failed_step.error.message | string | required | What went wrong, in plain words. |
| failed_step.error.detail | string | null | required | The technical text, in full, for Details. Null when the message is all there is, and for an error on our side. |
| failure | object | null | required | |
| failure.reason | string | required | Why the run failed, in plain words. |
| failure.detail | string | null | required | The technical text the reason was said in place of, in full, for Details. Null when the reason is all there is. |
| failure.step_id | string | null | required | The step it stopped at; null when no step failed. |
| failure.step_action | string | null | required | |
| failure.before_first_step | boolean | required | True when the run stopped before it recorded any step. |
| executor_error | object | null | required | The automation engine’s own account of why it failed or cancelled this run: the step, its error and the end of its log. name and message are null when the engine gave no reason. Null for a run the engine did not report failed or cancelled. |
| executor_error.job_id | string | required | The automation engine's job the error was read from: the failed step's, or the run's own. |
| executor_error.step_id | string | null | required | The flow step the automation engine marked failed; null when none did. |
| executor_error.step_action | string | null | required | That step’s catalogue action, when it maps to one. |
| executor_error.name | string | null | required | The automation engine’s error name. |
| executor_error.message | string | null | required | The automation engine’s error message, at most 1000 characters, with secrets removed. |
| executor_error.log_tail | string | null | required | The last lines of that step’s log, at most 20 lines and 2000 characters, with secrets removed. Null when the automation engine gave none. |
| test | object | null | required | |
| test.customer | object | null | required | |
| test.customer.name | string | required | |
| test.customer.phone | string | required | |
| test.trigger_type | string | null | required | |
| test.payload | object | required | |
| test.error_branch_preview | object | null | required | V4-H2: set when this Test made a step fail on purpose (fail_step) and its error branch ran to its end. The run then shows what the error branch would do: nothing failed, and its failure names the step made to fail. Null for every other Test, and for one whose error branch itself failed. |
| test.error_branch_preview.step_id | string | required | The step the Test made fail on purpose. |
| test.error_branch_preview.says | string | required | What the preview is, in plain words. |
GET /v1/runs/{id}/events
The per-step trace behind a run’s timeline
Scopes runs:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| limit | query | integer | optional | |
| after | query | string | optional | |
| before | query | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].seq | integer | required | |
| data[].step_id | string | null | required | |
| data[].step_action | string | null | required | |
| data[].kind | string | required | |
| data[].status | string | null | required | |
| data[].error | object | null | required | |
| data[].error.code | string | required | |
| data[].error.message | string | required | What went wrong, in plain words. |
| data[].error.detail | string | null | required | The technical text, in full, for Details. Null when the message is all there is, and for an error on our side. |
| data[].would | object | null | required | |
| data[].decision | object | null | required | |
| data[].decision.branch | string | null | required | The branch it took, by its label (otherwise when none held); null when it chose none. |
| data[].decision.why | string | required | Why, in plain words. |
| data[].test_step | object | null | required | |
| data[].test_step.outcome | "read_for_real" | "ran" | "held_back" | "sample" | required | |
| data[].test_step.says | string | required | “Read for real.”, “Ran as a real run would.”, “Held back: this step would write.”, “Held back: this read is not marked as one a Test may run.” or “Read the Test’s sample.” |
| data[].test_step.why | string | required | Why, in plain words. |
| data[].duration_ms | integer | null | required | |
| data[].created_at | string (date-time) | required | |
| has_more | boolean | required | |
| next_cursor | string | null | required |
/v1/saved-replies
GET /v1/saved-replies
The saved replies of the workspace’s numbers, by number, words, folder and shortcut
Scopes messages:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| connection_id | query | string | optional | Only this number’s replies. |
| q | query | string | optional | Replies whose shortcut, folder or text has a word starting with each word given. |
| folder | query | string | optional | |
| shortcut | query | string | optional | Every language version of one shortcut, with or without the /. |
| limit | query | integer | optional | |
| after | query | string | optional | |
| before | query | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].object | "saved_reply" | required | |
| data[].connection_id | string | required | |
| data[].shortcut | string | null | required | |
| data[].folder | string | null | required | |
| data[].language | string | null | required | |
| data[].text | string | required | |
| data[].media | object[] | required | |
| data[].media[].media_id | string | required | |
| data[].media[].kind | "image" | "video" | "document" | "audio" | required | |
| data[].media[].mime_type | string | required | |
| data[].media[].filename | string | null | required | |
| data[].product_id | string | null | required | |
| data[].times_sent | integer | required | |
| data[].created_at | string (date-time) | required | |
| data[].updated_at | string (date-time) | required | |
| has_more | boolean | required | |
| next_cursor | string | null | required |
POST /v1/saved-replies
Save a reply for a number: words with variables, files, a folder and a shortcut
Scopes messages:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | optional |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| connection_id | string | optional | The number the reply belongs to. Optional with an API key made for one number, which already names it. |
| text | string | required | The words sent. {first_name} is filled with the customer’s first name and {product.price} with the price of one of the reply’s product: its tier for 1, else its lowest variant price. |
| media | string[] | optional | Up to 10 files sent after the text, by the id POST /v1/media gave each, uploaded on the reply’s number: photos, videos, PDFs, and one voice note. Written whole. |
| folder | string | null | optional | |
| shortcut | string | null | optional | Typed after / in the composer, e.g. /precio. A reply’s language versions share its shortcut, one per language. |
| language | string | null | optional | The language of this version; null for any language. |
| product_id | string | null | optional | The product {product.price} reads, on the same number. |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "saved_reply" | required | |
| connection_id | string | required | |
| shortcut | string | null | required | |
| folder | string | null | required | |
| language | string | null | required | |
| text | string | required | |
| media | object[] | required | |
| media[].media_id | string | required | |
| media[].kind | "image" | "video" | "document" | "audio" | required | |
| media[].mime_type | string | required | |
| media[].filename | string | null | required | |
| product_id | string | null | required | |
| times_sent | integer | required | |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required |
GET /v1/saved-replies/{id}
One saved reply, with its files and how many times it was sent
Scopes messages:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "saved_reply" | required | |
| connection_id | string | required | |
| shortcut | string | null | required | |
| folder | string | null | required | |
| language | string | null | required | |
| text | string | required | |
| media | object[] | required | |
| media[].media_id | string | required | |
| media[].kind | "image" | "video" | "document" | "audio" | required | |
| media[].mime_type | string | required | |
| media[].filename | string | null | required | |
| product_id | string | null | required | |
| times_sent | integer | required | |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required |
PATCH /v1/saved-replies/{id}
Change a saved reply; a list of files given replaces the one before
Scopes messages:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | optional |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| text | string | optional | The words sent. {first_name} is filled with the customer’s first name and {product.price} with the price of one of the reply’s product: its tier for 1, else its lowest variant price. |
| media | string[] | optional | Up to 10 files sent after the text, by the id POST /v1/media gave each, uploaded on the reply’s number: photos, videos, PDFs, and one voice note. Written whole. |
| folder | string | null | optional | |
| shortcut | string | null | optional | Typed after / in the composer, e.g. /precio. A reply’s language versions share its shortcut, one per language. |
| language | string | null | optional | The language of this version; null for any language. |
| product_id | string | null | optional | The product {product.price} reads, on the same number. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "saved_reply" | required | |
| connection_id | string | required | |
| shortcut | string | null | required | |
| folder | string | null | required | |
| language | string | null | required | |
| text | string | required | |
| media | object[] | required | |
| media[].media_id | string | required | |
| media[].kind | "image" | "video" | "document" | "audio" | required | |
| media[].mime_type | string | required | |
| media[].filename | string | null | required | |
| product_id | string | null | required | |
| times_sent | integer | required | |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required |
DELETE /v1/saved-replies/{id}
Delete a saved reply; its files stay files of the number
Scopes messages:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "saved_reply" | required | |
| deleted | true | required |
POST /v1/saved-replies/{id}/send
Send a saved reply into a chat: its words with the chat’s values, then its files
Scopes messages:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | required |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| conversation_id | string | required | |
| text | string | optional | The words as the person edited them in the composer; left out, the reply’s own. Its variables are filled the same way. |
| source | "customer" | "app" | "api" | "agent" | "automation" | "ai" | "notify" | "history" | … | optional | Who is sending. Left out, it is agent for a person (the dashboard Inbox, or an MCP client acting for one) and api for an API key. |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "saved_reply_send" | required | |
| saved_reply_id | string | required | |
| messages | object[] | required | |
| messages[].id | string | required | |
| messages[].object | "message" | required | |
| messages[].conversation_id | string | required | |
| messages[].contact_id | string | required | |
| messages[].contact | object | required | |
| messages[].contact.id | string | required | |
| messages[].contact.bsuid | string | null | required | |
| messages[].contact.phone | string | null | required | |
| messages[].contact.username | string | null | required | |
| messages[].contact.name | string | required | |
| messages[].connection_id | string | required | |
| messages[].wamid | string | null | required | |
| messages[].direction | "inbound" | "outbound" | required | |
| messages[].source | "customer" | "app" | "api" | "agent" | "automation" | "ai" | "notify" | "history" | … | required | |
| messages[].status | "queued" | "sending" | "sent" | "delivered" | "read" | "played" | "failed" | "deleted" | … | required | |
| messages[].type | string | required | |
| messages[].content | object | required | |
| messages[].location | object | null | required | |
| messages[].location.latitude | number | required | |
| messages[].location.longitude | number | required | |
| messages[].location.name | string | null | required | |
| messages[].location.address | string | null | required | |
| messages[].location.url | string | null | required | |
| messages[].contact_cards | object[] | null | required | |
| messages[].contact_cards[].name | string | null | required | |
| messages[].contact_cards[].phones | object[] | required | |
| messages[].contact_cards[].emails | object[] | required | |
| messages[].contact_cards[].org | object | null | required | |
| messages[].label | string | null | required | |
| messages[].forwarded | boolean | required | |
| messages[].frequently_forwarded | boolean | required | |
| messages[].tap | object | null | required | |
| messages[].tap.kind | "button_reply" | "list_reply" | "button" | required | |
| messages[].tap.id | string | required | |
| messages[].tap.title | string | required | |
| messages[].tap.description | string | null | required | |
| messages[].template_text | object | null | required | The words a template message showed the customer: the header and body with the values the send filled in, the footer, and the button labels. Rendered from the template Cosend holds and the values the send used. An authentication template never shows its one-time code: the placeholder stays as written. When Cosend no longer holds the template, body is the text stored when it was sent and the rest is empty. null on every other message, on a template Cosend has no words for, and on a direct-mode connection. |
| messages[].template_text.header | string | null | required | |
| messages[].template_text.body | string | null | required | |
| messages[].template_text.footer | string | null | required | |
| messages[].template_text.buttons | string[] | required | |
| messages[].reply_to | object | null | required | |
| messages[].reply_to.id | string | null | required | |
| messages[].reply_to.wamid | string | required | |
| messages[].reply_to.kind | string | null | required | |
| messages[].reply_to.from | "contact" | "business" | null | required | |
| messages[].reply_to.preview | string | required | |
| messages[].reactions | object[] | required | |
| messages[].reactions[].emoji | string | required | |
| messages[].reactions[].direction | "inbound" | "outbound" | required | |
| messages[].reactions[].message_id | string | required | |
| messages[].reactions[].created_at | string (date-time) | required | |
| messages[].metadata | object | required | |
| messages[].created_at | string (date-time) | required | |
| messages[].wa_timestamp | string (date-time) | required | |
| messages[].is_imported | boolean | required | |
| messages[].media_state | "none" | "pending" | "stored" | "expired" | "unavailable" | required | |
| messages[].media_expires_at | string (date-time) | null | required | |
| messages[].media | object | null | required | The file this message carries. status is pending while Cosend fetches it from Meta, ready once it is stored (open it with GET /v1/media/{id} or /v1/media/{id}/content; id is null in the other two states), and failed with failure_reason saying why in plain words. kind is voice for a WhatsApp voice note. On a template message, the header’s image, video or document, when the send named a file uploaded to Cosend (caption is null). null on a message with no file Cosend keeps. |
| messages[].media.id | string | null | required | |
| messages[].media.kind | "image" | "video" | "audio" | "voice" | "document" | "sticker" | required | |
| messages[].media.mime_type | string | null | required | |
| messages[].media.size_bytes | integer | null | required | |
| messages[].media.filename | string | null | required | |
| messages[].media.caption | string | null | required | |
| messages[].media.animated | boolean | null | required | |
| messages[].media.status | "pending" | "ready" | "failed" | required | |
| messages[].media.failure_reason | string | null | required | |
| messages[].transcript | object | null | required | The words of an inbound voice note or audio file. null while Cosend transcribes it, and on every other message. ready carries text; failed says why in failure_reason; skipped means transcription is unavailable. The recording in media is the same whatever this says. |
| messages[].transcript.status | "ready" | "failed" | "skipped" | required | |
| messages[].transcript.text | string | null | required | |
| messages[].transcript.language | string | null | required | |
| messages[].transcript.model | string | null | required | |
| messages[].transcript.failure_reason | string | null | required | |
| messages[].client_token | string | null | required | |
| messages[].author_user_id | string | null | required | |
| messages[].automation_run_id | string | null | required | |
| messages[].campaign_id | string | null | required | |
| messages[].campaign_name | string | null | required | |
| messages[].error_code | integer | null | required | |
| messages[].error_title | string | null | required | |
| messages[].error_detail | string | null | required | |
| times_sent | integer | required |
/v1/schedules
GET /v1/schedules
List schedules
Scopes notifications:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| limit | query | integer | optional | |
| after | query | string | optional | |
| before | query | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].object | "notify_schedule" | required | |
| data[].connection_id | string | required | |
| data[].kind | string | required | |
| data[].name | string | null | required | |
| data[].to | string | null | required | |
| data[].anchor_at | string (date-time) | null | required | |
| data[].offsets_minutes | integer[] | null | required | |
| data[].timezone | string | required | |
| data[].state | string | required | |
| data[].block_reason | string | null | required | |
| data[].reference | any | null | required | |
| data[].created_at | string (date-time) | required | |
| has_more | boolean | required | |
| next_cursor | string | null | required |
POST /v1/schedules
Create or update an anchored reminder ladder
Scopes notifications:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | required |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| connection_id | string | required | |
| kind | "anchored" | "recurring" | required | |
| name | string | null | optional | |
| to | string | required | |
| anchor_at | string (date-time) | null | optional | |
| offsets_minutes | integer[] | null | optional | |
| rrule | string | optional | |
| timezone | string | optional | |
| dst_policy | "shift_forward" | "shift_back" | "skip" | "first" | "last" | optional | |
| template_by_offset | object | optional | |
| params | object | optional | |
| priority | integer | optional | |
| quiet_hours | object | optional | |
| quiet_hours.start | string | required | |
| quiet_hours.end | string | required | |
| quiet_hours.policy | "shift_to_end" | "shift_to_start" | "skip" | "ignore" | "defer_unless_urgent" | optional | |
| skip_if_late_minutes | integer | optional | |
| expires_policy | string | optional | |
| reference | object | null | optional | |
| reference.type | string | required | |
| reference.id | string | required |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "notify_schedule" | required | |
| connection_id | string | required | |
| kind | string | required | |
| name | string | null | required | |
| to | string | null | required | |
| anchor_at | string (date-time) | null | required | |
| offsets_minutes | integer[] | null | required | |
| timezone | string | required | |
| state | string | required | |
| block_reason | string | null | required | |
| reference | any | null | required | |
| occurrences | object[] | required | |
| occurrences[].id | string | required | |
| occurrences[].object | "notify_occurrence" | required | |
| occurrences[].offset_minutes | integer | null | required | |
| occurrences[].fire_at | string (date-time) | required | |
| occurrences[].state | string | required | |
| occurrences[].dedup_key | string | null | required | |
| occurrences[].expires_at | string (date-time) | null | required | |
| occurrences[].notification_id | string | null | required | |
| warnings | string[] | required | |
| created_at | string (date-time) | required |
GET /v1/schedules/{id}
One schedule and its occurrences
Scopes notifications:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "notify_schedule" | required | |
| connection_id | string | required | |
| kind | string | required | |
| name | string | null | required | |
| to | string | null | required | |
| anchor_at | string (date-time) | null | required | |
| offsets_minutes | integer[] | null | required | |
| timezone | string | required | |
| state | string | required | |
| block_reason | string | null | required | |
| reference | any | null | required | |
| occurrences | object[] | required | |
| occurrences[].id | string | required | |
| occurrences[].object | "notify_occurrence" | required | |
| occurrences[].offset_minutes | integer | null | required | |
| occurrences[].fire_at | string (date-time) | required | |
| occurrences[].state | string | required | |
| occurrences[].dedup_key | string | null | required | |
| occurrences[].expires_at | string (date-time) | null | required | |
| occurrences[].notification_id | string | null | required | |
| warnings | string[] | required | |
| created_at | string (date-time) | required |
PATCH /v1/schedules/{id}
Move the anchor and recompute the pending occurrences
Scopes notifications:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | null | optional | |
| anchor_at | string (date-time) | optional | |
| offsets_minutes | integer[] | optional | |
| timezone | string | optional | |
| dst_policy | "shift_forward" | "shift_back" | "skip" | "first" | "last" | optional | |
| template_by_offset | object | optional | |
| params | object | optional | |
| priority | integer | optional | |
| quiet_hours | object | optional | |
| quiet_hours.start | string | required | |
| quiet_hours.end | string | required | |
| quiet_hours.policy | "shift_to_end" | "shift_to_start" | "skip" | "ignore" | "defer_unless_urgent" | optional | |
| skip_if_late_minutes | integer | null | optional | |
| expires_policy | string | null | optional | |
| state | "active" | "paused" | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "notify_schedule" | required | |
| connection_id | string | required | |
| kind | string | required | |
| name | string | null | required | |
| to | string | null | required | |
| anchor_at | string (date-time) | null | required | |
| offsets_minutes | integer[] | null | required | |
| timezone | string | required | |
| state | string | required | |
| block_reason | string | null | required | |
| reference | any | null | required | |
| occurrences | object[] | required | |
| occurrences[].id | string | required | |
| occurrences[].object | "notify_occurrence" | required | |
| occurrences[].offset_minutes | integer | null | required | |
| occurrences[].fire_at | string (date-time) | required | |
| occurrences[].state | string | required | |
| occurrences[].dedup_key | string | null | required | |
| occurrences[].expires_at | string (date-time) | null | required | |
| occurrences[].notification_id | string | null | required | |
| warnings | string[] | required | |
| created_at | string (date-time) | required |
DELETE /v1/schedules/{id}
Cancel a schedule, its pending occurrences and its live notifications
Scopes notifications:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "notify_schedule" | required | |
| state | "cancelled" | required | |
| occurrences_cancelled | integer | required | |
| notifications_cancelled | integer | required | |
| already_sent | string[] | required |
GET /v1/schedules/{id}/occurrences
The resolved firing times
Scopes notifications:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| limit | query | integer | optional | |
| after | query | string | optional | |
| before | query | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].object | "notify_occurrence" | required | |
| data[].offset_minutes | integer | null | required | |
| data[].fire_at | string (date-time) | required | |
| data[].state | string | required | |
| data[].dedup_key | string | null | required | |
| data[].expires_at | string (date-time) | null | required | |
| data[].notification_id | string | null | required | |
| has_more | boolean | required | |
| next_cursor | string | null | required |
/v1/segments
GET /v1/segments
List saved audiences
Scopes contacts:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| limit | query | integer | optional | |
| after | query | string | optional | |
| before | query | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].object | "segment" | required | |
| data[].name | string | required | |
| data[].connection_id | string | required | |
| data[].definition | object | required | |
| data[].definition.tags | string[] | required | |
| data[].definition.labels | string[] | required | |
| data[].definition.fields | object[] | required | |
| data[].definition.match | "any" | "all" | required | |
| data[].created_by | string | null | required | |
| data[].created_at | string (date-time) | required | |
| data[].updated_at | string (date-time) | required | |
| has_more | boolean | required | |
| next_cursor | string | null | required |
POST /v1/segments
Save an audience: tags, chat labels and contact-field conditions, named
Scopes contacts:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | required | |
| connection_id | string | required | |
| definition | object | required | |
| definition.tags | string[] | optional | |
| definition.labels | string[] | optional | |
| definition.fields | object[] | optional | Contact-field conditions, at most 10: key is a contact field of the business, or name, locale or timezone; op is is, is_not or contains for text, is, gt or lt for a number, before, after or on for a date (YYYY-MM-DD), is or is_not for a choice (value one of its choices), is for a yes/no field (value true or false), and is_set or is_not_set for any field. |
| definition.fields[].key | string | required | |
| definition.fields[].op | "is" | "is_not" | "contains" | "gt" | "lt" | "before" | "after" | "on" | … | required | |
| definition.fields[].value | string | number | boolean | null | optional | |
| definition.match | "any" | "all" | optional |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "segment" | required | |
| name | string | required | |
| connection_id | string | required | |
| definition | object | required | |
| definition.tags | string[] | required | |
| definition.labels | string[] | required | |
| definition.fields | object[] | required | |
| definition.fields[].key | string | required | |
| definition.fields[].op | "is" | "is_not" | "contains" | "gt" | "lt" | "before" | "after" | "on" | … | required | |
| definition.fields[].value | string | number | boolean | null | required | |
| definition.match | "any" | "all" | required | |
| created_by | string | null | required | |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required |
GET /v1/segments/{id}
One saved audience
Scopes contacts:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "segment" | required | |
| name | string | required | |
| connection_id | string | required | |
| definition | object | required | |
| definition.tags | string[] | required | |
| definition.labels | string[] | required | |
| definition.fields | object[] | required | |
| definition.fields[].key | string | required | |
| definition.fields[].op | "is" | "is_not" | "contains" | "gt" | "lt" | "before" | "after" | "on" | … | required | |
| definition.fields[].value | string | number | boolean | null | required | |
| definition.match | "any" | "all" | required | |
| created_by | string | null | required | |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required |
PATCH /v1/segments/{id}
Rename a saved audience or change who it names
Scopes contacts:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | optional | |
| definition | object | optional | |
| definition.tags | string[] | optional | |
| definition.labels | string[] | optional | |
| definition.fields | object[] | optional | Contact-field conditions, at most 10: key is a contact field of the business, or name, locale or timezone; op is is, is_not or contains for text, is, gt or lt for a number, before, after or on for a date (YYYY-MM-DD), is or is_not for a choice (value one of its choices), is for a yes/no field (value true or false), and is_set or is_not_set for any field. |
| definition.fields[].key | string | required | |
| definition.fields[].op | "is" | "is_not" | "contains" | "gt" | "lt" | "before" | "after" | "on" | … | required | |
| definition.fields[].value | string | number | boolean | null | optional | |
| definition.match | "any" | "all" | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "segment" | required | |
| name | string | required | |
| connection_id | string | required | |
| definition | object | required | |
| definition.tags | string[] | required | |
| definition.labels | string[] | required | |
| definition.fields | object[] | required | |
| definition.fields[].key | string | required | |
| definition.fields[].op | "is" | "is_not" | "contains" | "gt" | "lt" | "before" | "after" | "on" | … | required | |
| definition.fields[].value | string | number | boolean | null | required | |
| definition.match | "any" | "all" | required | |
| created_by | string | null | required | |
| created_at | string (date-time) | required | |
| updated_at | string (date-time) | required |
DELETE /v1/segments/{id}
Delete a saved audience
Scopes contacts:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "segment" | required | |
| deleted | true | required |
POST /v1/segments/preview
How many people of the number’s business match these tags, labels and contact-field conditions, now
Scopes contacts:read
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| connection_id | string | required | |
| definition | object | required | |
| definition.tags | string[] | optional | |
| definition.labels | string[] | optional | |
| definition.fields | object[] | optional | Contact-field conditions, at most 10: key is a contact field of the business, or name, locale or timezone; op is is, is_not or contains for text, is, gt or lt for a number, before, after or on for a date (YYYY-MM-DD), is or is_not for a choice (value one of its choices), is for a yes/no field (value true or false), and is_set or is_not_set for any field. |
| definition.fields[].key | string | required | |
| definition.fields[].op | "is" | "is_not" | "contains" | "gt" | "lt" | "before" | "after" | "on" | … | required | |
| definition.fields[].value | string | number | boolean | null | optional | |
| definition.match | "any" | "all" | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "segment_preview" | required | |
| matched | integer | required |
/v1/setup
GET /v1/setup
The setup guide: each step done, to do or skipped, from the workspace’s own facts
Scopes settings:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| steps | object[] | required | |
| steps[].key | "account" | "connect" | "first_message" | "invite" | "first_automation" | required | |
| steps[].state | "done" | "todo" | "skipped" | required | |
| steps[].done_at | string (date-time) | null | required | |
| hidden | boolean | required | |
| n_done | integer | required | |
| n_total | integer | required |
PATCH /v1/setup
Hide or show the setup guide, or skip steps. Owners and admins
Scopes any credential
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| hidden | boolean | optional | |
| skipped | ("connect" | "first_message" | "invite" | "first_automation")[] | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| steps | object[] | required | |
| steps[].key | "account" | "connect" | "first_message" | "invite" | "first_automation" | required | |
| steps[].state | "done" | "todo" | "skipped" | required | |
| steps[].done_at | string (date-time) | null | required | |
| hidden | boolean | required | |
| n_done | integer | required | |
| n_total | integer | required |
/v1/setup-links
POST /v1/setup-links
A 30-minute link to a page where the person who asked connects a number, signs in to integrations, upgrades or adds a card
Scopes any credential
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| kind | "connect_number" | required | |
| connection_id | string | required | The WhatsApp number to reconnect, by its connection id. The person runs Meta’s flow again for it, and the link completes when that number is connected. |
| connectors | string[] | required | The integrations the person signs in to, by key from GET /v1/connectors. The link completes when every one of them has an account. |
| account_id | string | optional | To replace the key of an account that already exists: its id, with its one connector in connectors. The person types the new key on the page, and the link completes when that account’s key is saved. |
| plan | string | required | The plan to buy, by code from GET /v1/billing/plans. Only for a workspace with no paid subscription, and only to a higher plan. |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "setup_link" | required | |
| kind | "connect_number" | "reconnect_number" | "connect_integrations" | "pick_google_file" | "upgrade" | "payment_method" | required | |
| status | "open" | "completed" | "expired" | "cancelled" | required | open until the step is done (completed), 30 minutes pass (expired) or it is cancelled or replaced by a newer link of the same kind (cancelled). |
| url | string | required | The page to send the person to. Its address carries the workspace id (?org=) and no credential: it opens only for the person who asked for the link, signed in to Cosend. |
| connectors | string[] | required | |
| plan | string | null | required | |
| connection_id | string | null | required | reconnect_number: the number being reconnected. null for the other kinds. |
| account_id | string | null | required | pick_google_file, or connect_integrations replacing a key: the account. null for the other kinds. |
| result | object | null | required | What the step set up: the number (connect_number, reconnect_number), the accounts (connect_integrations, filled in one by one while open; pick_google_file), or the plan and subscription status (upgrade, payment_method). An account connected from the page is on the workspace’s only number, or on no number when it has several; add one with POST /v1/connector-accounts/{id}/numbers. null until something is set up. |
| result.connection_id | string | null | required | |
| result.phone_number | string | null | required | |
| result.connector_accounts | object[] | required | |
| result.connector_accounts[].connector | string | required | |
| result.connector_accounts[].account_id | string | required | |
| result.plan | string | null | required | |
| result.subscription_status | string | null | required | |
| expires_at | string (date-time) | required | |
| completed_at | string (date-time) | null | required | |
| created_at | string (date-time) | required |
GET /v1/setup-links/{id}
A set-up link: open, completed (with what was set up), expired or cancelled. Only for the person who asked for it
Scopes any credential
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "setup_link" | required | |
| kind | "connect_number" | "reconnect_number" | "connect_integrations" | "pick_google_file" | "upgrade" | "payment_method" | required | |
| status | "open" | "completed" | "expired" | "cancelled" | required | open until the step is done (completed), 30 minutes pass (expired) or it is cancelled or replaced by a newer link of the same kind (cancelled). |
| url | string | required | The page to send the person to. Its address carries the workspace id (?org=) and no credential: it opens only for the person who asked for the link, signed in to Cosend. |
| connectors | string[] | required | |
| plan | string | null | required | |
| connection_id | string | null | required | reconnect_number: the number being reconnected. null for the other kinds. |
| account_id | string | null | required | pick_google_file, or connect_integrations replacing a key: the account. null for the other kinds. |
| result | object | null | required | What the step set up: the number (connect_number, reconnect_number), the accounts (connect_integrations, filled in one by one while open; pick_google_file), or the plan and subscription status (upgrade, payment_method). An account connected from the page is on the workspace’s only number, or on no number when it has several; add one with POST /v1/connector-accounts/{id}/numbers. null until something is set up. |
| result.connection_id | string | null | required | |
| result.phone_number | string | null | required | |
| result.connector_accounts | object[] | required | |
| result.connector_accounts[].connector | string | required | |
| result.connector_accounts[].account_id | string | required | |
| result.plan | string | null | required | |
| result.subscription_status | string | null | required | |
| expires_at | string (date-time) | required | |
| completed_at | string (date-time) | null | required | |
| created_at | string (date-time) | required |
DELETE /v1/setup-links/{id}
Cancel an open set-up link. Only for the person who asked for it
Scopes any credential
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "setup_link" | required | |
| kind | "connect_number" | "reconnect_number" | "connect_integrations" | "pick_google_file" | "upgrade" | "payment_method" | required | |
| status | "open" | "completed" | "expired" | "cancelled" | required | open until the step is done (completed), 30 minutes pass (expired) or it is cancelled or replaced by a newer link of the same kind (cancelled). |
| url | string | required | The page to send the person to. Its address carries the workspace id (?org=) and no credential: it opens only for the person who asked for the link, signed in to Cosend. |
| connectors | string[] | required | |
| plan | string | null | required | |
| connection_id | string | null | required | reconnect_number: the number being reconnected. null for the other kinds. |
| account_id | string | null | required | pick_google_file, or connect_integrations replacing a key: the account. null for the other kinds. |
| result | object | null | required | What the step set up: the number (connect_number, reconnect_number), the accounts (connect_integrations, filled in one by one while open; pick_google_file), or the plan and subscription status (upgrade, payment_method). An account connected from the page is on the workspace’s only number, or on no number when it has several; add one with POST /v1/connector-accounts/{id}/numbers. null until something is set up. |
| result.connection_id | string | null | required | |
| result.phone_number | string | null | required | |
| result.connector_accounts | object[] | required | |
| result.connector_accounts[].connector | string | required | |
| result.connector_accounts[].account_id | string | required | |
| result.plan | string | null | required | |
| result.subscription_status | string | null | required | |
| expires_at | string (date-time) | required | |
| completed_at | string (date-time) | null | required | |
| created_at | string (date-time) | required |
/v1/stats
GET /v1/stats/today
Today in the workspace’s time zone: replies by who sent them, and chats handed over, marked Done and opened
Scopes messages:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| connection_id | query | string | string[] | optional | WhatsApp numbers (connection ids), repeatable: the rows for any of them. Automations: those on it, and those with no number, which run on every number. Runs: those that ran on it, and those that name no number of their own whose automation is one of these. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| replies_total | integer | required | |
| replies_by | object | required | |
| replies_by.assistant | integer | required | |
| replies_by.people | integer | required | |
| replies_by.phone | integer | required | |
| replies_by.automations | integer | required | |
| handed_over | integer | required | |
| resolved | integer | required | |
| new_chats | integer | required | |
| receptionist | object | required | The AI receptionist’s chats today, counted as its own page (GET /v1/automations/{id}/stats) and Reports (GET /v1/reports/receptionist) count them. |
| receptionist.ai_handled | integer | required | Chats the AI receptionist answered or passed to a person today: answered_alone plus handed_over. |
| receptionist.answered_alone | integer | required | Of them, chats the AI answered and nobody passed to a person today. |
| receptionist.handed_over | integer | required | Of them, chats passed to a person today: by the AI receptionist, or by anyone in a chat the AI answered today. |
| tz | string | required | |
| since | string (date-time) | required |
GET /v1/stats/week
The last 7 days, today and the 6 before it in the workspace’s time zone: replies and new chats a day
Scopes messages:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| connection_id | query | string | string[] | optional | WhatsApp numbers (connection ids), repeatable: the rows for any of them. Automations: those on it, and those with no number, which run on every number. Runs: those that ran on it, and those that name no number of their own whose automation is one of these. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| tz | string | required | |
| days | object[] | required | |
| days[].date | string (date) | required | |
| days[].replies_assistant | integer | required | |
| days[].replies_people | integer | required | |
| days[].replies_phone | integer | required | |
| days[].new_chats | integer | required |
/v1/stream
GET /v1/stream
Server-Sent Events for the inbox
Scopes messages:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| connection_id | query | string | string[] | optional | |
| events | query | string | optional |
Response 200
An open Server-Sent Events stream, not a single body: id:/event:/data: frames terminated by a blank line, : keepalive comments, resumable with Last-Event-ID, and a clean close after one hour. text/event-stream
/v1/support-access
GET /v1/support-access
Whether Cosend support may work in this workspace, and until when
Scopes any credential
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| status | "off" | required | |
| granted_by | object | required | |
| granted_by.user_id | string | required | |
| granted_by.name | string | null | required | |
| granted_at | string (date-time) | required | |
| ends_at | string (date-time) | required |
POST /v1/support-access
Let Cosend support work in this workspace for 1, 7 or 30 days, or extend it
Scopes any credential
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| days | 1 | 7 | 30 | required |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| status | "off" | required | |
| granted_by | object | required | |
| granted_by.user_id | string | required | |
| granted_by.name | string | null | required | |
| granted_at | string (date-time) | required | |
| ends_at | string (date-time) | required |
DELETE /v1/support-access
End Cosend support’s access to this workspace now
Scopes any credential
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| status | "off" | required |
/v1/support-reports
POST /v1/support-reports
File a bug report. The payload is an allowlist: message content is refused, not stripped
Scopes any credential
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | optional |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "support_report" | required | |
| request_id | string | required | |
| created_at | string (date-time) | required |
/v1/templates
GET /v1/templates
The workspace’s templates, filterable by status, language, category, WhatsApp Business account and connection
Scopes templates:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| status | query | "pending" | "approved" | "rejected" | "paused" | "disabled" | "in_appeal" | "pending_deletion" | "deleted" | … | optional | Meta's review status, in lowercase, or one of Cosend's own two. sending: Meta did not answer the create, and Cosend is finishing it: it asks Meta whether it has the template and creates it only when Meta does not, right away, 10 seconds later and 30 seconds after that. unsent: none of those three tries got an answer; Cosend keeps the template as it was submitted, and POST /v1/templates/{id}/submit sends it again. |
| language | query | string | optional | |
| category | query | "marketing" | "utility" | "authentication" | optional | |
| waba_id | query | string | string[] | optional | A WhatsApp Business Account, as Cosend's wab_ id (a connection's waba_id, not its meta_waba_id): only its templates. Repeat it for several accounts. |
| connection_id | query | string | string[] | optional | A connection's id: only the templates of that connection's WhatsApp Business account, which every number on the account shares. Repeat it for several numbers; numbers on one account give its templates once. A connection this workspace does not have is connection_not_found. Given with waba_id, a template must match both. |
| limit | query | integer | optional | |
| after | query | string | optional | |
| before | query | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].waba_id | string | required | The WhatsApp Business Account the template belongs to, as Cosend's wab_ id: the waba_id a connection carries (Meta's id is the connection's meta_waba_id) and GET /v1/templates?waba_id= takes. Every number on that account can send it. |
| data[].name | string | required | The system name: Meta's name for the template (lowercase letters, digits and underscores), and the name sends, automations and "name:language" lookups use. Generated from display_name when the template is created, and never changed after. |
| data[].display_name | string | required | The human name, as typed when the template was created (e.g. "Order shipped"). A template with no display name, such as one first seen by a sync, carries its system name here. |
| data[].language | string | required | |
| data[].category | "marketing" | "utility" | "authentication" | required | |
| data[].status | "pending" | "approved" | "rejected" | "paused" | "disabled" | "in_appeal" | "pending_deletion" | "deleted" | … | required | Meta's review status, in lowercase, or one of Cosend's own two. sending: Meta did not answer the create, and Cosend is finishing it: it asks Meta whether it has the template and creates it only when Meta does not, right away, 10 seconds later and 30 seconds after that. unsent: none of those three tries got an answer; Cosend keeps the template as it was submitted, and POST /v1/templates/{id}/submit sends it again. |
| data[].variables | string[] | required | |
| data[].sendable | boolean | required | |
| data[].paused_until | string | null | required | |
| data[].pause_level | string | null | required | |
| data[].rejected_reason | "invalid_format" | "incorrect_category" | "abusive_content" | "promotional" | "scam" | "tag_content_mismatch" | "category_not_available" | "none" | null | required | |
| data[].rejection | object | null | required | |
| data[].rejection.code | "invalid_format" | "incorrect_category" | "abusive_content" | "promotional" | "scam" | "tag_content_mismatch" | "category_not_available" | "none" | required | |
| data[].rejection.title | string | required | |
| data[].rejection.fix | string | required | |
| data[].rejection.detail | string | null | required | |
| data[].rejection.recommendation | string | null | required | |
| data[].rejection.review_url | string | required | |
| data[].edit | object | required | |
| data[].edit.allowed | boolean | required | |
| data[].edit.reason | string | null | required | Why the template cannot be edited now, in words: Meta edits approved, rejected and paused templates only, and an approved one once in 24 hours and 10 times in 30 days. null when it can. |
| data[].edit.available_at | string (date-time) | null | required | When the edit limit on this approved template next allows an edit. Counts the edits made through Cosend; null when the limit is not what stops it. |
| data[].edit.category_allowed | boolean | required | Whether an edit may change the category. Meta refuses it on an approved template. |
| data[].quality_score | "green" | "yellow" | "red" | "na" | null | required | |
| data[].components | any | required | |
| data[].authentication | object | null | required | An authentication template's security note, expiry and one-time-password button, in the shape create and edit take. Meta writes the body: "{{1}} is your verification code." null for a template with no one-time-password button. |
| data[].authentication.add_security_recommendation | boolean | required | |
| data[].authentication.code_expiration_minutes | integer | null | required | |
| data[].authentication.delivery | object | required | |
| data[].authentication.message_send_ttl_seconds | integer | null | required | The time-to-live Cosend set: 30 to 900 seconds, or -1 for 30 days. null: WhatsApp's default, or not known for a template made outside Cosend. |
| data[].tracked_links | object[] | required | The URL buttons whose clicks Cosend counts: each button's place among the buttons (from 0) and the page it opens. Such a button's url in components is Cosend's redirect, which counts the tap and opens this page. Give track_clicks: true on a URL button in a create or an edit to count its clicks. |
| data[].tracked_links[].index | integer | required | |
| data[].tracked_links[].url | string | required | |
| has_more | boolean | required | |
| next_cursor | string | null | required |
Errors connection_not_found
POST /v1/templates
Create a template at Meta and keep a copy in Cosend
Scopes templates:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | optional |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| connection_id | string | required | |
| display_name | string | optional | The human name, free text (e.g. "Order shipped"). When name is left out, the system name is generated from it: lowercase, accents dropped, every other run of characters an underscore, at most 512 characters, with _2, _3… added when a template on the WhatsApp Business account already has that name. |
| name | string | optional | The system name, used as given. Optional: leave it out and it is generated from display_name. Give it to add a language to an existing template. One of name and display_name is required. |
| language | string | optional | The language, e.g. "en_US". Required on every category but authentication, which takes authentication.languages instead. |
| category | "marketing" | "utility" | "authentication" | required | |
| parameter_format | "positional" | "named" | optional | |
| components | object[] | optional | Meta's components; required on every category but authentication, which takes authentication instead. A HEADER carries its format (TEXT, IMAGE, VIDEO, DOCUMENT or LOCATION), and a header without one is sent as TEXT. An IMAGE, VIDEO or DOCUMENT header's sample is a file uploaded with POST /v1/media, named by its id in Meta's own field: {"type": "HEADER", "format": "IMAGE", "example": {"header_handle": ["med_…"]}}. The file must be a JPEG or PNG image of at most 5 MB, an MP4 video of at most 16 MB, or a PDF of at most 100 MB (WhatsApp's limits), and Cosend uploads it to Meta and sends Meta's handle in its place; a handle from Meta itself is sent as it is. A LOCATION header takes no sample, and only a utility or marketing template can have one. |
| components[].type | "BUTTONS" | required | |
| components[].buttons | object[] | required | |
| components[].buttons[].type | "QUICK_REPLY" | required | |
| components[].buttons[].text | string | required | |
| components[].buttons[].url | string | required | |
| components[].buttons[].example | string[] | optional | |
| components[].buttons[].track_clicks | boolean | optional | |
| components[].buttons[].phone_number | string | required | |
| authentication | object | null | optional | An authentication template, in Meta's shape, in place of components and language: {"languages": ["fr", "en_US"], "add_security_recommendation": true, "code_expiration_minutes": 10, "delivery": {"type": "copy_code"}, "message_send_ttl_seconds": 600}. WhatsApp writes the message and the button label in each language ("{{1}} is your verification code." in English); there is no text to set. One template is created per language, each its own resource; the answer is the version in the first language. Required when category is authentication, and refused on any other category; null is the same as leaving it out. |
| authentication.languages | string[] | required | The language versions to create, e.g. ["fr", "en_US"]: one template per language, each written by WhatsApp in its language. On an edit, left out or exactly the template's own language. |
| authentication.add_security_recommendation | boolean | required | Whether Meta adds "For your security, do not share this code." to the body. |
| authentication.code_expiration_minutes | integer | null | optional | Minutes the code stays valid, 1 to 90: Meta's footer "This code expires in N minutes." Left out or null, there is no footer. |
| authentication.delivery | object | required | How the code reaches the person: {"type": "copy_code"}, or {"type": "one_tap" | "zero_tap", "apps": [{"package_name": "com.example.app", "signature_hash": "K8a/AINcGX7"}]} (1 to 5 apps); zero-tap also takes "zero_tap_terms_accepted": true. |
| authentication.delivery.type | "copy_code" | required | |
| authentication.delivery.apps | object[] | required | The Android apps the code is handed to: 1 to 5, Meta's supported_apps. |
| authentication.delivery.zero_tap_terms_accepted | true | required | Meta's zero_tap_terms_accepted: "Set to true to indicate that you understand that your use of zero-tap authentication is subject to the WhatsApp Business Terms of Service." Sent to Meta and recorded in the audit log. |
| authentication.message_send_ttl_seconds | integer | null | optional | How long WhatsApp keeps trying to deliver the message: 30 to 900 seconds, or -1 for 30 days. Left out or null, WhatsApp's default for authentication, 10 minutes. |
| authentication.button | any | optional | Refused. WhatsApp writes the button label in each language; there is no text to set. Give delivery instead: {"type": "copy_code"}. |
| example_values | object | optional | A sample value for every variable in the TEXT header and the body, keyed per component by the name between the braces: {"body": {"1": "Pablo", "2": "860198-230332"}} or {"body": {"first_name": "Pablo"}}. Required for each such variable, because Meta rejects a template without samples; a missing one is refused with invalid_request, param example_values. Sent to Meta as each component's example. A component that already carries Meta's own example and has no entry here is sent as it is. |
| example_values.header | object | optional | |
| example_values.body | object | optional |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| waba_id | string | required | The WhatsApp Business Account the template belongs to, as Cosend's wab_ id: the waba_id a connection carries (Meta's id is the connection's meta_waba_id) and GET /v1/templates?waba_id= takes. Every number on that account can send it. |
| name | string | required | The system name: Meta's name for the template (lowercase letters, digits and underscores), and the name sends, automations and "name:language" lookups use. Generated from display_name when the template is created, and never changed after. |
| display_name | string | required | The human name, as typed when the template was created (e.g. "Order shipped"). A template with no display name, such as one first seen by a sync, carries its system name here. |
| language | string | required | |
| category | "marketing" | "utility" | "authentication" | required | |
| status | "pending" | "approved" | "rejected" | "paused" | "disabled" | "in_appeal" | "pending_deletion" | "deleted" | … | required | Meta's review status, in lowercase, or one of Cosend's own two. sending: Meta did not answer the create, and Cosend is finishing it: it asks Meta whether it has the template and creates it only when Meta does not, right away, 10 seconds later and 30 seconds after that. unsent: none of those three tries got an answer; Cosend keeps the template as it was submitted, and POST /v1/templates/{id}/submit sends it again. |
| variables | string[] | required | |
| sendable | boolean | required | |
| paused_until | string | null | required | |
| pause_level | string | null | required | |
| rejected_reason | "invalid_format" | "incorrect_category" | "abusive_content" | "promotional" | "scam" | "tag_content_mismatch" | "category_not_available" | "none" | null | required | |
| rejection | object | null | required | |
| rejection.code | "invalid_format" | "incorrect_category" | "abusive_content" | "promotional" | "scam" | "tag_content_mismatch" | "category_not_available" | "none" | required | |
| rejection.title | string | required | |
| rejection.fix | string | required | |
| rejection.detail | string | null | required | |
| rejection.recommendation | string | null | required | |
| rejection.review_url | string | required | |
| edit | object | required | |
| edit.allowed | boolean | required | |
| edit.reason | string | null | required | Why the template cannot be edited now, in words: Meta edits approved, rejected and paused templates only, and an approved one once in 24 hours and 10 times in 30 days. null when it can. |
| edit.available_at | string (date-time) | null | required | When the edit limit on this approved template next allows an edit. Counts the edits made through Cosend; null when the limit is not what stops it. |
| edit.category_allowed | boolean | required | Whether an edit may change the category. Meta refuses it on an approved template. |
| quality_score | "green" | "yellow" | "red" | "na" | null | required | |
| components | any | required | |
| authentication | object | null | required | An authentication template's security note, expiry and one-time-password button, in the shape create and edit take. Meta writes the body: "{{1}} is your verification code." null for a template with no one-time-password button. |
| authentication.add_security_recommendation | boolean | required | |
| authentication.code_expiration_minutes | integer | null | required | |
| authentication.delivery | object | required | |
| authentication.delivery.type | "copy_code" | "one_tap" | "zero_tap" | required | Meta's otp_type. |
| authentication.delivery.apps | object[] | optional | One-tap and zero-tap: the Android apps the code is handed to (Meta's supported_apps), when the template carries them. |
| authentication.message_send_ttl_seconds | integer | null | required | The time-to-live Cosend set: 30 to 900 seconds, or -1 for 30 days. null: WhatsApp's default, or not known for a template made outside Cosend. |
| tracked_links | object[] | required | The URL buttons whose clicks Cosend counts: each button's place among the buttons (from 0) and the page it opens. Such a button's url in components is Cosend's redirect, which counts the tap and opens this page. Give track_clicks: true on a URL button in a create or an edit to count its clicks. |
| tracked_links[].index | integer | required | |
| tracked_links[].url | string | required | |
| first_use | boolean | required |
Errors invalid_request
GET /v1/templates/{id}
One template. Accepts a tpl_ id or name:language
Scopes templates:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| waba_id | string | required | The WhatsApp Business Account the template belongs to, as Cosend's wab_ id: the waba_id a connection carries (Meta's id is the connection's meta_waba_id) and GET /v1/templates?waba_id= takes. Every number on that account can send it. |
| name | string | required | The system name: Meta's name for the template (lowercase letters, digits and underscores), and the name sends, automations and "name:language" lookups use. Generated from display_name when the template is created, and never changed after. |
| display_name | string | required | The human name, as typed when the template was created (e.g. "Order shipped"). A template with no display name, such as one first seen by a sync, carries its system name here. |
| language | string | required | |
| category | "marketing" | "utility" | "authentication" | required | |
| status | "pending" | "approved" | "rejected" | "paused" | "disabled" | "in_appeal" | "pending_deletion" | "deleted" | … | required | Meta's review status, in lowercase, or one of Cosend's own two. sending: Meta did not answer the create, and Cosend is finishing it: it asks Meta whether it has the template and creates it only when Meta does not, right away, 10 seconds later and 30 seconds after that. unsent: none of those three tries got an answer; Cosend keeps the template as it was submitted, and POST /v1/templates/{id}/submit sends it again. |
| variables | string[] | required | |
| sendable | boolean | required | |
| paused_until | string | null | required | |
| pause_level | string | null | required | |
| rejected_reason | "invalid_format" | "incorrect_category" | "abusive_content" | "promotional" | "scam" | "tag_content_mismatch" | "category_not_available" | "none" | null | required | |
| rejection | object | null | required | |
| rejection.code | "invalid_format" | "incorrect_category" | "abusive_content" | "promotional" | "scam" | "tag_content_mismatch" | "category_not_available" | "none" | required | |
| rejection.title | string | required | |
| rejection.fix | string | required | |
| rejection.detail | string | null | required | |
| rejection.recommendation | string | null | required | |
| rejection.review_url | string | required | |
| edit | object | required | |
| edit.allowed | boolean | required | |
| edit.reason | string | null | required | Why the template cannot be edited now, in words: Meta edits approved, rejected and paused templates only, and an approved one once in 24 hours and 10 times in 30 days. null when it can. |
| edit.available_at | string (date-time) | null | required | When the edit limit on this approved template next allows an edit. Counts the edits made through Cosend; null when the limit is not what stops it. |
| edit.category_allowed | boolean | required | Whether an edit may change the category. Meta refuses it on an approved template. |
| quality_score | "green" | "yellow" | "red" | "na" | null | required | |
| components | any | required | |
| authentication | object | null | required | An authentication template's security note, expiry and one-time-password button, in the shape create and edit take. Meta writes the body: "{{1}} is your verification code." null for a template with no one-time-password button. |
| authentication.add_security_recommendation | boolean | required | |
| authentication.code_expiration_minutes | integer | null | required | |
| authentication.delivery | object | required | |
| authentication.delivery.type | "copy_code" | "one_tap" | "zero_tap" | required | Meta's otp_type. |
| authentication.delivery.apps | object[] | optional | One-tap and zero-tap: the Android apps the code is handed to (Meta's supported_apps), when the template carries them. |
| authentication.message_send_ttl_seconds | integer | null | required | The time-to-live Cosend set: 30 to 900 seconds, or -1 for 30 days. null: WhatsApp's default, or not known for a template made outside Cosend. |
| tracked_links | object[] | required | The URL buttons whose clicks Cosend counts: each button's place among the buttons (from 0) and the page it opens. Such a button's url in components is Cosend's redirect, which counts the tap and opens this page. Give track_clicks: true on a URL button in a create or an edit to count its clicks. |
| tracked_links[].index | integer | required | |
| tracked_links[].url | string | required |
PATCH /v1/templates/{id}
Edit an approved, rejected or paused template at Meta; all its components are replaced and it goes back to review
Scopes templates:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | optional |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | optional | The template's system name, which an edit keeps. Send the template's own name, or leave it out. |
| language | string | optional | The template's language, which an edit keeps. Send the template's own language, or leave it out. |
| category | "marketing" | "utility" | "authentication" | optional | A new category, sent to Meta when it differs. Meta refuses a change on an approved template, so that is refused here first. |
| parameter_format | "positional" | "named" | optional | |
| components | object[] | optional | Meta's components, all of them; required on every category but authentication, which takes authentication instead. |
| components[].type | "BUTTONS" | required | |
| components[].buttons | object[] | required | |
| components[].buttons[].type | "QUICK_REPLY" | required | |
| components[].buttons[].text | string | required | |
| components[].buttons[].url | string | required | |
| components[].buttons[].example | string[] | optional | |
| components[].buttons[].track_clicks | boolean | optional | |
| components[].buttons[].phone_number | string | required | |
| authentication | object | null | optional | An authentication template's choices, as create takes them. An edit is one language version: languages is left out, or exactly the template's own language. |
| authentication.languages | string[] | optional | The language versions to create, e.g. ["fr", "en_US"]: one template per language, each written by WhatsApp in its language. On an edit, left out or exactly the template's own language. |
| authentication.add_security_recommendation | boolean | required | Whether Meta adds "For your security, do not share this code." to the body. |
| authentication.code_expiration_minutes | integer | null | optional | Minutes the code stays valid, 1 to 90: Meta's footer "This code expires in N minutes." Left out or null, there is no footer. |
| authentication.delivery | object | required | How the code reaches the person: {"type": "copy_code"}, or {"type": "one_tap" | "zero_tap", "apps": [{"package_name": "com.example.app", "signature_hash": "K8a/AINcGX7"}]} (1 to 5 apps); zero-tap also takes "zero_tap_terms_accepted": true. |
| authentication.delivery.type | "copy_code" | required | |
| authentication.delivery.apps | object[] | required | The Android apps the code is handed to: 1 to 5, Meta's supported_apps. |
| authentication.delivery.zero_tap_terms_accepted | true | required | Meta's zero_tap_terms_accepted: "Set to true to indicate that you understand that your use of zero-tap authentication is subject to the WhatsApp Business Terms of Service." Sent to Meta and recorded in the audit log. |
| authentication.message_send_ttl_seconds | integer | null | optional | How long WhatsApp keeps trying to deliver the message: 30 to 900 seconds, or -1 for 30 days. Left out or null, WhatsApp's default for authentication, 10 minutes. |
| authentication.button | any | optional | Refused. WhatsApp writes the button label in each language; there is no text to set. Give delivery instead: {"type": "copy_code"}. |
| example_values | object | optional | A sample value for every variable in the TEXT header and the body, keyed per component by the name between the braces: {"body": {"1": "Pablo", "2": "860198-230332"}} or {"body": {"first_name": "Pablo"}}. Required for each such variable, because Meta rejects a template without samples; a missing one is refused with invalid_request, param example_values. Sent to Meta as each component's example. A component that already carries Meta's own example and has no entry here is sent as it is. |
| example_values.header | object | optional | |
| example_values.body | object | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| waba_id | string | required | The WhatsApp Business Account the template belongs to, as Cosend's wab_ id: the waba_id a connection carries (Meta's id is the connection's meta_waba_id) and GET /v1/templates?waba_id= takes. Every number on that account can send it. |
| name | string | required | The system name: Meta's name for the template (lowercase letters, digits and underscores), and the name sends, automations and "name:language" lookups use. Generated from display_name when the template is created, and never changed after. |
| display_name | string | required | The human name, as typed when the template was created (e.g. "Order shipped"). A template with no display name, such as one first seen by a sync, carries its system name here. |
| language | string | required | |
| category | "marketing" | "utility" | "authentication" | required | |
| status | "pending" | "approved" | "rejected" | "paused" | "disabled" | "in_appeal" | "pending_deletion" | "deleted" | … | required | Meta's review status, in lowercase, or one of Cosend's own two. sending: Meta did not answer the create, and Cosend is finishing it: it asks Meta whether it has the template and creates it only when Meta does not, right away, 10 seconds later and 30 seconds after that. unsent: none of those three tries got an answer; Cosend keeps the template as it was submitted, and POST /v1/templates/{id}/submit sends it again. |
| variables | string[] | required | |
| sendable | boolean | required | |
| paused_until | string | null | required | |
| pause_level | string | null | required | |
| rejected_reason | "invalid_format" | "incorrect_category" | "abusive_content" | "promotional" | "scam" | "tag_content_mismatch" | "category_not_available" | "none" | null | required | |
| rejection | object | null | required | |
| rejection.code | "invalid_format" | "incorrect_category" | "abusive_content" | "promotional" | "scam" | "tag_content_mismatch" | "category_not_available" | "none" | required | |
| rejection.title | string | required | |
| rejection.fix | string | required | |
| rejection.detail | string | null | required | |
| rejection.recommendation | string | null | required | |
| rejection.review_url | string | required | |
| edit | object | required | |
| edit.allowed | boolean | required | |
| edit.reason | string | null | required | Why the template cannot be edited now, in words: Meta edits approved, rejected and paused templates only, and an approved one once in 24 hours and 10 times in 30 days. null when it can. |
| edit.available_at | string (date-time) | null | required | When the edit limit on this approved template next allows an edit. Counts the edits made through Cosend; null when the limit is not what stops it. |
| edit.category_allowed | boolean | required | Whether an edit may change the category. Meta refuses it on an approved template. |
| quality_score | "green" | "yellow" | "red" | "na" | null | required | |
| components | any | required | |
| authentication | object | null | required | An authentication template's security note, expiry and one-time-password button, in the shape create and edit take. Meta writes the body: "{{1}} is your verification code." null for a template with no one-time-password button. |
| authentication.add_security_recommendation | boolean | required | |
| authentication.code_expiration_minutes | integer | null | required | |
| authentication.delivery | object | required | |
| authentication.delivery.type | "copy_code" | "one_tap" | "zero_tap" | required | Meta's otp_type. |
| authentication.delivery.apps | object[] | optional | One-tap and zero-tap: the Android apps the code is handed to (Meta's supported_apps), when the template carries them. |
| authentication.message_send_ttl_seconds | integer | null | required | The time-to-live Cosend set: 30 to 900 seconds, or -1 for 30 days. null: WhatsApp's default, or not known for a template made outside Cosend. |
| tracked_links | object[] | required | The URL buttons whose clicks Cosend counts: each button's place among the buttons (from 0) and the page it opens. Such a button's url in components is Cosend's redirect, which counts the tap and opens this page. Give track_clicks: true on a URL button in a create or an edit to count its clicks. |
| tracked_links[].index | integer | required | |
| tracked_links[].url | string | required |
Errors invalid_request
DELETE /v1/templates/{id}
Delete it at Meta; it leaves Cosend only once Meta confirms, and a refusal is Meta’s words
Scopes templates:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "template" | required | |
| deleted | true | required | |
| status | "pending" | "approved" | "rejected" | "paused" | "disabled" | "in_appeal" | "pending_deletion" | "deleted" | … | required | Meta's review status, in lowercase, or one of Cosend's own two. sending: Meta did not answer the create, and Cosend is finishing it: it asks Meta whether it has the template and creates it only when Meta does not, right away, 10 seconds later and 30 seconds after that. unsent: none of those three tries got an answer; Cosend keeps the template as it was submitted, and POST /v1/templates/{id}/submit sends it again. |
POST /v1/templates/{id}/copy
Copy one language version to another WhatsApp account of the same business; Meta reviews it there again
Scopes templates:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | optional |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| waba_id | string | required | The WhatsApp Business Account to copy to, as Cosend's wab_ id (a connection's waba_id, not its meta_waba_id). It must be another account of the same business portfolio. |
| display_name | string | optional | A new human name for the copy, from which its system name is made (with _2, _3… added when the account already has that name). Without it the copy keeps the template’s names, and an account that already has a template of that name in that language is 409 template_name_taken. |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| waba_id | string | required | The WhatsApp Business Account the template belongs to, as Cosend's wab_ id: the waba_id a connection carries (Meta's id is the connection's meta_waba_id) and GET /v1/templates?waba_id= takes. Every number on that account can send it. |
| name | string | required | The system name: Meta's name for the template (lowercase letters, digits and underscores), and the name sends, automations and "name:language" lookups use. Generated from display_name when the template is created, and never changed after. |
| display_name | string | required | The human name, as typed when the template was created (e.g. "Order shipped"). A template with no display name, such as one first seen by a sync, carries its system name here. |
| language | string | required | |
| category | "marketing" | "utility" | "authentication" | required | |
| status | "pending" | "approved" | "rejected" | "paused" | "disabled" | "in_appeal" | "pending_deletion" | "deleted" | … | required | Meta's review status, in lowercase, or one of Cosend's own two. sending: Meta did not answer the create, and Cosend is finishing it: it asks Meta whether it has the template and creates it only when Meta does not, right away, 10 seconds later and 30 seconds after that. unsent: none of those three tries got an answer; Cosend keeps the template as it was submitted, and POST /v1/templates/{id}/submit sends it again. |
| variables | string[] | required | |
| sendable | boolean | required | |
| paused_until | string | null | required | |
| pause_level | string | null | required | |
| rejected_reason | "invalid_format" | "incorrect_category" | "abusive_content" | "promotional" | "scam" | "tag_content_mismatch" | "category_not_available" | "none" | null | required | |
| rejection | object | null | required | |
| rejection.code | "invalid_format" | "incorrect_category" | "abusive_content" | "promotional" | "scam" | "tag_content_mismatch" | "category_not_available" | "none" | required | |
| rejection.title | string | required | |
| rejection.fix | string | required | |
| rejection.detail | string | null | required | |
| rejection.recommendation | string | null | required | |
| rejection.review_url | string | required | |
| edit | object | required | |
| edit.allowed | boolean | required | |
| edit.reason | string | null | required | Why the template cannot be edited now, in words: Meta edits approved, rejected and paused templates only, and an approved one once in 24 hours and 10 times in 30 days. null when it can. |
| edit.available_at | string (date-time) | null | required | When the edit limit on this approved template next allows an edit. Counts the edits made through Cosend; null when the limit is not what stops it. |
| edit.category_allowed | boolean | required | Whether an edit may change the category. Meta refuses it on an approved template. |
| quality_score | "green" | "yellow" | "red" | "na" | null | required | |
| components | any | required | |
| authentication | object | null | required | An authentication template's security note, expiry and one-time-password button, in the shape create and edit take. Meta writes the body: "{{1}} is your verification code." null for a template with no one-time-password button. |
| authentication.add_security_recommendation | boolean | required | |
| authentication.code_expiration_minutes | integer | null | required | |
| authentication.delivery | object | required | |
| authentication.delivery.type | "copy_code" | "one_tap" | "zero_tap" | required | Meta's otp_type. |
| authentication.delivery.apps | object[] | optional | One-tap and zero-tap: the Android apps the code is handed to (Meta's supported_apps), when the template carries them. |
| authentication.message_send_ttl_seconds | integer | null | required | The time-to-live Cosend set: 30 to 900 seconds, or -1 for 30 days. null: WhatsApp's default, or not known for a template made outside Cosend. |
| tracked_links | object[] | required | The URL buttons whose clicks Cosend counts: each button's place among the buttons (from 0) and the page it opens. Such a button's url in components is Cosend's redirect, which counts the tap and opens this page. Give track_clicks: true on a URL button in a create or an edit to count its clicks. |
| tracked_links[].index | integer | required | |
| tracked_links[].url | string | required |
Errors template_name_taken
POST /v1/templates/{id}/submit
Send a template Meta did not answer to Meta again; Cosend first asks Meta whether it already has it
Scopes templates:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| waba_id | string | required | The WhatsApp Business Account the template belongs to, as Cosend's wab_ id: the waba_id a connection carries (Meta's id is the connection's meta_waba_id) and GET /v1/templates?waba_id= takes. Every number on that account can send it. |
| name | string | required | The system name: Meta's name for the template (lowercase letters, digits and underscores), and the name sends, automations and "name:language" lookups use. Generated from display_name when the template is created, and never changed after. |
| display_name | string | required | The human name, as typed when the template was created (e.g. "Order shipped"). A template with no display name, such as one first seen by a sync, carries its system name here. |
| language | string | required | |
| category | "marketing" | "utility" | "authentication" | required | |
| status | "pending" | "approved" | "rejected" | "paused" | "disabled" | "in_appeal" | "pending_deletion" | "deleted" | … | required | Meta's review status, in lowercase, or one of Cosend's own two. sending: Meta did not answer the create, and Cosend is finishing it: it asks Meta whether it has the template and creates it only when Meta does not, right away, 10 seconds later and 30 seconds after that. unsent: none of those three tries got an answer; Cosend keeps the template as it was submitted, and POST /v1/templates/{id}/submit sends it again. |
| variables | string[] | required | |
| sendable | boolean | required | |
| paused_until | string | null | required | |
| pause_level | string | null | required | |
| rejected_reason | "invalid_format" | "incorrect_category" | "abusive_content" | "promotional" | "scam" | "tag_content_mismatch" | "category_not_available" | "none" | null | required | |
| rejection | object | null | required | |
| rejection.code | "invalid_format" | "incorrect_category" | "abusive_content" | "promotional" | "scam" | "tag_content_mismatch" | "category_not_available" | "none" | required | |
| rejection.title | string | required | |
| rejection.fix | string | required | |
| rejection.detail | string | null | required | |
| rejection.recommendation | string | null | required | |
| rejection.review_url | string | required | |
| edit | object | required | |
| edit.allowed | boolean | required | |
| edit.reason | string | null | required | Why the template cannot be edited now, in words: Meta edits approved, rejected and paused templates only, and an approved one once in 24 hours and 10 times in 30 days. null when it can. |
| edit.available_at | string (date-time) | null | required | When the edit limit on this approved template next allows an edit. Counts the edits made through Cosend; null when the limit is not what stops it. |
| edit.category_allowed | boolean | required | Whether an edit may change the category. Meta refuses it on an approved template. |
| quality_score | "green" | "yellow" | "red" | "na" | null | required | |
| components | any | required | |
| authentication | object | null | required | An authentication template's security note, expiry and one-time-password button, in the shape create and edit take. Meta writes the body: "{{1}} is your verification code." null for a template with no one-time-password button. |
| authentication.add_security_recommendation | boolean | required | |
| authentication.code_expiration_minutes | integer | null | required | |
| authentication.delivery | object | required | |
| authentication.delivery.type | "copy_code" | "one_tap" | "zero_tap" | required | Meta's otp_type. |
| authentication.delivery.apps | object[] | optional | One-tap and zero-tap: the Android apps the code is handed to (Meta's supported_apps), when the template carries them. |
| authentication.message_send_ttl_seconds | integer | null | required | The time-to-live Cosend set: 30 to 900 seconds, or -1 for 30 days. null: WhatsApp's default, or not known for a template made outside Cosend. |
| tracked_links | object[] | required | The URL buttons whose clicks Cosend counts: each button's place among the buttons (from 0) and the page it opens. Such a button's url in components is Cosend's redirect, which counts the tap and opens this page. Give track_clicks: true on a URL button in a create or an edit to count its clicks. |
| tracked_links[].index | integer | required | |
| tracked_links[].url | string | required |
GET /v1/templates/category-changes
The template category changes Meta made or announced that nobody has acknowledged
Scopes templates:read
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | Every category change no one in the workspace has acknowledged, newest first, on templates that are not deleted. A detected one is listed only while no later change to its template has arrived. |
| data[].id | string | required | The change, as a decimal string. POST /v1/templates/category-changes/{id}/acknowledge takes it. |
| data[].object | "template_category_change" | required | |
| data[].kind | "changed" | "scheduled" | "detected" | required | changed: Meta has moved the template to new_category. scheduled: Meta's advance notice that it will, at takes_effect_at; the template is still previous_category. detected: Meta has detected that new_category (Meta's correct_category) is the right category for the template, which is still previous_category; a later change to the template's category replaces it. |
| data[].template_id | string | required | |
| data[].name | string | required | The template's system name, Meta's. |
| data[].display_name | string | required | |
| data[].language | string | required | |
| data[].previous_category | "marketing" | "utility" | "authentication" | null | required | The category before the change. Null when Meta did not say. |
| data[].new_category | "marketing" | "utility" | "authentication" | required | |
| data[].occurred_at | string (date-time) | required | When Cosend learned of it: the webhook, the sync or the create that carried it. For a changed one, when Meta changed it. |
| data[].takes_effect_at | string (date-time) | null | required | When Meta says the category will change (Meta's category_update_timestamp). Only on a scheduled change, and null if Meta's notice gave none. Meta sends no other date with a category change, so no review deadline is published. |
| data[].acknowledged_at | string (date-time) | null | required | |
| data[].acknowledged_by | object | null | required | Who acknowledged it, for the whole workspace. Null while it is open. |
| data[].acknowledged_by.kind | string | required | As the audit trail records an actor: user for a person, api_key for a key. |
| data[].acknowledged_by.id | string | null | required | |
| data[].acknowledged_by.label | string | null | required | Their name as it was then. |
POST /v1/templates/category-changes/{id}/acknowledge
Acknowledge a template category change for the whole workspace; it leaves the open list
Scopes templates:write
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | The change, as a decimal string. POST /v1/templates/category-changes/{id}/acknowledge takes it. |
| object | "template_category_change" | required | |
| kind | "changed" | "scheduled" | "detected" | required | changed: Meta has moved the template to new_category. scheduled: Meta's advance notice that it will, at takes_effect_at; the template is still previous_category. detected: Meta has detected that new_category (Meta's correct_category) is the right category for the template, which is still previous_category; a later change to the template's category replaces it. |
| template_id | string | required | |
| name | string | required | The template's system name, Meta's. |
| display_name | string | required | |
| language | string | required | |
| previous_category | "marketing" | "utility" | "authentication" | null | required | The category before the change. Null when Meta did not say. |
| new_category | "marketing" | "utility" | "authentication" | required | |
| occurred_at | string (date-time) | required | When Cosend learned of it: the webhook, the sync or the create that carried it. For a changed one, when Meta changed it. |
| takes_effect_at | string (date-time) | null | required | When Meta says the category will change (Meta's category_update_timestamp). Only on a scheduled change, and null if Meta's notice gave none. Meta sends no other date with a category change, so no review deadline is published. |
| acknowledged_at | string (date-time) | null | required | |
| acknowledged_by | object | null | required | Who acknowledged it, for the whole workspace. Null while it is open. |
| acknowledged_by.kind | string | required | As the audit trail records an actor: user for a person, api_key for a key. |
| acknowledged_by.id | string | null | required | |
| acknowledged_by.label | string | null | required | Their name as it was then. |
POST /v1/templates/sync
Read the number’s templates from Meta now and answer with the synced list
Scopes templates:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| connection_id | string | required |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| object | "template_sync" | required | |
| waba_id | string | required | The WhatsApp Business Account that was read, as Cosend's wab_ id: the connection's waba_id, and what GET /v1/templates?waba_id= takes. |
| synced_at | string (date-time) | required | |
| templates | object[] | required | |
| templates[].id | string | required | |
| templates[].waba_id | string | required | The WhatsApp Business Account the template belongs to, as Cosend's wab_ id: the waba_id a connection carries (Meta's id is the connection's meta_waba_id) and GET /v1/templates?waba_id= takes. Every number on that account can send it. |
| templates[].name | string | required | The system name: Meta's name for the template (lowercase letters, digits and underscores), and the name sends, automations and "name:language" lookups use. Generated from display_name when the template is created, and never changed after. |
| templates[].display_name | string | required | The human name, as typed when the template was created (e.g. "Order shipped"). A template with no display name, such as one first seen by a sync, carries its system name here. |
| templates[].language | string | required | |
| templates[].category | "marketing" | "utility" | "authentication" | required | |
| templates[].status | "pending" | "approved" | "rejected" | "paused" | "disabled" | "in_appeal" | "pending_deletion" | "deleted" | … | required | Meta's review status, in lowercase, or one of Cosend's own two. sending: Meta did not answer the create, and Cosend is finishing it: it asks Meta whether it has the template and creates it only when Meta does not, right away, 10 seconds later and 30 seconds after that. unsent: none of those three tries got an answer; Cosend keeps the template as it was submitted, and POST /v1/templates/{id}/submit sends it again. |
| templates[].variables | string[] | required | |
| templates[].sendable | boolean | required | |
| templates[].paused_until | string | null | required | |
| templates[].pause_level | string | null | required | |
| templates[].rejected_reason | "invalid_format" | "incorrect_category" | "abusive_content" | "promotional" | "scam" | "tag_content_mismatch" | "category_not_available" | "none" | null | required | |
| templates[].rejection | object | null | required | |
| templates[].rejection.code | "invalid_format" | "incorrect_category" | "abusive_content" | "promotional" | "scam" | "tag_content_mismatch" | "category_not_available" | "none" | required | |
| templates[].rejection.title | string | required | |
| templates[].rejection.fix | string | required | |
| templates[].rejection.detail | string | null | required | |
| templates[].rejection.recommendation | string | null | required | |
| templates[].rejection.review_url | string | required | |
| templates[].edit | object | required | |
| templates[].edit.allowed | boolean | required | |
| templates[].edit.reason | string | null | required | Why the template cannot be edited now, in words: Meta edits approved, rejected and paused templates only, and an approved one once in 24 hours and 10 times in 30 days. null when it can. |
| templates[].edit.available_at | string (date-time) | null | required | When the edit limit on this approved template next allows an edit. Counts the edits made through Cosend; null when the limit is not what stops it. |
| templates[].edit.category_allowed | boolean | required | Whether an edit may change the category. Meta refuses it on an approved template. |
| templates[].quality_score | "green" | "yellow" | "red" | "na" | null | required | |
| templates[].components | any | required | |
| templates[].authentication | object | null | required | An authentication template's security note, expiry and one-time-password button, in the shape create and edit take. Meta writes the body: "{{1}} is your verification code." null for a template with no one-time-password button. |
| templates[].authentication.add_security_recommendation | boolean | required | |
| templates[].authentication.code_expiration_minutes | integer | null | required | |
| templates[].authentication.delivery | object | required | |
| templates[].authentication.message_send_ttl_seconds | integer | null | required | The time-to-live Cosend set: 30 to 900 seconds, or -1 for 30 days. null: WhatsApp's default, or not known for a template made outside Cosend. |
| templates[].tracked_links | object[] | required | The URL buttons whose clicks Cosend counts: each button's place among the buttons (from 0) and the page it opens. Such a button's url in components is Cosend's redirect, which counts the tap and opens this page. Give track_clicks: true on a URL button in a create or an edit to count its clicks. |
| templates[].tracked_links[].index | integer | required | |
| templates[].tracked_links[].url | string | required | |
| skipped_count | integer | required | |
| skipped | object[] | required | |
| skipped[].name | string | required | |
| skipped[].language | string | required | |
| skipped[].reason | string | required |
/v1/tools
GET /v1/tools/message-cost
What one WhatsApp message costs in a country, from Meta’s rate cards. Free, no sign-in
Scopes none (public endpoint)
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| country | query | string | required | The country the messages go to, as its two-letter ISO code: "GB", "US", "DE". |
| currency | query | string | required | One of Meta's 16 rate-card currencies: USD, AED, ARS, AUD, BRL, CLP, COP, EUR, GBP, IDR, INR, MXN, MYR, PEN, SAR, SGD. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| market | string | required | The market Meta charges the country in, as its rate card names it: the country itself ("Germany"), a region ("Rest of Latin America", "North America") or "Other". |
| currency | string | required | The currency the rates are in. |
| effective_from | string | required | The day these rates took effect, YYYY-MM-DD, by the business's Messaging account timezone. |
| rates | object | required | |
| rates.marketing | number | required | The price of one delivered message. |
| rates.utility | number | required | The price of one delivered message. |
| rates.authentication | number | required | The price of one delivered message. |
| rates.authentication_international | number | optional | Only in the markets that have one. Meta's Authentication-International rates page says which businesses it applies to. |
| rates.service | number | required | The price of one delivered message. |
| notes | string[] | required | Meta's rules that change what a business pays: delivered messages only, the free service messages, free entry point windows, volume tiers. |
POST /v1/tools/template-check
Check a template against WhatsApp’s rules before Meta reviews it. Free, no sign-in
Scopes none (public endpoint)
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| category | "marketing" | "utility" | "authentication" | required | |
| language | string | optional | The language, e.g. "en_US". Required on every category but authentication, which takes authentication.languages instead. |
| parameter_format | "positional" | "named" | optional | |
| components | object[] | optional | Meta's components, as POST /v1/templates takes them; required on every category but authentication, which takes authentication instead. |
| components[].type | "BUTTONS" | required | |
| components[].buttons | object[] | required | |
| components[].buttons[].type | "QUICK_REPLY" | required | |
| components[].buttons[].text | string | required | |
| components[].buttons[].url | string | required | |
| components[].buttons[].example | string[] | optional | |
| components[].buttons[].track_clicks | boolean | optional | |
| components[].buttons[].phone_number | string | required | |
| authentication | object | null | optional | An authentication template, in Meta's shape, in place of components and language: {"languages": ["fr", "en_US"], "add_security_recommendation": true, "code_expiration_minutes": 10, "delivery": {"type": "copy_code"}, "message_send_ttl_seconds": 600}. WhatsApp writes the message and the button label in each language ("{{1}} is your verification code." in English); there is no text to set. One template is created per language, each its own resource; the answer is the version in the first language. Required when category is authentication, and refused on any other category; null is the same as leaving it out. |
| authentication.languages | string[] | required | The language versions to create, e.g. ["fr", "en_US"]: one template per language, each written by WhatsApp in its language. On an edit, left out or exactly the template's own language. |
| authentication.add_security_recommendation | boolean | required | Whether Meta adds "For your security, do not share this code." to the body. |
| authentication.code_expiration_minutes | integer | null | optional | Minutes the code stays valid, 1 to 90: Meta's footer "This code expires in N minutes." Left out or null, there is no footer. |
| authentication.delivery | object | required | How the code reaches the person: {"type": "copy_code"}, or {"type": "one_tap" | "zero_tap", "apps": [{"package_name": "com.example.app", "signature_hash": "K8a/AINcGX7"}]} (1 to 5 apps); zero-tap also takes "zero_tap_terms_accepted": true. |
| authentication.delivery.type | "copy_code" | required | |
| authentication.delivery.apps | object[] | required | The Android apps the code is handed to: 1 to 5, Meta's supported_apps. |
| authentication.delivery.zero_tap_terms_accepted | true | required | Meta's zero_tap_terms_accepted: "Set to true to indicate that you understand that your use of zero-tap authentication is subject to the WhatsApp Business Terms of Service." Sent to Meta and recorded in the audit log. |
| authentication.message_send_ttl_seconds | integer | null | optional | How long WhatsApp keeps trying to deliver the message: 30 to 900 seconds, or -1 for 30 days. Left out or null, WhatsApp's default for authentication, 10 minutes. |
| authentication.button | any | optional | Refused. WhatsApp writes the button label in each language; there is no text to set. Give delivery instead: {"type": "copy_code"}. |
| example_values | object | optional | A sample value for every variable in the TEXT header and the body, keyed per component by the name between the braces: {"body": {"1": "Pablo", "2": "860198-230332"}} or {"body": {"first_name": "Pablo"}}. Required for each such variable, because Meta rejects a template without samples; a missing one is refused with invalid_request, param example_values. Sent to Meta as each component's example. A component that already carries Meta's own example and has no entry here is sent as it is. |
| example_values.header | object | optional | |
| example_values.body | object | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| verdict | "ready" | "fix_first" | "warnings" | required | ready: no problem found. fix_first: at least one error, which Meta rejects the template for. warnings: no error, but at least one warning. Meta reviews every template itself, so ready is not an approval. |
| problems | object[] | required | |
| problems[].where | string | required | Where it is, as a JSON pointer into the request, e.g. "/components/1/text". |
| problems[].rule | "buttons_empty" | "buttons_max" | "url_buttons_max" | "phone_buttons_max" | "quick_replies_grouped" | "url_variables_max" | "url_variable_at_end" | "url_example_missing" | … | required | |
| problems[].level | "error" | "warning" | required | error: breaks one of Meta's exact rules, and Meta rejects the template for it. warning: a signal Meta names in its review and categorization pages, where Meta will likely reject the template or make it marketing. |
| problems[].message | string | required | What is wrong, in plain words. |
| problems[].fix | string | required | What to change, in plain words. |
Errors invalid_request
POST /v1/tools/whatsapp-link
A WhatsApp chat link and its QR code for a number. Free, no sign-in
Scopes none (public endpoint)
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| country | string | required | The country the number belongs to, as its two-letter ISO code: "GB", "US", "DE". A number of another country is refused. |
| number | string | required | The WhatsApp number as people type it: as written at home (07700 900123), with + (+44 7700 900123), with 00 (0044 7700 900123) or with the country code in front (44 7700 900123). Spaces, dashes, brackets and digits in any script are fine. |
| message | string | optional | The message the chat starts with, at most 500 characters. Left out or blank, the link opens an empty chat. |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| digits | string | required | The full international number in digits, with no +: what wa.me takes. |
| link | string | required | The chat link, https://wa.me/<digits>, with ?text= and the message when there is one. |
| qr_svg | string | null | required | The link as a QR code: an SVG image, black on white, with a quiet zone of 4 modules. null when the link is too long for any QR code, and qr_note says so. |
| qr_note | string | null | required | "This message is too long for a QR code. Use the link instead." when qr_svg is null; null otherwise. |
/v1/usage
GET /v1/usage
Usage for one billing period: used is live, and the allowances come from the plan
Scopes usage:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| period | query | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| period | object | required | |
| period.start | string | required | |
| period.end | string | required | |
| period.current | boolean | required | |
| plan | string | null | required | |
| extras_billed | boolean | required | True when use past the plan’s limits is billed. False when it stops at them: on the Free plan, card or no card (a Free workspace that already had a card when this rule began keeps billed extras until extras_billed_until and is true up to that date), on the trial, and on a plan held to the Free plan’s limits after a failed payment. |
| extras_billed_until | string (date-time) | null | required | For a Free workspace that already had a card when this rule began: when its billed extras end and it stops at the Free plan’s limits like every Free workspace. Null for every other workspace. |
| meters | object | required | |
| meters.ai_conversation | object | required | |
| meters.ai_conversation.used | integer | required | |
| meters.ai_conversation.included | integer | null | required | |
| meters.ai_conversation.hard_cap | integer | null | required | |
| meters.ai_conversation.basis | "period" | "lifetime" | "concurrent" | null | required | |
| meters.ai_conversation.billed_by | "meta" | optional | |
| meters.ai_conversation.overage_used | integer | optional | |
| meters.ai_conversation.overage_minor | string | optional | |
| meters.automation_run | object | required | |
| meters.automation_run.used | integer | required | |
| meters.automation_run.included | integer | null | required | |
| meters.automation_run.hard_cap | integer | null | required | |
| meters.automation_run.basis | "period" | "lifetime" | "concurrent" | null | required | |
| meters.automation_run.billed_by | "meta" | optional | |
| meters.automation_run.overage_used | integer | optional | |
| meters.automation_run.overage_minor | string | optional | |
| meters.message_sent | object | required | |
| meters.message_sent.used | integer | required | |
| meters.message_sent.included | integer | null | required | |
| meters.message_sent.hard_cap | integer | null | required | |
| meters.message_sent.basis | "period" | "lifetime" | "concurrent" | null | required | |
| meters.message_sent.billed_by | "meta" | optional | |
| meters.message_sent.overage_used | integer | optional | |
| meters.message_sent.overage_minor | string | optional | |
| meters.connection_month | object | required | |
| meters.connection_month.used | integer | required | |
| meters.connection_month.included | integer | null | required | |
| meters.connection_month.hard_cap | integer | null | required | |
| meters.connection_month.basis | "period" | "lifetime" | "concurrent" | null | required | |
| meters.connection_month.billed_by | "meta" | optional | |
| meters.connection_month.overage_used | integer | optional | |
| meters.connection_month.overage_minor | string | optional | |
| meters.seat_month | object | required | |
| meters.seat_month.used | integer | required | |
| meters.seat_month.included | integer | null | required | |
| meters.seat_month.hard_cap | integer | null | required | |
| meters.seat_month.basis | "period" | "lifetime" | "concurrent" | null | required | |
| meters.seat_month.billed_by | "meta" | optional | |
| meters.seat_month.overage_used | integer | optional | |
| meters.seat_month.overage_minor | string | optional | |
| usage_prices_kept_until | string (date-time) | null | required | While this workspace’s current billing period is on its earlier overage prices: when its first billing period on the plan’s prices starts. Null when the current period is on the plan’s prices. |
| direct_message_sent | object | optional | |
| direct_message_sent.used | integer | required | |
| trial_period | object | optional | |
| trial_period.start | string | required | |
| trial_period.end | string | required | |
| overage_to_invoice | object | optional | |
| overage_to_invoice.amount_minor | integer | required | |
| overage_to_invoice.earlier_minor | integer | required | |
| overage_to_invoice.lines | object[] | required | |
| overage_to_invoice.lines[].meter | "automation_run" | "ai_conversation" | "message_sent" | required | |
| overage_to_invoice.lines[].period_start | string | required | |
| overage_to_invoice.lines[].units | integer | required | |
| overage_to_invoice.lines[].overage_minor | string | required | |
| overage_to_invoice.lines[].current | boolean | required | |
| estimated_invoice_minor | integer | required | |
| maximum_invoice_minor | integer | required | |
| currency | string | required | |
| ai_uses | object | required | |
| ai_uses.assistant_reply | integer | required | |
| ai_uses.try_it | integer | required | |
| ai_uses.extract | integer | required | |
| ai_uses.knowledge_search | integer | required | |
| ai_uses.knowledge_reading | integer | required | |
| ai_uses.read_again | integer | required | |
| ai_uses.photo_reading | integer | required | |
| ai_uses.knowledge_summary | integer | required | |
| ai_uses.transcription | integer | required | |
| ai_uses.moderation | integer | required | |
| ai_uses.authoring | integer | required | |
| ai_uses.draft | integer | required | |
| ai_uses.translate | integer | required | |
| ai_uses.send_time | integer | required | |
| ai_uses.template_draft | integer | required | |
| ai_uses.campaign_ideas | integer | required | |
| ai_uses.contact_import | integer | required | |
| ai_uses.order_draft | integer | required | |
| ai_uses.payment_screenshot | integer | required | |
| ai_uses.quote_intake | integer | required | |
| integration_calls | object[] | required | |
| integration_calls[].connector | string | required | |
| integration_calls[].calls | integer | required | |
| builder_credits | object | optional | |
| builder_credits.included_cents | integer | required | |
| builder_credits.included_used_cents | integer | required | |
| builder_credits.bought_balance_cents | integer | required | |
| builder_credits.period_ends_at | string (date-time) | required | |
| builder_credits.packs | object[] | required | |
| builder_credits.packs[].id | string | required | |
| builder_credits.packs[].amount_cents | integer | required | |
| builder_credits.packs[].currency | string | required |
/v1/webhook-deliveries
POST /v1/webhook-deliveries/{id}/replay
Re-deliver one event: a new attempt, with the same evt_ id
Scopes webhooks:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| delivery | object | required | |
| delivery.id | string | required | |
| delivery.object | "webhook_delivery" | required | |
| delivery.endpoint_id | string | required | |
| delivery.event | string | required | |
| delivery.event_id | string | null | required | |
| delivery.attempt | integer | required | |
| delivery.status_code | integer | null | required | |
| delivery.duration_ms | integer | null | required | |
| delivery.error | string | null | required | |
| delivery.next_retry_at | string | null | required | |
| delivery.delivered_at | string | null | required | |
| delivery.created_at | string | required | |
| delivery.status | "delivered" | "retrying" | "failed" | "stopped" | required | |
| delivery.stopped_reason | string | null | required |
/v1/webhook-endpoints
GET /v1/webhook-endpoints
The workspace’s registered endpoints
Scopes webhooks:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| limit | query | integer | optional | |
| after | query | string | optional | |
| before | query | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].object | "webhook_endpoint" | required | |
| data[].url | string | required | |
| data[].events | string[] | required | |
| data[].connection_id | string | null | required | |
| data[].filters | object | required | |
| data[].filters.message_types | ("text" | "image" | "audio" | "video" | "document" | "sticker" | "location" | "contacts" | …)[] | required | |
| data[].filters.message_statuses | ("queued" | "sending" | "sent" | "delivered" | "read" | "played" | "failed" | "deleted" | …)[] | required | |
| data[].filters.labels | string[] | required | |
| data[].filters.assignee_ids | string[] | required | |
| data[].filters.automation_ids | string[] | required | |
| data[].filters.exclude_sent_by_api_key_ids | string[] | required | |
| data[].include_contact | boolean | required | |
| data[].is_enabled | boolean | required | |
| data[].api_version | string | required | |
| data[].consecutive_failures | integer | required | |
| data[].disabled_at | string | null | required | |
| data[].disabled_reason | string | null | required | |
| data[].last_success_at | string | null | required | |
| data[].last_failure_at | string | null | required | |
| data[].created_at | string | required | |
| data[].updated_at | string | required | |
| data[].secret | string | optional | |
| has_more | boolean | required | |
| next_cursor | string | null | required |
POST /v1/webhook-endpoints
Register an endpoint. The signing secret is returned only once
Scopes webhooks:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| url | string (uri) | required | |
| events | ("message.received" | "message.sent" | "message.status" | "message.echo" | "conversation.created" | "conversation.updated" | "conversation.window_expiring" | "conversation.lock_changed" | …)[] | required | |
| connection_id | string | null | optional | |
| filters | object | optional | |
| filters.message_types | ("text" | "image" | "audio" | "video" | "document" | "sticker" | "location" | "contacts" | …)[] | optional | |
| filters.message_statuses | ("queued" | "sending" | "sent" | "delivered" | "read" | "played" | "failed" | "deleted" | …)[] | optional | |
| filters.labels | string[] | optional | |
| filters.assignee_ids | string[] | optional | |
| filters.automation_ids | string[] | optional | |
| filters.exclude_sent_by_api_key_ids | string[] | optional | |
| include_contact | boolean | optional |
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "webhook_endpoint" | required | |
| url | string | required | |
| events | string[] | required | |
| connection_id | string | null | required | |
| filters | object | required | |
| filters.message_types | ("text" | "image" | "audio" | "video" | "document" | "sticker" | "location" | "contacts" | …)[] | required | |
| filters.message_statuses | ("queued" | "sending" | "sent" | "delivered" | "read" | "played" | "failed" | "deleted" | …)[] | required | |
| filters.labels | string[] | required | |
| filters.assignee_ids | string[] | required | |
| filters.automation_ids | string[] | required | |
| filters.exclude_sent_by_api_key_ids | string[] | required | |
| include_contact | boolean | required | |
| is_enabled | boolean | required | |
| api_version | string | required | |
| consecutive_failures | integer | required | |
| disabled_at | string | null | required | |
| disabled_reason | string | null | required | |
| last_success_at | string | null | required | |
| last_failure_at | string | null | required | |
| created_at | string | required | |
| updated_at | string | required | |
| secret | string | optional |
PATCH /v1/webhook-endpoints/{id}
Change the URL, the subscribed events, the filters, or re-enable after an auto-disable
Scopes webhooks:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| url | string (uri) | optional | |
| events | ("message.received" | "message.sent" | "message.status" | "message.echo" | "conversation.created" | "conversation.updated" | "conversation.window_expiring" | "conversation.lock_changed" | …)[] | optional | |
| is_enabled | boolean | optional | |
| filters | object | optional | |
| filters.message_types | ("text" | "image" | "audio" | "video" | "document" | "sticker" | "location" | "contacts" | …)[] | optional | |
| filters.message_statuses | ("queued" | "sending" | "sent" | "delivered" | "read" | "played" | "failed" | "deleted" | …)[] | optional | |
| filters.labels | string[] | optional | |
| filters.assignee_ids | string[] | optional | |
| filters.automation_ids | string[] | optional | |
| filters.exclude_sent_by_api_key_ids | string[] | optional | |
| include_contact | boolean | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "webhook_endpoint" | required | |
| url | string | required | |
| events | string[] | required | |
| connection_id | string | null | required | |
| filters | object | required | |
| filters.message_types | ("text" | "image" | "audio" | "video" | "document" | "sticker" | "location" | "contacts" | …)[] | required | |
| filters.message_statuses | ("queued" | "sending" | "sent" | "delivered" | "read" | "played" | "failed" | "deleted" | …)[] | required | |
| filters.labels | string[] | required | |
| filters.assignee_ids | string[] | required | |
| filters.automation_ids | string[] | required | |
| filters.exclude_sent_by_api_key_ids | string[] | required | |
| include_contact | boolean | required | |
| is_enabled | boolean | required | |
| api_version | string | required | |
| consecutive_failures | integer | required | |
| disabled_at | string | null | required | |
| disabled_reason | string | null | required | |
| last_success_at | string | null | required | |
| last_failure_at | string | null | required | |
| created_at | string | required | |
| updated_at | string | required | |
| secret | string | optional |
DELETE /v1/webhook-endpoints/{id}
Remove an endpoint and its signing secret
Scopes webhooks:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "webhook_endpoint" | required | |
| deleted | true | required |
GET /v1/webhook-endpoints/{id}/deliveries
Attempt history with status codes
Scopes webhooks:read
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| limit | query | integer | optional | |
| after | query | string | optional | |
| before | query | string | optional |
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].object | "webhook_delivery" | required | |
| data[].endpoint_id | string | required | |
| data[].event | string | required | |
| data[].event_id | string | null | required | |
| data[].attempt | integer | required | |
| data[].status_code | integer | null | required | |
| data[].duration_ms | integer | null | required | |
| data[].error | string | null | required | |
| data[].next_retry_at | string | null | required | |
| data[].delivered_at | string | null | required | |
| data[].created_at | string | required | |
| data[].status | "delivered" | "retrying" | "failed" | "stopped" | required | |
| data[].stopped_reason | string | null | required | |
| has_more | boolean | required | |
| next_cursor | string | null | required |
POST /v1/webhook-endpoints/{id}/rotate-secret
Mint a new signing secret. Both stay valid for 24 hours
Scopes webhooks:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | |
| object | "webhook_endpoint" | required | |
| url | string | required | |
| events | string[] | required | |
| connection_id | string | null | required | |
| filters | object | required | |
| filters.message_types | ("text" | "image" | "audio" | "video" | "document" | "sticker" | "location" | "contacts" | …)[] | required | |
| filters.message_statuses | ("queued" | "sending" | "sent" | "delivered" | "read" | "played" | "failed" | "deleted" | …)[] | required | |
| filters.labels | string[] | required | |
| filters.assignee_ids | string[] | required | |
| filters.automation_ids | string[] | required | |
| filters.exclude_sent_by_api_key_ids | string[] | required | |
| include_contact | boolean | required | |
| is_enabled | boolean | required | |
| api_version | string | required | |
| consecutive_failures | integer | required | |
| disabled_at | string | null | required | |
| disabled_reason | string | null | required | |
| last_success_at | string | null | required | |
| last_failure_at | string | null | required | |
| created_at | string | required | |
| updated_at | string | required | |
| secret | string | optional |
POST /v1/webhook-endpoints/{id}/test
Send a ping event synchronously and return the result
Scopes webhooks:write
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| delivered | boolean | required | |
| delivery | object | required | |
| delivery.id | string | required | |
| delivery.object | "webhook_delivery" | required | |
| delivery.endpoint_id | string | required | |
| delivery.event | string | required | |
| delivery.event_id | string | null | required | |
| delivery.attempt | integer | required | |
| delivery.status_code | integer | null | required | |
| delivery.duration_ms | integer | null | required | |
| delivery.error | string | null | required | |
| delivery.next_retry_at | string | null | required | |
| delivery.delivered_at | string | null | required | |
| delivery.created_at | string | required | |
| delivery.status | "delivered" | "retrying" | "failed" | "stopped" | required | |
| delivery.stopped_reason | string | null | required |
/.well-known
GET /.well-known/google-connected-apps
Google Gemini Connected Apps domain verification
Scopes none (public endpoint)
Response 200
The google-connected-apps.json file Google issued for this domain, served exactly as configured (GOOGLE_CONNECTED_APPS_VERIFICATION). 404 where none is configured. application/json
GET /.well-known/jwks.json
The public key MCP access tokens are signed with (RFC 7517)
Scopes none (public endpoint)
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| keys | object[] | required | |
| keys[].kid | string | required |
GET /.well-known/oauth-authorization-server
OAuth 2.0 Authorization Server Metadata (RFC 8414) for the MCP sign-in
Scopes none (public endpoint)
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| issuer | string | required | |
| authorization_endpoint | string | required | |
| token_endpoint | string | required | |
| registration_endpoint | string | required | |
| jwks_uri | string | required | |
| scopes_supported | string[] | required | |
| response_types_supported | string[] | required | |
| response_modes_supported | string[] | required | |
| grant_types_supported | string[] | required | |
| token_endpoint_auth_methods_supported | string[] | required | |
| code_challenge_methods_supported | string[] | required | |
| authorization_response_iss_parameter_supported | boolean | required | |
| client_id_metadata_document_supported | boolean | required |
GET /.well-known/oauth-protected-resource/mcp
OAuth 2.0 Protected Resource Metadata (RFC 9728)
Scopes none (public endpoint)
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| resource | string | required | |
| authorization_servers | string[] | required | |
| scopes_supported | string[] | required | |
| bearer_methods_supported | string[] | required | |
| resource_documentation | string | required |
GET /.well-known/openai-apps-challenge
OpenAI plugin domain verification
Scopes none (public endpoint)
Response 200
The challenge token OpenAI issued for this domain, exactly as configured (OPENAI_APPS_CHALLENGE_TOKEN) and nothing else. 404 where none is configured. text/plain
/{version}
GET /{version}/{node}
Graph passthrough: read the phone number, the WABA, or a media object
Scopes runtime:proxy
Response 200
Meta's Graph API response, forwarded byte for byte. Cosend does not define, validate or version this body; read it against the Graph API docs for the version in the path. application/json
POST /{version}/{node}
Graph passthrough: update the phone number's own settings, such as its two-step verification PIN (webhook_configuration is refused)
Scopes runtime:proxy
Response 200
Meta's Graph API response, forwarded byte for byte. Cosend does not define, validate or version this body; read it against the Graph API docs for the version in the path. application/json
DELETE /{version}/{node}
Graph passthrough: delete a media object
Scopes runtime:proxy
Response 200
Meta's Graph API response, forwarded byte for byte. Cosend does not define, validate or version this body; read it against the Graph API docs for the version in the path. application/json
GET /{version}/{node}/analytics
Graph passthrough: message volume analytics
Scopes runtime:proxy
Response 200
Meta's Graph API response, forwarded byte for byte. Cosend does not define, validate or version this body; read it against the Graph API docs for the version in the path. application/json
GET /{version}/{node}/block_users
Graph passthrough: list blocked users
Scopes runtime:proxy
Response 200
Meta's Graph API response, forwarded byte for byte. Cosend does not define, validate or version this body; read it against the Graph API docs for the version in the path. application/json
POST /{version}/{node}/block_users
Graph passthrough: block or unblock users
Scopes runtime:proxy
Response 200
Meta's Graph API response, forwarded byte for byte. Cosend does not define, validate or version this body; read it against the Graph API docs for the version in the path. application/json
GET /{version}/{node}/conversation_analytics
Graph passthrough: conversation analytics
Scopes runtime:proxy
Response 200
Meta's Graph API response, forwarded byte for byte. Cosend does not define, validate or version this body; read it against the Graph API docs for the version in the path. application/json
GET /{version}/{node}/conversational_automation
Graph passthrough: read ice-breakers and commands
Scopes runtime:proxy
Response 200
Meta's Graph API response, forwarded byte for byte. Cosend does not define, validate or version this body; read it against the Graph API docs for the version in the path. application/json
POST /{version}/{node}/conversational_automation
Graph passthrough: set ice-breakers and commands
Scopes runtime:proxy
Response 200
Meta's Graph API response, forwarded byte for byte. Cosend does not define, validate or version this body; read it against the Graph API docs for the version in the path. application/json
POST /{version}/{node}/media
Graph passthrough: media upload
Scopes runtime:proxy
Response 200
Meta's Graph API response, forwarded byte for byte. Cosend does not define, validate or version this body; read it against the Graph API docs for the version in the path. application/json
GET /{version}/{node}/message_templates
Graph passthrough: list templates
Scopes runtime:proxy
Response 200
Meta's Graph API response, forwarded byte for byte. Cosend does not define, validate or version this body; read it against the Graph API docs for the version in the path. application/json
POST /{version}/{node}/message_templates
Graph passthrough: create a template
Scopes runtime:proxy
Response 200
Meta's Graph API response, forwarded byte for byte. Cosend does not define, validate or version this body; read it against the Graph API docs for the version in the path. application/json
DELETE /{version}/{node}/message_templates
Graph passthrough: delete a template
Scopes runtime:proxy
Response 200
Meta's Graph API response, forwarded byte for byte. Cosend does not define, validate or version this body; read it against the Graph API docs for the version in the path. application/json
POST /{version}/{node}/messages
Graph passthrough: send, mark-read, typing, reaction
Scopes runtime:proxy
Response 200
Meta's Graph API response, forwarded byte for byte. Cosend does not define, validate or version this body; read it against the Graph API docs for the version in the path. application/json
GET /{version}/{node}/phone_numbers
Graph passthrough: list phone numbers on the WABA
Scopes runtime:proxy
Response 200
Meta's Graph API response, forwarded byte for byte. Cosend does not define, validate or version this body; read it against the Graph API docs for the version in the path. application/json
GET /{version}/{node}/pricing_analytics
Graph passthrough: per-message cost analytics
Scopes runtime:proxy
Response 200
Meta's Graph API response, forwarded byte for byte. Cosend does not define, validate or version this body; read it against the Graph API docs for the version in the path. application/json
POST /{version}/{node}/register
Graph passthrough: register, for cloud_api connections only (refused on coexistence)
Scopes runtime:proxy
Response 200
Meta's Graph API response, forwarded byte for byte. Cosend does not define, validate or version this body; read it against the Graph API docs for the version in the path. application/json
POST /{version}/{node}/request_code
Graph passthrough: request a verification code (refused on coexistence)
Scopes runtime:proxy
Response 200
Meta's Graph API response, forwarded byte for byte. Cosend does not define, validate or version this body; read it against the Graph API docs for the version in the path. application/json
GET /{version}/{node}/settings
Graph passthrough: read the phone number's settings
Scopes runtime:proxy
Response 200
Meta's Graph API response, forwarded byte for byte. Cosend does not define, validate or version this body; read it against the Graph API docs for the version in the path. application/json
POST /{version}/{node}/settings
Graph passthrough: update the phone number's settings
Scopes runtime:proxy
Response 200
Meta's Graph API response, forwarded byte for byte. Cosend does not define, validate or version this body; read it against the Graph API docs for the version in the path. application/json
GET /{version}/{node}/template_analytics
Graph passthrough: template analytics
Scopes runtime:proxy
Response 200
Meta's Graph API response, forwarded byte for byte. Cosend does not define, validate or version this body; read it against the Graph API docs for the version in the path. application/json
POST /{version}/{node}/verify_code
Graph passthrough: verify a code (refused on coexistence)
Scopes runtime:proxy
Response 200
Meta's Graph API response, forwarded byte for byte. Cosend does not define, validate or version this body; read it against the Graph API docs for the version in the path. application/json
GET /{version}/{node}/whatsapp_business_profile
Graph passthrough: read the business profile
Scopes runtime:proxy
Response 200
Meta's Graph API response, forwarded byte for byte. Cosend does not define, validate or version this body; read it against the Graph API docs for the version in the path. application/json
POST /{version}/{node}/whatsapp_business_profile
Graph passthrough: update the business profile (refused on coexistence)
Scopes runtime:proxy
Response 200
Meta's Graph API response, forwarded byte for byte. Cosend does not define, validate or version this body; read it against the Graph API docs for the version in the path. application/json
GET /{version}/*
Graph passthrough: unlisted and blocked paths answer 404, nothing is forwarded
Scopes runtime:proxy
POST /{version}/*
Graph passthrough: unlisted and blocked paths answer 404, nothing is forwarded
Scopes runtime:proxy
PUT /{version}/*
Graph passthrough: unlisted and blocked paths answer 404, nothing is forwarded
Scopes runtime:proxy
PATCH /{version}/*
Graph passthrough: unlisted and blocked paths answer 404, nothing is forwarded
Scopes runtime:proxy
DELETE /{version}/*
Graph passthrough: unlisted and blocked paths answer 404, nothing is forwarded
Scopes runtime:proxy
GET /{version}/media/{media_id}/content
Stream a media object through the Cosend credential. A media lookup returns this address as its url in place of the one Meta gave, so the caller can fetch it
Scopes runtime:proxy
Response 200
The media object itself, under the content type Meta served it with. Fetched through the Cosend credential rather than the caller's. application/octet-stream
/authorize
GET /authorize
Start the MCP sign-in: checks the request and opens the consent screen
Scopes none (public endpoint)
Response 200
A page that sends the browser on to the Cosend consent screen. A request that cannot be accepted is sent back to the AI app with an OAuth error (302) when the app’s details were read from its own address; for an app that registered itself, or one that cannot be verified, it is shown as a 400 page. Too many sign-ins started from one address answer a 429 page. text/html; charset=utf-8
/free
GET /free
Refuses: the GET stream was removed in MCP 2026-07-28
Scopes none (public endpoint)
POST /free
The free-tools MCP endpoint: no sign-in, only the WhatsApp link, template check and message cost
Scopes none (public endpoint)
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| jsonrpc | "2.0" | required | |
| id | string | number | null | required | |
| result | object | required | |
| result.resultType | "complete" | optional | On every 2026-07-28 result. A 2025-era request (after initialize) gets that era’s plain result, which has none. |
Response 202
No content
DELETE /free
Refuses: there are no sessions to delete in MCP 2026-07-28
Scopes none (public endpoint)
/l
GET /l/{code}
Where a campaign’s tracked link button opens: counts the tap and sends the browser on to the business’s page
Scopes none (public endpoint)
Response 302
No content
Response 404
This link is no longer available. text/plain; charset=utf-8
/mcp
GET /mcp
Refuses: the GET stream was removed in MCP 2026-07-28
Scopes none (public endpoint)
POST /mcp
The MCP endpoint (Streamable HTTP: 2026-07-28, and 2025-11-25 through initialize)
Scopes none (public endpoint)
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| jsonrpc | "2.0" | required | |
| id | string | number | null | required | |
| result | object | required | |
| result.resultType | "complete" | optional | On every 2026-07-28 result. A 2025-era request (after initialize) gets that era’s plain result, which has none. |
Response 202
No content
DELETE /mcp
Refuses: there are no sessions to delete in MCP 2026-07-28
Scopes none (public endpoint)
/public
GET /public/v1/integrations
The integrations switched on here, for the site build: the key of each one
Scopes none (public endpoint)
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| integrations | object[] | required | |
| integrations[].key | string | required |
GET /public/v1/site-pages
The published marketing pages, for the site build: each one’s Markdown and images
Scopes none (public endpoint)
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | required | |
| data[].id | string | required | |
| data[].section | "guides" | "compare" | "docs-guides" | "use-cases" | "blog" | "tools" | required | |
| data[].slug | string | required | |
| data[].markdown | string | required | |
| data[].published_at | string (date-time) | required | |
| data[].updated_at | string (date-time) | required | |
| data[].images | object[] | required | |
| data[].images[].name | string | required | |
| data[].images[].url | string | required |
GET /public/v1/site-pages/images/{imageId}
An image a published marketing page shows. Any other image is 404
Scopes none (public endpoint)
Response 200
The image as it was uploaded (PNG, JPEG, WebP or GIF), with its own Content-Type. image/*
/register
POST /register
Register an AI app for the MCP sign-in (RFC 7591); public clients, PKCE only
Scopes none (public endpoint)
Response 201
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| client_id | string | required | |
| client_id_issued_at | integer | required | |
| client_name | string | optional | |
| redirect_uris | string[] | required | |
| application_type | string | optional | |
| token_endpoint_auth_method | "none" | required | |
| grant_types | string[] | required | |
| response_types | string[] | required |
/token
POST /token
Exchange an MCP authorization code or refresh token for an access token
Scopes none (public endpoint)
Response 200
OK application/json
| Field | Type | Required | Description |
|---|---|---|---|
| access_token | string | required | |
| token_type | "Bearer" | required | |
| expires_in | integer | required | |
| refresh_token | string | required | |
| scope | string | required |