AISARAISAR
REST API

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

MethodPath
POST/v1/messages/send

Send a message by channel and recipient (creates the thread if needed).

POST/v1/messages/send-template

Send an approved WhatsApp template by channel and recipient (or thread_id).

GET/v1/messages

List messages filtered by conversation/thread/channel/direction.

GET/v1/messages/search

Full-text search for messages within a conversation.

POST/v1/messages

Create a message directly (usually /messages/send is used instead).

GET/v1/messages/{message}

Get a message by id.

PATCH/v1/messages/{message}

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).

GET/v1/messages/{message}/around

A window of messages around a given message (for jump-to-context navigation).

GET/v1/messages/{message}/attachments

List a message's attachments.

POST/v1/messages/{message}/attachments

Attach a file to an already-created message.

GET/v1/messages/{message}/statuses

Delivery status history (sent/delivered/read/failed).

POST/v1/messages/{message}/statuses

Record a delivery status for a message.

GET/v1/messages/{message}/reactions

List emoji reactions on a message.

POST/v1/messages/{message}/reactions

Add an emoji reaction to a message on behalf of the company.

Examples

Send a text message

Request

bash
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

json
{
  "success": true
}

List messages in a conversation

Request

bash
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

json
{
  "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 }
  }
}