Skip to content

Act

Sending messages

One endpoint sends every kind of message on every channel. Braidport adapts what a channel cannot show, and tells you clearly when it cannot send at all.

On this page

The request#

POST/v1/messagesscope send

Send a message (synchronous; idempotent with an Idempotency-Key header)

cURLbash
curl -X POST https://api.braidport.com/v1/messages \  -H "Authorization: Bearer $BRAIDPORT_API_KEY" \  -H "Idempotency-Key: booking-8841-confirmation" \  -H "Content-Type: application/json" \  -d '{  "conversation_id": "cnv_djF8Y2hfMDFtNzRlNTAzcW00Y2Z0OHh2dHE4NWc5OHN8SVQuMTM0OTEyMDg2NTUzMDI3NDE5MTh8",  "type": "text",  "text": "See you tomorrow at 10:00",  "client_reference": "booking-8841"}'
200 OKjson
{  "provider_message_id": "wamid.HBgMMzkzNDAxMjM0NTY3FQIAERgSQjI",  "conversation_id": "cnv_djF8Y2hfMDFtNzRlNTAzcW00Y2Z0OHh2dHE4NWc5OHN8SVQuMTM0OTEyMDg2NTUzMDI3NDE5MTh8",  "channel_id": "ch_01m74e503qm4cft8xvtq85g98s",  "status": "sent",  "client_reference": "booking-8841"}
FieldTypeDescription
provider_message_idstringThe provider's id of the sent message. Statuses refer to it.
conversation_idcnv_ id≤ 2,048 charsThe conversation, also when you addressed the message with channel_id + to.
channel_idch_ idThe channel it was sent on.
status"sent"Always sent: the provider accepted the message. Later changes arrive as message.status.
client_referencestring | nullYour reference, or null.

The call is synchronous: a 200 means the provider accepted the message. Later receipts arrive as message.status events, and the send itself is reported as message.sent with source: "api". Each send counts as one event of your plan, except on the sandbox.

Addressing#

Use exactly one of the two forms:

  • conversation_id from an event: the usual way to reply. It already names the channel and the contact.
  • channel_id + to to write to someone first: a phone number, a WhatsApp BSUID, a Messenger PSID, an Instagram IGSID or a Telegram chat id. The response returns the conversation_id to use from then on.
channel_id + tojson
{  "channel_id": "ch_01m74e503qm4cft8xvtq85g98s",  "to": "+393401234567",  "type": "template",  "template": {    "name": "appointment_reminder",    "language": "en_US",    "variables": [      "Mario",      "10:00"    ]  }}

With an organization key, the workspace follows from the conversation or the channel. On WhatsApp, a first message to a contact outside the 24-hour window must be a template.

Message types#

type decides which payload field is required; every other payload field is rejected with validation_failed.

