API reference

Stats

Stats are the Dashboard's numbers. Count the messages people send or Okaymate's replies, in the team's groups, in the customer chat or both, by hour, day or month, or see who wrote the most.

Endpoints

The stats object

The numbers of messages or replies over a range, one entry per period, as the Dashboard's chart shows them.

Attributes

  • objectstring
    Always stats.
  • metricstring
    The metric you asked for.
    messagesrepliespeople
  • sidestring
    The chats counted.
    teamsupportboth
  • startstring
    The range's start, ISO 8601.
  • endstring
    The range's end, ISO 8601.
  • timezonestring
    The time zone the periods are counted in.
  • scalestring
    The length of a period.
    hourdaymonth
  • dataarray of objects
    One entry per period that has messages, oldest first. Periods without any are left out.
Stats object
{
  "object": "stats",
  "metric": "messages",
  "side": "support",
  "start": "2026-11-18T00:00:00.000Z",
  "end": "2026-11-24T23:59:59.000Z",
  "timezone": "Europe/Paris",
  "scale": "day",
  "data": [
    {
      "date": "2026-11-18",
      "value": 14
    },
    {
      "date": "2026-11-19",
      "value": 22
    },
    {
      "date": "2026-11-21",
      "value": 9
    },
    {
      "date": "2026-11-24",
      "value": 31
    }
  ]
}

Retrieve stats

GET/v1/statsRead access

Returns one metric over a range. By hour, a range covers 93 days at most, by day 3700 days.

Query parameters

  • metricstringRequired
    messages for the messages people send, replies for Okaymate's answers, people for who wrote the most.
    messagesrepliespeople
  • sidestring
    team for the team's groups, support for the customer chat, both for the two. Defaults to both.
    teamsupportboth
  • startstring
    The range's start, ISO 8601. Defaults to 30 days before end.
  • endstring
    The range's end, ISO 8601. Defaults to now.
  • timezonestring
    An IANA time zone like Europe/Paris, to count days and hours in. Defaults to UTC.
  • scalestring
    The length of a period. Defaults to day.
    hourdaymonth

Returns

A stats object, or a people stats object for people.

Errors

GET/v1/stats
curl -G https://okaymate.ai/api/v1/stats \
  -H "Authorization: Bearer $OKAYMATE_API_KEY" \
  -d metric=messages \
  -d side=support \
  -d start=2026-11-18 \
  --data-urlencode "timezone=Europe/Paris"
Response200
{
  "object": "stats",
  "metric": "messages",
  "side": "support",
  "start": "2026-11-18T00:00:00.000Z",
  "end": "2026-11-24T23:59:59.000Z",
  "timezone": "Europe/Paris",
  "scale": "day",
  "data": [
    {
      "date": "2026-11-18",
      "value": 14
    },
    {
      "date": "2026-11-19",
      "value": 22
    },
    {
      "date": "2026-11-21",
      "value": 9
    },
    {
      "date": "2026-11-24",
      "value": 31
    }
  ]
}

The people stats object

Who wrote the most over a range, with metric set to people.

Attributes

  • objectstring
    Always stats.
  • metricstring
    The metric you asked for.
    messagesrepliespeople
  • sidestring
    The chats counted.
    teamsupportboth
  • startstring
    The range's start, ISO 8601.
  • endstring
    The range's end, ISO 8601.
  • timezonestring
    The time zone the periods are counted in.
  • scalestring
    The length of a period.
    hourdaymonth
  • dataarray of objects
    The people who wrote the most messages, the most first, 10 at most.
People stats object
{
  "object": "stats",
  "metric": "people",
  "side": "both",
  "start": "2026-10-25T09:00:00.000Z",
  "end": "2026-11-24T09:00:00.000Z",
  "timezone": "UTC",
  "scale": "day",
  "data": [
    {
      "id": "184093327",
      "name": "Sara",
      "detail": "Lumen team",
      "channel": "telegram",
      "value": 86
    },
    {
      "id": "k3v9q2m7x4w8n1p6",
      "name": "Emma",
      "detail": "",
      "channel": "website",
      "value": 12
    }
  ]
}