Messages
Messages are the core unit of communication inside a thread. The API lets you read message history, search by text, send new outbound messages (text, attachments, voice notes), edit or delete an operator's recent messages, and track delivery statuses and reactions. `POST /messages/send` and `POST /messages/send-template` are the most common entry points — they resolve or create the right thread from a channel + recipient pair automatically.
Endpoints
| Method | Path | Summary |
|---|---|---|
| POST | /v1/messages/sendSend a message by channel and recipient (creates the thread if needed). | Send a message by channel and recipient (creates the thread if needed). |
| POST | /v1/messages/send-templateSend an approved WhatsApp template by channel and recipient (or thread_id). | Send an approved WhatsApp template by channel and recipient (or thread_id). |
| GET | /v1/messagesList messages filtered by conversation/thread/channel/direction. | List messages filtered by conversation/thread/channel/direction. |
| GET | /v1/messages/searchFull-text search for messages within a conversation. | Full-text search for messages within a conversation. |
| POST | /v1/messagesCreate a message directly (usually /messages/send is used instead). | Create a message directly (usually /messages/send is used instead). |
| GET | /v1/messages/{message}Get a message by id. | Get a message by id. |
| PATCH | /v1/messages/{message}Edit the text of your own outbound message (within the channel's edit window). | Edit the text of your own outbound message (within the channel's edit window). |
| DELETE | /v1/messages/{message}Delete a message (soft delete; mode=revoke also revokes it for the recipient where the channel supports it). | Delete a message (soft delete; mode=revoke also revokes it for the recipient where the channel supports it). |
| GET | /v1/messages/{message}/aroundA window of messages around a given message (for jump-to-context navigation). | A window of messages around a given message (for jump-to-context navigation). |
| GET | /v1/messages/{message}/attachmentsList a message's attachments. | List a message's attachments. |
| POST | /v1/messages/{message}/attachmentsAttach a file to an already-created message. | Attach a file to an already-created message. |
| GET | /v1/messages/{message}/statusesDelivery status history (sent/delivered/read/failed). | Delivery status history (sent/delivered/read/failed). |
| POST | /v1/messages/{message}/statusesRecord a delivery status for a message. | Record a delivery status for a message. |
| GET | /v1/messages/{message}/reactionsList emoji reactions on a message. | List emoji reactions on a message. |
| POST | /v1/messages/{message}/reactionsAdd an emoji reaction to a message on behalf of the company. | Add an emoji reaction to a message on behalf of the company. |
Examples
Send a text message
Request
curl -X POST "https://api.aisar.app/v1/messages/send" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"channel_id": 3,
"recipient": "+77001234567",
"message_content": "Здравствуйте! Ваш заказ №1045 передан в доставку."
}'Response
{
"success": true
}List messages in a conversation
Request
curl -X GET "https://api.aisar.app/v1/messages?conversation_id=15&perPage=20" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json"Response
{
"data": {
"items": [
{
"id": 1001,
"conversation_id": 15,
"thread_id": 33,
"channel_id": 3,
"direction": "outbound",
"message_type": "text",
"message_content": { "text": "Здравствуйте! Ваш заказ №1045 передан в доставку." },
"display_content": { "text": "Здравствуйте! Ваш заказ №1045 передан в доставку." },
"is_deleted": false,
"timestamp": "2026-02-09T18:00:00Z",
"created_at": "2026-02-09T18:00:00Z",
"updated_at": "2026-02-09T18:00:00Z",
"can_revoke_until": "2026-02-09T18:15:00Z",
"can_edit_until": "2026-02-09T18:15:00Z"
}
],
"pagination": { "page": 1, "perPage": 20, "total": 1, "lastPage": 1 }
}
}