typeRequiresNotes
texttextPlain text.
imagemediaCaption in media.caption.
audiomediamedia.voice: true sends a voice note.
videomediaCaption in media.caption.
documentmediaFile name in media.filename.
buttonstext, buttonsReply buttons under a prompt.
listtext, listA menu of rows in sections.
templatetemplateWhatsApp message templates.
reactionreactionAn emoji on an earlier message.
FieldTypeDescription
conversation_idcnv_ idoptional≤ 2,048 charsReply in a known conversation. Use either this…
channel_idch_ idoptional…or this channel together with to.
tostringoptional≤ 256 charsRecipient on that channel: phone number, WhatsApp BSUID, PSID, IGSID or Telegram chat id.
type"text" | "image" | "audio" | "video" | "document" | "buttons" | "list" | "template" | "reaction"requiredWhat to send. It decides which payload field is required; every other payload field is rejected.
textstringoptional≤ 32,768 charsBody of a text message, or the prompt shown above buttons and list. Media messages use media.caption.
mediaobjectoptionalimage, audio, video and document only.
media.urlURLrequired≤ 2,048 charsPublic URL the API downloads the file from.
media.captionstring≤ 4,096 charsCaption shown with the file, where the channel supports captions.
media.filenamestring≤ 255 charsFile name shown to the recipient (documents).
media.voicebooleandefault falseaudio only: send as a voice note. A file that is not OGG/Opus is sent as a normal audio file.
buttonsobject[]optional≥ 1 items≤ 50 itemsbuttons only: reply buttons. Ids must be unique.
buttons[].idstringrequired≤ 256 charsYour id, returned in interactive_reply.id when the contact taps it.
buttons[].titlestringrequired≤ 256 charsVisible title.
listobjectoptionallist only: a menu of rows in sections.
list.buttonstringrequired≤ 256 charsLabel of the button that opens the list.
list.sectionsobject[]required≥ 1 items≤ 20 itemsSections of rows (at most 100 rows in total).
list.sections[].titlestring≤ 256 charsSection heading.
list.sections[].rowsobject[]required≥ 1 items≤ 100 itemsRows of the section.
list.sections[].rows[].idstringrequired≤ 256 charsYour id, returned in interactive_reply.id. Unique across the list.
list.sections[].rows[].titlestringrequired≤ 256 charsVisible title.
list.sections[].rows[].descriptionstring≤ 512 charsSecondary line under the title.
templateobjectoptionaltemplate only: an approved WhatsApp message template.
template.namestringrequired≤ 512 charsTemplate name.
template.languagestringrequired≤ 32 charsTemplate language code, such as en_US.
template.variablesstring[] | objectBody parameters: positional (["Mario", "10:00"]) or named ({ "customer_name": "Mario" }).
template.headerobject | objectHeader parameter: { "type": "image" | "video" | "document", "url" } or { "type": "text", "text", "parameter_name"? }. parameter_name names the header variable of a named template: required with named variables, refused with positional ones.
template.componentsobject[] | null≤ 50 itemsProvider-native components passed through untouched. Replaces variables and header.
reactionobjectoptionalreaction only.
reaction.emojistringrequired≤ 32 charsThe emoji. An empty string removes an earlier reaction.
reaction.provider_message_idstringrequired≤ 512 charsThe message to react to.
reply_toobjectoptionalQuote an earlier message (not allowed on reactions).
reply_to.provider_message_idstringrequired≤ 512 charsThe message to quote.
client_referencestringoptional≤ 256 charsYour own reference, echoed in message.sent and every message.status of this message.
fallback"degrade" | "strict"optionaldefault "degrade"degrade adapts content the channel cannot show natively; strict fails instead.

Examples

