Send Message
Send text or media messages to individual contacts or groups.
Endpoint: POST /v1/messages/send
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
type | enum | Yes | One of: text, image, video. |
content | string | Yes | Message text OR URL/Base64 of the media. |
recipients | array | No* | Array of phone numbers in E.164 format (e.g. "12125551234"). |
groupIds | array | No* | Array of Group IDs to send to. |
caption | string | No | Caption for media messages. |
deviceId | string | No | Specific device ID to send from. Defaults to your primary device. |
* At least one of recipients or groupIds must be provided.
Example: Text Message
{
"type": "text",
"content": "Hello! Your appointment is confirmed.",
"recipients": ["12125551234", "12125555678"]
}
Example: Media Message to Group
{
"type": "image",
"content": "https://example.com/invoice.pdf",
"caption": "Here is your invoice",
"groupIds": ["64f8a123..."]
}
Response
{
"success": true,
"transactionId": "tx_12345...",
"status": "pending"
}