Skip to content
AISARAISAR
REST API

CSAT analytics

Customer-satisfaction (CSAT) analytics for a company’s closed conversations. Four read-only endpoints under /v1/csat aggregate satisfaction-survey results for a chosen period: summary metrics, breakdowns, a day-by-day trend, and a list of negatively rated conversations.

Access and enabling CSAT

All four endpoints require an active subscription and the company.view permission; in addition, CSAT must be enabled in the company settings — if surveys are turned off, every endpoint returns 404.

Period parameters

The period parameters are identical across all four endpoints:

  • periodtoday, 7d, 30d (default 7d), or an explicit from+to range (YYYY-MM-DD dates; applied only when both are set and to is ≥ from).
  • timezone — an IANA zone used to compute day boundaries (default UTC).

What each endpoint returns

  • GET /csat/metrics — a summary: sent (surveys in pending/responded/expired status), responded, positive, negative, satisfaction_pct (share of positive among responders), response_rate_pct (share of responders among sent), and delta — the change in satisfaction_pct versus the preceding period of equal length.
  • GET /csat/breakdowns — two breakdowns of responded surveys: by_participant (per operator or AI agent) and by_channel (per channel type).
  • GET /csat/trend — a per-day array over the period (days with no responses are zero-filled).
  • GET /csat/conversations — a paginated list of conversations with a negative rating only; it can be further filtered by channel_type_key and by the member_type (user|ai_agent)+member_id pair (both required together), and supports per_page (1–100, default 20) and page (default 1).

Response envelope

The conversations response is wrapped in { data: { items, pagination } }; the other three are wrapped in { data: ... }.

Endpoints

MethodPath
GET/v1/csat/metrics

CSAT summary metrics for a period (+delta vs previous period)

GET/v1/csat/breakdowns

Satisfaction breakdown by participant and channel

GET/v1/csat/trend

Day-by-day satisfaction trend

GET/v1/csat/conversations

List of negatively rated conversations (paginated)

Examples

Summary metrics for 30 days

Request

bash
curl "https://api.aisar.app/v1/csat/metrics?period=30d" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Response

json
{
  "data": {
    "sent": 210,
    "responded": 168,
    "positive": 149,
    "negative": 19,
    "satisfaction_pct": 89,
    "response_rate_pct": 80,
    "delta": 4
  }
}

Breakdown by participant and channel

Request

bash
curl "https://api.aisar.app/v1/csat/breakdowns?period=30d" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Response

json
{
  "data": {
    "by_participant": [
      {
        "member_type": "user",
        "member_id": 12,
        "name": "Aida Nurlanova",
        "is_ai": false,
        "responded": 92,
        "positive": 84,
        "negative": 8,
        "satisfaction_pct": 91
      },
      {
        "member_type": "ai_agent",
        "member_id": 4,
        "name": "Support Assistant",
        "is_ai": true,
        "responded": 76,
        "positive": 65,
        "negative": 11,
        "satisfaction_pct": 86
      }
    ],
    "by_channel": [
      { "channel_type_key": "whatsapp", "responded": 118, "positive": 106 },
      { "channel_type_key": "instagram", "responded": 50, "positive": 43 }
    ]
  }
}

Day-by-day trend (gaps zero-filled)

Request

bash
curl "https://api.aisar.app/v1/csat/trend?period=7d&timezone=Asia/Almaty" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Response

json
{
  "data": [
    { "date": "2026-03-09", "responded": 0, "positive": 0, "negative": 0, "satisfaction_pct": 0 },
    { "date": "2026-03-10", "responded": 22, "positive": 20, "negative": 2, "satisfaction_pct": 91 },
    { "date": "2026-03-11", "responded": 18, "positive": 15, "negative": 3, "satisfaction_pct": 83 }
  ]
}

Negatively rated conversations (channel filter)

Request

bash
curl "https://api.aisar.app/v1/csat/conversations?period=30d&channel_type_key=whatsapp&per_page=20" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Response

json
{
  "data": {
    "items": [
      {
        "id": 5012,
        "conversation_id": 8841,
        "responded_at": "2026-03-15T09:42:11+00:00",
        "channel_type_key": "whatsapp",
        "raw_response": "Долго ждал ответа",
        "contact": {
          "id": 3307,
          "name": "Ivan Petrov"
        },
        "participants": [
          { "name": "Aida Nurlanova", "is_ai": false }
        ]
      }
    ],
    "pagination": {
      "page": 1,
      "perPage": 20,
      "total": 1,
      "lastPage": 1
    }
  }
}

CSAT disabled for the company (404)

Request

bash
curl "https://api.aisar.app/v1/csat/metrics" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Response

json
{
  "message": ""
}