Messages
On WhatsApp, send an approved template at any time, or a free-form message (text, image, video, document, audio, location, buttons, list, CTA link) in the 24-hour customer window with zero Meta template fees. On Instagram and Facebook, send text in that window. Then follow the message until it is delivered or read.
These examples use a placeholder address. Your console shows the exact address of the API for your workspace.
- Free WhatsApp 24-hour window (Service Conversations): in the 24 hours following the customer's last message, all free-form messages (text, image, video, PDF document, audio, GPS location, interactive buttons, dropdown lists, CTA links) incur 100% zero Meta template fees. Outside 24 hours, only an approved template is allowed.
- On an Instagram or Facebook connection,
tois the platform id (IGSID or PSID) of a person who already wrote to that account, onlytextis accepted, and their last message must be less than 24 hours old. Otherwise the call fails withnot_found(an id that never wrote),outside_customer_windoworinvalid_request. Texts are limited to 1,000 characters on Instagram and 2,000 on Facebook. - Media & interactifs: send images, videos, documents, and audios via public secure HTTPS URLs. Provide quick-reply buttons (1 to 3), dropdown selection lists (up to 10 options), or an external CTA link button.
- AI Bot Cohabitation: if the Vendrix AI bot is enabled on your WhatsApp test number, pause the bot in Settings > Automation so the AI does not respond in competition with your external project (bus ticketing, airtime recharge, etc.).
- A live send appears in the business's Inbox like a message from the team, and its status changes produce
message.status_updatedevents. - Statuses of an outbound message:
queued,sent,delivered,read,failed,uncertain.uncertaincarries the errordelivery_uncertainand means Meta may have received the message before the connection dropped: check the conversation before sending it again, the API never retries it on its own.
curl -X POST "https://vendrix-api-7897083941.europe-west4.run.app/api/public/v1/messages" \
-H "Authorization: Bearer $VENDRIX_API_KEY" \
-H "Idempotency-Key: ig-reply-1042" \
-H "Content-Type: application/json" \
-d '{
"connection_id": "3d5f7a91-2b4c-4e68-9a0b-1c2d3e4f5a67",
"to": "17841400000000001",
"type": "text",
"text": {
"body": "Yes, it is in stock in blue."
}
}'curl -X POST "https://vendrix-api-7897083941.europe-west4.run.app/api/public/v1/messages" \
-H "Authorization: Bearer $VENDRIX_API_KEY" \
-H "Idempotency-Key: ticket-1042-image" \
-H "Content-Type: application/json" \
-d '{
"connection_id": "6f0a3b1c-9d2e-4f50-8a71-3c5e7d9b1a24",
"to": "+237670000000",
"type": "image",
"image": {
"url": "https://example.com/tickets/ticket-1042.jpg",
"caption": "Voici votre ticket de réservation pour le bus de 14h."
},
"client_reference": "ticket-1042"
}'POST /messages
Sends a message from one of your connections and returns it with the queued status. On WhatsApp send either a template, at any time, or a text or image, inside the 24-hour customer window. On Instagram and Facebook send a text, inside that window.
- Exactly one of
text,templateorimagemust be present, matchingtype. - The number of
template.variablesmust equal thevariable_countof the template. - Repeating the call with the same
Idempotency-Keyand body does not send a second message. See idempotency.
- Required scope
messages.send- HTTP
- Success: HTTP 202
Parameters
| Name | Description |
|---|---|
Idempotency-Keystring (1 to 255 characters) | Identifies this send. 1 to 255 printable ASCII characters. |
connection_idstring (UUID) | The id of the connection to send from. It must be active. |
tostring (E.164 on WhatsApp, IGSID/PSID on Instagram/Facebook) | The recipient. On WhatsApp, a phone number in E.164 format, with or without the leading +. On Instagram and Facebook, the platform id (IGSID or PSID) of a person who already wrote to the account. |
typetext | template | image | video | document | audio | location | buttons | list | cta_url | text, template, image, video, document, audio, location, buttons, list or cta_url. |
text.bodystring (1 to 4,096 characters) | The text of the message, 1 to 4,096 characters (1,000 on Instagram, 2,000 on Facebook). Only for type: text. |
template.namestring | The name of an approved template. Only for type: template. |
template.languagestring | The language code of that template, such as fr. |
template.variablesstring[] (0 to 10) | The values of the template variables, in order. Each is 1 to 1,024 characters. |
image.urlstring (HTTPS URL) | The public HTTPS URL of the image (up to 2,048 characters). Only for type: image. |
image.captionstring (0 to 1,024 characters) | The text caption accompanying the image (up to 1,024 characters). Optional, only for type: image. |
video.urlstring (HTTPS URL) | The public HTTPS URL of the video (up to 2,048 characters). Only for type: video. |
video.captionstring (0 to 1,024 characters) | The text caption accompanying the video (up to 1,024 characters). Optional, only for type: video. |
document.urlstring (HTTPS URL) | The public HTTPS URL of the document (PDF, etc., up to 2,048 characters). Only for type: document. |
document.filenamestring (0 to 256 characters) | The filename displayed for the document (up to 256 characters). Optional, only for type: document. |
document.captionstring (0 to 1,024 characters) | The caption accompanying the document (up to 1,024 characters). Optional, only for type: document. |
audio.urlstring (HTTPS URL) | The public HTTPS URL of the audio file (up to 2,048 characters). Only for type: audio. |
location.latitudenumber (-90 to 90) | The geographic latitude (-90.0 to 90.0). Only for type: location. |
location.longitudenumber (-180 to 180) | The geographic longitude (-180.0 to 180.0). Only for type: location. |
location.namestring (0 to 256 characters) | The name of the location (up to 256 characters). Optional, only for type: location. |
location.addressstring (0 to 512 characters) | The postal or descriptive address of the location (up to 512 characters). Optional, only for type: location. |
buttons.bodystring (1 to 1,024 characters) | The main text body accompanying the quick-reply buttons (up to 1,024 characters). Only for type: buttons. |
buttons.buttonsActionButton[] (1 to 3 buttons) | The list of 1 to 3 action buttons (id and title up to 20 characters). Only for type: buttons. |
buttons.headerstring (0 to 60 characters) | Optional header text above the message (up to 60 characters). |
buttons.footerstring (0 to 60 characters) | Optional footer text below the message (up to 60 characters). |
list.bodystring (1 to 1,024 characters) | The main text body of the selection menu (up to 1,024 characters). Only for type: list. |
list.button_textstring (1 to 20 characters) | The button label opening the menu list (up to 20 characters). Only for type: list. |
list.sectionsListSection[] (1 to 10 sections, total rows <= 10) | The sections containing menu rows (1 to 10 rows total). Only for type: list. |
list.headerstring (0 to 60 characters) | Optional header text for the menu (up to 60 characters). |
list.footerstring (0 to 60 characters) | Optional footer text for the menu (up to 60 characters). |
cta_url.bodystring (1 to 1,024 characters) | The main text body of the call-to-action message (up to 1,024 characters). Only for type: cta_url. |
cta_url.display_textstring (1 to 20 characters) | The label shown on the CTA link button (up to 20 characters). Only for type: cta_url. |
cta_url.urlstring (HTTPS URL) | The target HTTPS URL opened on tap (up to 2,048 characters). Only for type: cta_url. |
cta_url.headerstring (0 to 60 characters) | Optional header text for the CTA message (up to 60 characters). |
cta_url.footerstring (0 to 60 characters) | Optional footer text for the CTA message (up to 60 characters). |
client_referencestring (1 to 128 characters) | Your own reference, returned on the message and in its events. |
Errors
- invalid_request
- idempotency_key_required
- idempotency_conflict
- not_found
- connection_inactive
- invalid_phone_number
- outside_customer_window
- template_not_found
- template_not_approved
- template_variables_mismatch
- daily_send_limit_reached
- service_unavailable
Any authenticated endpoint can also return the authentication, scope and rate limit errors listed on the errors page.
GET /messages/{id}
Returns a message and its current status.
- A live key can read the messages sent through the developer API by any application of the workspace, and the inbound customer messages of its connections. Any other id is
404 not_found. - A sandbox key reads the sandbox messages of its own application.
- Required scope
messages.read- HTTP
- Success: HTTP 200
Parameters
| Name | Description |
|---|---|
idstring (UUID) | The id of the message. |
Errors
Any authenticated endpoint can also return the authentication, scope and rate limit errors listed on the errors page.