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
- objectstringAlways
stats. - metricstringThe metric you asked for.
messagesrepliespeople - sidestringThe chats counted.
teamsupportboth - startstringThe range's start, ISO 8601.
- endstringThe range's end, ISO 8601.
- timezonestringThe time zone the periods are counted in.
- scalestringThe length of a period.
hourdaymonth - dataarray of objectsOne 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
messagesfor the messages people send,repliesfor Okaymate's answers,peoplefor who wrote the most.messagesrepliespeople - sidestring
teamfor the team's groups,supportfor the customer chat,bothfor the two. Defaults toboth.teamsupportboth - startstringThe range's start, ISO 8601. Defaults to 30 days before
end. - endstringThe range's end, ISO 8601. Defaults to now.
- timezonestringAn IANA time zone like
Europe/Paris, to count days and hours in. Defaults toUTC. - scalestringThe length of a period. Defaults to
day.hourdaymonth
Returns
A stats object, or a people stats object for people.
Errors
- A required parameter is missing.
paramnames it. - A parameter has a value the API does not accept.
paramnames it. - The business's Okaymate server is not set up yet.
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
- objectstringAlways
stats. - metricstringThe metric you asked for.
messagesrepliespeople - sidestringThe chats counted.
teamsupportboth - startstringThe range's start, ISO 8601.
- endstringThe range's end, ISO 8601.
- timezonestringThe time zone the periods are counted in.
- scalestringThe length of a period.
hourdaymonth - dataarray of objectsThe 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
}
]
}