Get agent analytics

GET/v2/agents/{agentId}/analytics

Read the resolution rate, satisfaction, sentiment, channel split, topics and unanswered questions of an agent for a time range.

Working draft. These docs are illustrative: names, endpoints and examples describe the intended behaviour and can change before launch.

Returns the figures shown on the Analytics tab of an agent for a time range. Call it to feed a dashboard of your own, to build a weekly report, or to find the questions the agent could not answer.

Request

GET /v2/agents/{agentId}/analytics

Path parameters:

Name Type Required Description
agentId string Yes The ID of the agent, starting with agt_.

Query parameters:

Name Type Required Description
from string No Start of the range as an ISO 8601 UTC time. Defaults to 30 days before to.
to string No End of the range as an ISO 8601 UTC time. Defaults to now.

Conversations are counted by the time they were created. For the meaning of the figures in the dashboard, read Analytics.

Example request

curl "https://api.askocto.co/v2/agents/agt_8f3k2m/analytics?from=2026-03-01T00:00:00Z&to=2026-03-14T23:59:59Z" \
  -H "Authorization: Bearer $OCTO_API_KEY"
const url = new URL("https://api.askocto.co/v2/agents/agt_8f3k2m/analytics")
url.searchParams.set("from", "2026-03-01T00:00:00Z")
url.searchParams.set("to", "2026-03-14T23:59:59Z")

const response = await fetch(url, {
  headers: { Authorization: `Bearer ${process.env.OCTO_API_KEY}` },
})

const analytics = await response.json()
console.log(`Resolution rate: ${analytics.resolutionRate}`)

Example response

A successful call returns 200 OK. The numbers are sample values.

{
  "agentId": "agt_8f3k2m",
  "from": "2026-03-01T00:00:00Z",
  "to": "2026-03-14T23:59:59Z",
  "conversations": { "total": 412, "resolved": 331, "handoff": 58, "open": 23 },
  "resolutionRate": 0.8,
  "satisfaction": { "responses": 96, "average": 4.4 },
  "sentiment": { "positive": 210, "neutral": 150, "negative": 52 },
  "channels": [
    { "channel": "widget", "conversations": 280 },
    { "channel": "email", "conversations": 70 },
    { "channel": "whatsapp", "conversations": 62 }
  ],
  "topics": [
    { "name": "Shipping", "conversations": 131 },
    { "name": "Returns", "conversations": 94 }
  ],
  "unansweredQuestions": [
    { "question": "Do you ship to Norway?", "count": 7 }
  ]
}

Response fields

Name Type Description
conversations object Counts of total, resolved, handoff and open conversations in the range.
resolutionRate number Resolved conversations divided by all conversations, from 0 to 1.
satisfaction object The number of survey responses and their average score.
sentiment object Conversations counted as positive, neutral or negative.
channels array The conversations per channel.
topics array The most common topics with their conversation counts.
unansweredQuestions array Questions the agent could not answer, with how often they came up.

Turn unanswered questions into new knowledge with Create source, for example as a Q&A source.

Errors

Status Code When
400 invalid_request from or to is not a valid ISO 8601 time, or to is earlier than from.
401 unauthorized The API key is missing, malformed or deleted.
404 not_found No agent has this ID in your workspace.
429 rate_limited Too many requests. Wait for the number of seconds in the Retry-After header.

Something unclear or missing? Tell us and we will fix the page.