buttonsjson
{  "conversation_id": "cnv_djF8Y2hfMDFtNzRlNTAzcW00Y2Z0OHh2dHE4NWc5OHN8SVQuMTM0OTEyMDg2NTUzMDI3NDE5MTh8",  "type": "buttons",  "text": "Can you make Tuesday at 10:00?",  "buttons": [    {      "id": "confirm",      "title": "Confirm"    },    {      "id": "reschedule",      "title": "Another time"    }  ]}
listjson
{  "conversation_id": "cnv_djF8Y2hfMDFtNzRlNTAzcW00Y2Z0OHh2dHE4NWc5OHN8SVQuMTM0OTEyMDg2NTUzMDI3NDE5MTh8",  "type": "list",  "text": "Pick a time for your cleaning",  "list": {    "button": "Choose",    "sections": [      {        "title": "Morning",        "rows": [          {            "id": "s1",            "title": "09:00"          },          {            "id": "s2",            "title": "10:30"          }        ]      },      {        "title": "Afternoon",        "rows": [          {            "id": "s3",            "title": "15:00",            "description": "With Dr. Bianchi"          }        ]      }    ]  }}
imagejson
{  "conversation_id": "cnv_djF8Y2hfMDFtNzRlNTAzcW00Y2Z0OHh2dHE4NWc5OHN8SVQuMTM0OTEyMDg2NTUzMDI3NDE5MTh8",  "type": "image",  "media": {    "url": "https://example.com/clinic-map.png",    "caption": "How to find us"  }}
audio (voice note)json
{  "conversation_id": "cnv_djF8Y2hfMDFtNzRlNTAzcW00Y2Z0OHh2dHE4NWc5OHN8SVQuMTM0OTEyMDg2NTUzMDI3NDE5MTh8",  "type": "audio",  "media": {    "url": "https://example.com/reply.ogg",    "voice": true  }}
documentjson
{  "conversation_id": "cnv_djF8Y2hfMDFtNzRlNTAzcW00Y2Z0OHh2dHE4NWc5OHN8SVQuMTM0OTEyMDg2NTUzMDI3NDE5MTh8",  "type": "document",  "media": {    "url": "https://example.com/price-list.pdf",    "filename": "Price list.pdf"  }}
reactionjson
{  "conversation_id": "cnv_djF8Y2hfMDFtNzRlNTAzcW00Y2Z0OHh2dHE4NWc5OHN8SVQuMTM0OTEyMDg2NTUzMDI3NDE5MTh8",  "type": "reaction",  "reaction": {    "emoji": "👍",    "provider_message_id": "wamid.HBgMMzkzNDAxMjM0NTY3FQIAEhgUM0E"  }}
reply quoting a messagejson
{  "conversation_id": "cnv_djF8Y2hfMDFtNzRlNTAzcW00Y2Z0OHh2dHE4NWc5OHN8SVQuMTM0OTEyMDg2NTUzMDI3NDE5MTh8",  "type": "text",  "text": "Yes, Tuesday is free.",  "reply_to": {    "provider_message_id": "wamid.HBgMMzkzNDAxMjM0NTY3FQIAEhgUM0E"  }}

When the contact taps a button or a list row, you receive a message.received of type interactive_reply whose interactive_reply.id is the id you sent. Media is fetched from media.url by the API; see Media for sizes and errors.

Graceful degradation#

Channels differ in what they can display. With the default "fallback": "degrade", Braidport sends the closest thing the channel supports:

  • WhatsApp: more than 3 buttons become a list.
  • A list longer than the channel allows (on WhatsApp, 10 rows), or more than 13 Instagram quick replies, becomes numbered text.
  • On a channel without native buttons or lists, they become quick replies, an inline keyboard (Telegram) or numbered text.
  • Titles longer than the channel allows are shortened with an ellipsis.

With "fallback": "strict" any of these changes fails the request instead, with interactive_limits_exceeded or unsupported_message_type:

strictjson
{  "conversation_id": "cnv_djF8Y2hfMDFtNzRlNTAzcW00Y2Z0OHh2dHE4NWc5OHN8SVQuMTM0OTEyMDg2NTUzMDI3NDE5MTh8",  "type": "buttons",  "text": "Which service?",  "buttons": [    {      "id": "cleaning",      "title": "Cleaning"    },    {      "id": "checkup",      "title": "Check-up"    },    {      "id": "whitening",      "title": "Whitening"    },    {      "id": "other",      "title": "Something else"    }  ],  "fallback": "strict"}

Telegram limits button data to 64 bytes, so button and row ids longer than that are rejected on Telegram, with a hint. Keep ids short everywhere.

Templates and the 24-hour window#

On WhatsApp, a business can send free-form messages only within 24 hours of the contact's last message. Outside that window the API answers window_closed, with details.suggestion set to send_template:

422 window_closedjson
{  "error": {    "code": "window_closed",    "message": "The 24-hour customer service window for this conversation is closed.",    "retryable": false,    "hint": "The customer service window is closed. Send an approved template instead.",    "details": {      "window_expired_at": "2026-11-09T19:20:29.000Z",      "suggestion": "send_template"    },    "provider": {      "name": "whatsapp",      "code": "131047"    },    "request_id": "req_01m74e503r2y8b6c4d0f1g3h5j"  }}

Then send an approved message template. Variables are positional or named, and a header can carry an image, a video, a document or text:

