Messages
Send Message
Send any type of message through a single endpoint. The message type is inferred from the optional fields provided.
Endpoint
Send any type of message through a single endpoint. The message type is inferred from the optional fields provided.
Request
POST /sendAuthentication
Every request must include a Bearer token in the Authorization header. Missing or invalid API keys return 401 Unauthorized.
Header
Authorization: Bearer YOUR_API_KEYRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
| session | string | Yes | Session ID |
| to | string | Yes | Recipient phone number |
| text | string | No | Text content or caption |
| imageUrl | string | No | URL of image to send |
| videoUrl | string | No | URL of video to send |
| documentUrl | string | No | URL of document to send |
| audioUrl | string | No | URL of audio to send |
| mimetype | string | No | MIME type of the media |
| filename | string | No | Filename for the attachment |
| preview | Record<string,string> | No | Custom link preview key-value pairs |
Response
| Field | Type | Description |
|---|---|---|
| id | string | Unique message identifier |
| to | string | Recipient phone number or group JID |
| content | string | Message content, media reference, or caption |
| type | string | Message type: text, image, video, document, or ptt |
| timestamp | string | ISO 8601 timestamp of when the message was sent |
| status | string | Delivery status such as sent, delivered, or read |
| fromMe | boolean | True when sent by the current session |
| sender | string | Sender phone number |
| recipient | string | Recipient identifier |
Examples
cURL
curl -X POST "https://api.example.com/send" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"session": "SESSION_ID",
"to": "+1234567890",
"text": "Hello from ChatSend"
}'Response
{
"id": "msg_123",
"to": "+1234567890",
"content": "Hello from ChatSend",
"type": "text",
"timestamp": "2026-04-15T10:00:00.000Z",
"status": "sent",
"fromMe": true,
"sender": "+1234567890",
"recipient": "+1234567890"
}Notes
- If only text is provided, the server sends a text message.
- Maximum media file size is 16 MB.
- Maximum text length is 4096 characters.