Messages
Send a message
Sends a text message to the conversation through the workspace’s active connection (QR-linked number or Cloud API) and returns the stored message with status sent. Live listeners receive message.created and conversation.updated events.
- Bearer API key
- Scope:
write - or app session
- Workspace:
X-Tenant-ID(optional with a key)
Path parameters
iduuidrequiredConversation id.
Headers
AuthorizationstringrequiredYour API key as
Bearer <key>. The wordBearerand the space are case-sensitive. Browser clients signed in to the app use the session cookie instead.X-Tenant-IDuuidoptionalWorkspace id. Optional with an API key (a key always acts in its own workspace); if you send it, it must match the key’s workspace. Required with a session cookie. You can pass
?tenant=<id>instead.
Body
application/jsonbodystringrequiredMessage text. Leading and trailing spaces are trimmed.
Response
201 Createdapplication/json
iduuidMessage id in whatsappx.si.
whatsapp_message_idstringMessage id assigned by WhatsApp.
conversation_iduuidConversation the message belongs to.
sender_jidstringWhatsApp id (JID) of the sender. For your own messages, the connected number.
sender_namestringSender display name, when WhatsApp provides one (may be empty).
contentstringMessage text. On numbers linked by QR code, images and documents carry their caption here. On the Cloud API, non-text messages are stored as a placeholder such as
[image message].message_typestringtext,imageordocumenton numbers linked by QR code. Non-text messages received through the Cloud API keep the type name Meta sends (for exampleimageoraudio) and have no downloadable media.media_urlstringmay be absentPath of the downloaded media file, for example
/api/media/<workspace>/<file>. Prefix it withhttps://whatsappx.siand send your API key to download it.mime_typestringmay be absentMIME type of the media file.
file_namestringmay be absentOriginal file name of a document.
file_sizeintegermay be absentMedia size in bytes.
timestamptimestampWhen the message was sent on WhatsApp (RFC 3339).
from_mebooleantruefor messages sent from the connected number (by your team, the API or an automation).statusenumreceivedfor incoming messages,sentfor outgoing ones. Delivered and read receipts are not tracked.created_attimestampWhen whatsappx.si stored the message (RFC 3339).
Status codes
- 201Created. The message was sent and stored.
- 400Bad request.
message body is required,message body too long,invalid request body,invalid conversation id, or the conversation cannot be used for sending (conversation belongs to an inactive channel,conversation has no whatsapp jid,invalid chat jid). - 401Unauthorized. The API key is unknown, revoked or expired (
invalid or expired API key), or there is no key and no signed-in session (unauthorized). - 402Payment required. Only when subscriptions are enforced and the workspace has no active subscription. The body includes
code: "payment_required". - 403Forbidden. The API key has the
readscope, which only allows GET requests (API key is read-only). A key in another workspace getsAPI key belongs to a different workspace. - 404Not found. The conversation does not exist in this workspace, belongs to the inactive connection, or (for agents signed in to the app) is not assigned to you.
- 409Conflict. The WhatsApp connection is not ready to send (
whatsapp is not connected). - 500Server error. WhatsApp or Meta rejected the message, or it could not be stored. The
errorcarries the reason.