templatejson
{  "conversation_id": "cnv_djF8Y2hfMDFtNzRlNTAzcW00Y2Z0OHh2dHE4NWc5OHN8SVQuMTM0OTEyMDg2NTUzMDI3NDE5MTh8",  "type": "template",  "template": {    "name": "appointment_reminder",    "language": "en_US",    "variables": {      "customer_name": "Mario",      "time": "10:00"    },    "header": {      "type": "image",      "url": "https://example.com/clinic.jpg"    }  }}

In a template created with named parameters, a variable in a text header has a name too: pass it as header.parameter_name, next to the named body variables. A template whose only variable is in the header leaves variables out. Named body variables with a text header that has no name are refused with validation_failed at template.header.parameter_name before the message is accepted, and so is parameter_name with positional variables:

named template with a text headerjson
{  "conversation_id": "cnv_djF8Y2hfMDFtNzRlNTAzcW00Y2Z0OHh2dHE4NWc5OHN8SVQuMTM0OTEyMDg2NTUzMDI3NDE5MTh8",  "type": "template",  "template": {    "name": "order_update",    "language": "en_US",    "variables": {      "customer_name": "Ana"    },    "header": {      "type": "text",      "parameter_name": "order_id",      "text": "42"    }  }}

For anything else a template supports, pass Meta's own components array instead of variables and header; it is sent untouched. Manage templates per channel:

GET/v1/channels/:id/templatesscope read

List the WhatsApp message templates of a channel

POST/v1/channels/:id/templatesscope send

Submit a WhatsApp message template for review

DELETE/v1/channels/:id/templates/:namescope send

Delete a WhatsApp message template in every language

New templates are reviewed by Meta; the result arrives as template.status_changed. Meta bills template messages to the client's own WhatsApp account, not through Braidport.

Typing indicators and read receipts#

POST/v1/conversations/:conversation_id/typingscope send

Show a typing indicator in a conversation

POST/v1/conversations/:conversation_id/readscope send

Mark a received message as read

Show that a reply is being prepared while your agent works. On WhatsApp the typing indicator needs the provider_message_id of the message you are answering, and it also marks that message as read. Mark a message as read on its own with /read.

client_reference#

Put your own id (a booking, a ticket, a run of your agent) in client_reference, up to 256 characters. It comes back in the response, in message.sent and in every message.status of that message, so you can match receipts without storing provider ids.

Idempotency and retries#

Send an Idempotency-Key header on every POST. Braidport remembers the key for 24 hours:

  • The same key with the same body returns the first response again, except after a message or e-mail send whose delivery is unknown (see below): then it answers 409 conflict with details.reason: "delivery_unknown" for 24 hours and nothing is sent.
  • The exception is POST /v1/workspaces/:id/api-keys: the new key is shown only once, so a replay gets 409 conflict with details.reason: "already_created" and the key's details.id. If the key was lost, revoke it and create a new one.
  • A duplicate that arrives while the first request is still running gets 409 conflict with details.reason: "in_progress".
  • The same key with a different body gets idempotency_conflict.

Braidport never sends a message twice on its own. It retries inside the request only when the provider certainly did not receive it. If the provider times out or fails after the message was handed over, the answer is provider_unavailable with retryable: false and details.delivery: "unknown": the message may have gone out. A retry with the same Idempotency-Key never sends it twice: it answers 409 conflict with details.reason: "delivery_unknown". Check whether it went out first: on Messenger and Instagram, Meta's echo of the message arrives as a message.sent; on WhatsApp, a message.status in that conversation with a provider_message_id you have not seen may show it; on Telegram, nothing reports it. Send with a new key only once you know the message did not go out.

Rate limits

Each API key may make 1,200 requests a minute (bursts of 40 a second), answered with rate_limited beyond that. Each channel also has its own send rate from the provider; beyond it you get provider_rate_limited. Both carry Retry-After. A send to a sandbox conversation counts 2 of the 1,000 test events an organization may create per UTC day, also answered with rate_limited beyond that (see Sandbox).