Send a message
Queue a text, template, media, or structured message to an existing conversation, or to a contact or phone number on a channel connection. Requires the messages.send scope. Exactly one target form is allowed: conversationId, or contactId with channelConnectionId, or phone with channelConnectionId. senderId is only accepted together with channelConnectionId. A 202 means the message is queued; track it with GET /messages/{messageId} or the message.* webhooks. Button payloads, button ids and list row ids must not start with wtf:; such a send answers 422 MESSAGE_RESERVED_ID.
An optional Idempotency-Key returns the original acceptance body on completed repeats. Without a key, a repeat can send another message.
Responses
| Status | Meaning and codes |
|---|---|
| 202 | Accepted and queued. |
| 400 | undefined |
| 401 | undefined |
| 403 | undefined |
| 404 | undefined |
| 409 | undefined |
| 422 | undefined |
| 429 | undefined |
Success and handled error responses send Cache-Control: no-store and X-Correlation-ID (the resolved/generated UUID). Errors use application/problem+json and the reusable ProblemDetails schema below. Retry-After: 1 is sent only for RATE_LIMITED. Request examples read your key from a server environment variable; replace all fictional values.
Schemas and examples
ApiKeyAuthorizationBearer <token>Server-side API key. publicId is 12 lowercase base32 characters (a-z, 2-7); secret is 43 base64url characters from 32 random bytes. Use Authorization: Bearer <complete key>. The API key determines the workspace; requests cannot select another workspace. All public routes share 20 requests per second per key. See API-key authentication.
Idempotency-Key?stringOptional string of at most 128 characters. Empty string is accepted by validation; use a unique non-empty value per request. Save it and reuse it if you are unsure whether the request succeeded. See each operation for which values must match on repeated requests.
length <= 128X-Correlation-ID?stringOptional tracing ID. A UUID-shaped value is echoed in the response. Missing or invalid values are replaced with a generated UUID, not rejected.
application/json- body
Target rules are checked by the service. Use exactly one of conversationId, contactId with channelConnectionId, or phone with channelConnectionId.
conversationId?stringuuidcontactId?stringuuidphone?stringE.164 number with the leading plus sign.
^\+[1-9]\d{1,14}$channelConnectionId?stringuuidsenderId?stringOnly accepted together with channelConnectionId.
1 <= length <= 128message*Discriminated by type. Text and template messages, image, video, document, audio and sticker messages, and structured types such as buttons, list, location and reaction.
Accepted and queued.
application/json- response
messageId*stringuuidconversationId*stringuuidcontactId*stringuuidstatus*"queued""queued"