AISARAISAR
REST API

Channels

A channel is a connected messaging source: WhatsApp, Telegram, Instagram, SIP telephony, etc. Connecting and provisioning a new channel (QR pairing, Meta OAuth, SIP setup) happens through the onboarding wizard in the client dashboard (my.aisar.app/settings/channels/add) rather than directly through this API — the wizard uses separate, provider-specific setup endpoints. Through the public REST API you read the channel list and its connection state, manage the lifecycle of an already-connected channel (pause/resume/reconnect/disconnect), and configure operator access rules for it.

Endpoints

MethodPath
GET/v1/channels

List the company's channels (setup drafts excluded by default).

GET/v1/channels/{channel}

Get a channel by id along with its provider configuration.

GET/v1/channel-types

Reference list of channel types with their capabilities and providers.

POST/v1/channels/{channel}/disconnect

Disconnect a channel (stop sending/receiving messages).

POST/v1/channels/{channel}/reconnect

Reconnect a previously disconnected channel.

POST/v1/channels/{channel}/pause

Pause a channel (temporarily, without tearing down the session).

POST/v1/channels/{channel}/resume

Resume a paused channel.

DELETE/v1/channels/{channel}

Delete a channel (soft delete).

GET/v1/channels/{channel}/access

Operator/team access rules for the channel.

POST/v1/channels/{channel}/access

Update channel access rules (allow/block per team or user).

Examples

List connected channels

Request

bash
curl -X GET "https://api.aisar.app/v1/channels?status=connected" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json"

Response

json
{
  "data": [
    {
      "id": 3,
      "company_id": 1,
      "channel_type_id": 1,
      "provider_key": "whatsapp",
      "name": "Основной WhatsApp",
      "account_name": "+77001234567",
      "status": "connected",
      "setup_state": "ready",
      "allow_broadcasts": true,
      "allow_automations": true,
      "allow_inbound_handling": true,
      "connected_at": "2026-01-15T09:00:00Z",
      "last_inbound_at": "2026-02-09T18:00:00Z",
      "channel_type": { "id": 1, "key": "whatsapp", "name": "WhatsApp" }
    }
  ]
}

Pause a channel

Request

bash
curl -X POST "https://api.aisar.app/v1/channels/3/pause" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Response

json
{
  "data": {
    "message": "Channel status updated.",
    "channel": {
      "id": 3,
      "status": "paused",
      "status_changed_at": "2026-02-09T18:30:00Z"
    }
  }
}