Skip to content
Context docs
Evals API

Analytics

Serverhttps://context.example.com/api/v1/evals

An analytics record is one piece of agent work in the organization: a root task, a sub-agent task or a dispatch run, with its cost, outcome and feedback. These are the reads behind the app's Tasks list, with its filters, overview charts and export. An organization admin, or a person with analytics access, reads every record; a workspace admin reads the records in the workspaces they administer, and another member with Evals access reads the ones they created or their own agents ran.


List analytics records

GET
https://context.example.com/api/v1/evals
/analytics/records
Bearer (tsk_<prefix>_<secret>)
or
X-API-Key (header)

Paginated analytics records (root tasks, sub-agent tasks, and dispatch runs), with filters.

List analytics records › query Parameters

agentIds
​string[] · style: form · explode: true

Send a JSON list in one value (agentIds=["a","b"]) or repeat the key (agentIds=a&agentIds=b). A single plain value (agentIds=a) is refused with 400.

workspaceIds
​string[] · style: form · explode: true

Send a JSON list in one value (workspaceIds=["a","b"]) or repeat the key (workspaceIds=a&workspaceIds=b). A single plain value (workspaceIds=a) is refused with 400.

workspaceTagIds
​string[] · style: form · explode: true

Send a JSON list in one value (workspaceTagIds=["a","b"]) or repeat the key (workspaceTagIds=a&workspaceTagIds=b). A single plain value (workspaceTagIds=a) is refused with 400.

sourceType
​string · enum

Started from: keep only records that started on this source (a task source type, or subagent for tasks started by another task).

Enum values:
manual
scheduled
api
internal-api
prewarmed
local-device
agent-brain
subagent
usedFrom
​string[] · minItems: 1 · style: form · explode: true

Used from: keep only tasks a person acted on through ANY of these interfaces (a turn sent from the app, a run driven by a paired machine, or where the task started). Send a JSON list in one value (usedFrom=["a","b"]) or repeat the key (usedFrom=a&usedFrom=b). A single plain value (usedFrom=a) is refused with 400.

Enum values:
web
mobile
cli
api
excel
word
powerpoint
viewedFrom
​string[] · minItems: 1 · style: form · explode: true

Viewed from: keep only records a person opened the conversation of on ANY of these surfaces, as the record's own view summary reports them (task_view.source). A record with no recorded view on any chosen surface is dropped, including one whose views were never measured. Send a JSON list in one value (viewedFrom=["a","b"]) or repeat the key (viewedFrom=a&viewedFrom=b). A single plain value (viewedFrom=a) is refused with 400.

Enum values:
task_route
shared_link
eval_analytics
context_code
eval_project
userIds
​string[] · style: form · explode: true

Send a JSON list in one value (userIds=["a","b"]) or repeat the key (userIds=a&userIds=b). A single plain value (userIds=a) is refused with 400.

email
​string · minLength: 1 · maxLength: 200

Case-insensitive substring matched against the owning user's email, to narrow results to one person.

countries
​string[] · style: form · explode: true

Send a JSON list in one value (countries=["a","b"]) or repeat the key (countries=a&countries=b). A single plain value (countries=a) is refused with 400.

taskOpencodeBranchId
​string · minLength: 1
skillIds
​string[] · style: form · explode: true

Send a JSON list in one value (skillIds=["a","b"]) or repeat the key (skillIds=a&skillIds=b). A single plain value (skillIds=a) is refused with 400.

workflowIds
​string[] · minItems: 1 · maxItems: 50 · style: form · explode: true

Workflow ids. A record matches when its chat is classified into any of them. Send a JSON list in one value (workflowIds=["a","b"]) or repeat the key (workflowIds=a&workflowIds=b). A single plain value (workflowIds=a) is refused with 400.

errorMessage
​string · minLength: 1 · maxLength: 200

Case-insensitive substring matched against the error messages of calls in the record's own chat (the same filter the app's Traces view offers). A record with no chat never matches.

from
​string · date-time
to
​string · date-time
minRating
​number · min: 1 · max: 5
maxRating
​number · min: 1 · max: 5
hasFeedback
​boolean
search
​string · minLength: 1 · maxLength: 200

Case-insensitive substring matched against the task title (a dispatch run matches on its task's title, otherwise its prompt). A task with no title of its own matches on its latest dispatch run's title or prompt, the same fallback the list shows.

statuses
​string[] · minItems: 1 · style: form · explode: true

Keep only records whose current status (as shown in the status breakdown) is ANY of these. Send a JSON list in one value (statuses=["a","b"]) or repeat the key (statuses=a&statuses=b). A single plain value (statuses=a) is refused with 400.

Enum values:
completed
failed
running
pending
cancelled
archived
origins
​string[] · minItems: 1 · style: form · explode: true

Keep only records started by ANY of these kinds of work: production, evaluation-run, judge, or skill-learning-replay. The origin comes from the record's root task: whether an evaluation started it, then whether it runs as the organization's judge agent. Omit to keep every origin. Send a JSON list in one value (origins=["a","b"]) or repeat the key (origins=a&origins=b). A single plain value (origins=a) is refused with 400.

Enum values:
evaluation-run
judge
skill-learning-replay
production
cursor
​string · minLength: 1

Cursor from the previous page's pageInfo.nextCursor; stop when pageInfo.hasNextPage is false.

limit
​integer · min: 1 · max: 100

Maximum number of top-level records to return. Sub-agent rows shown under those records can make data.length larger.

Default: 25

List analytics records › Responses

Successful response

​object[] · required
​object · required

Cursor pagination state


Get the analytics overview

GET
https://context.example.com/api/v1/evals
/analytics/overview
Bearer (tsk_<prefix>_<secret>)
or
X-API-Key (header)

Summary cards plus chart series for the records matching the filters.

Get the analytics overview › query Parameters

agentIds
​string[] · style: form · explode: true

Send a JSON list in one value (agentIds=["a","b"]) or repeat the key (agentIds=a&agentIds=b). A single plain value (agentIds=a) is refused with 400.

workspaceIds
​string[] · style: form · explode: true

Send a JSON list in one value (workspaceIds=["a","b"]) or repeat the key (workspaceIds=a&workspaceIds=b). A single plain value (workspaceIds=a) is refused with 400.

workspaceTagIds
​string[] · style: form · explode: true

Send a JSON list in one value (workspaceTagIds=["a","b"]) or repeat the key (workspaceTagIds=a&workspaceTagIds=b). A single plain value (workspaceTagIds=a) is refused with 400.

sourceType
​string · enum

Started from: keep only records that started on this source (a task source type, or subagent for tasks started by another task).

Enum values:
manual
scheduled
api
internal-api
prewarmed
local-device
agent-brain
subagent
usedFrom
​string[] · minItems: 1 · style: form · explode: true

Used from: keep only tasks a person acted on through ANY of these interfaces (a turn sent from the app, a run driven by a paired machine, or where the task started). Send a JSON list in one value (usedFrom=["a","b"]) or repeat the key (usedFrom=a&usedFrom=b). A single plain value (usedFrom=a) is refused with 400.

Enum values:
web
mobile
cli
api
excel
word
powerpoint
viewedFrom
​string[] · minItems: 1 · style: form · explode: true

Viewed from: keep only records a person opened the conversation of on ANY of these surfaces, as the record's own view summary reports them (task_view.source). A record with no recorded view on any chosen surface is dropped, including one whose views were never measured. Send a JSON list in one value (viewedFrom=["a","b"]) or repeat the key (viewedFrom=a&viewedFrom=b). A single plain value (viewedFrom=a) is refused with 400.

Enum values:
task_route
shared_link
eval_analytics
context_code
eval_project
userIds
​string[] · style: form · explode: true

Send a JSON list in one value (userIds=["a","b"]) or repeat the key (userIds=a&userIds=b). A single plain value (userIds=a) is refused with 400.

email
​string · minLength: 1 · maxLength: 200

Case-insensitive substring matched against the owning user's email, to narrow results to one person.

countries
​string[] · style: form · explode: true

Send a JSON list in one value (countries=["a","b"]) or repeat the key (countries=a&countries=b). A single plain value (countries=a) is refused with 400.

taskOpencodeBranchId
​string · minLength: 1
skillIds
​string[] · style: form · explode: true

Send a JSON list in one value (skillIds=["a","b"]) or repeat the key (skillIds=a&skillIds=b). A single plain value (skillIds=a) is refused with 400.

workflowIds
​string[] · minItems: 1 · maxItems: 50 · style: form · explode: true

Workflow ids. A record matches when its chat is classified into any of them. Send a JSON list in one value (workflowIds=["a","b"]) or repeat the key (workflowIds=a&workflowIds=b). A single plain value (workflowIds=a) is refused with 400.

errorMessage
​string · minLength: 1 · maxLength: 200

Case-insensitive substring matched against the error messages of calls in the record's own chat (the same filter the app's Traces view offers). A record with no chat never matches.

from
​string · date-time
to
​string · date-time
minRating
​number · min: 1 · max: 5
maxRating
​number · min: 1 · max: 5
hasFeedback
​boolean
search
​string · minLength: 1 · maxLength: 200

Case-insensitive substring matched against the task title (a dispatch run matches on its task's title, otherwise its prompt). A task with no title of its own matches on its latest dispatch run's title or prompt, the same fallback the list shows.

statuses
​string[] · minItems: 1 · style: form · explode: true

Keep only records whose current status (as shown in the status breakdown) is ANY of these. Send a JSON list in one value (statuses=["a","b"]) or repeat the key (statuses=a&statuses=b). A single plain value (statuses=a) is refused with 400.

Enum values:
completed
failed
running
pending
cancelled
archived
origins
​string[] · minItems: 1 · style: form · explode: true

Keep only records started by ANY of these kinds of work: production, evaluation-run, judge, or skill-learning-replay. The origin comes from the record's root task: whether an evaluation started it, then whether it runs as the organization's judge agent. Omit to keep every origin. Send a JSON list in one value (origins=["a","b"]) or repeat the key (origins=a&origins=b). A single plain value (origins=a) is refused with 400.

Enum values:
evaluation-run
judge
skill-learning-replay
production

Get the analytics overview › Responses

Successful response

Overview cards plus chart series for the full set of records matching the filters
​object · required
​object · required

All overview chart series for the full set of records matching the filters


List analytics filter values

GET
https://context.example.com/api/v1/evals
/analytics/options
Bearer (tsk_<prefix>_<secret>)
or
X-API-Key (header)

Values for the analytics filters.

List analytics filter values › Responses

Successful response

​object[] · required
​object[] · required

Started from: the sources present in the organization's records, with labels

​object[] · required

Used from: every interface a task can be used from, with labels, in the same order as the export's usedFrom. This list is fixed: it includes every interface whether or not the organization has records from it.

​object[] · required
​object[] · required
​object[] · required

First page of the organization's workspaces, ordered by name and capped (see workspacesTruncated). To find others, search for workspaces in the app.

workspacesTruncated
​boolean · required

True when the organization has more workspaces than this list holds, so the list is incomplete.

​object[] · required
​object[] · required

Export analytics records

GET
https://context.example.com/api/v1/evals
/analytics/records/export
Bearer (tsk_<prefix>_<secret>)
or
X-API-Key (header)

Streams every analytics record matching the filters as line-delimited JSON (application/x-ndjson). When includeFeedback=true (default), each row has a feedback array with one entry per scorecard, holding aggregated criterion responses and free-text comments. Numeric criteria become their average, boolean criteria combine to Yes/No, and multi-valued text criteria are comma-joined. Comments are newline-joined per scorecard in submission order. The app's CSV download uses the same data, with one column per scorecard and criterion pair plus 'Feedback Comments: ' columns. Use limit to fetch a sample; omit it to stream the full filtered set.

Export analytics records › query Parameters

agentIds
​string[] · style: form · explode: true

Send a JSON list in one value (agentIds=["a","b"]) or repeat the key (agentIds=a&agentIds=b). A single plain value (agentIds=a) is refused with 400.

workspaceIds
​string[] · style: form · explode: true

Send a JSON list in one value (workspaceIds=["a","b"]) or repeat the key (workspaceIds=a&workspaceIds=b). A single plain value (workspaceIds=a) is refused with 400.

workspaceTagIds
​string[] · style: form · explode: true

Send a JSON list in one value (workspaceTagIds=["a","b"]) or repeat the key (workspaceTagIds=a&workspaceTagIds=b). A single plain value (workspaceTagIds=a) is refused with 400.

sourceType
​string · enum

Started from: keep only records that started on this source (a task source type, or subagent for tasks started by another task).

Enum values:
manual
scheduled
api
internal-api
prewarmed
local-device
agent-brain
subagent
usedFrom
​string[] · minItems: 1 · style: form · explode: true

Used from: keep only tasks a person acted on through ANY of these interfaces (a turn sent from the app, a run driven by a paired machine, or where the task started). Send a JSON list in one value (usedFrom=["a","b"]) or repeat the key (usedFrom=a&usedFrom=b). A single plain value (usedFrom=a) is refused with 400.

Enum values:
web
mobile
cli
api
excel
word
powerpoint
viewedFrom
​string[] · minItems: 1 · style: form · explode: true

Viewed from: keep only records a person opened the conversation of on ANY of these surfaces, as the record's own view summary reports them (task_view.source). A record with no recorded view on any chosen surface is dropped, including one whose views were never measured. Send a JSON list in one value (viewedFrom=["a","b"]) or repeat the key (viewedFrom=a&viewedFrom=b). A single plain value (viewedFrom=a) is refused with 400.

Enum values:
task_route
shared_link
eval_analytics
context_code
eval_project
userIds
​string[] · style: form · explode: true

Send a JSON list in one value (userIds=["a","b"]) or repeat the key (userIds=a&userIds=b). A single plain value (userIds=a) is refused with 400.

email
​string · minLength: 1 · maxLength: 200

Case-insensitive substring matched against the owning user's email, to narrow results to one person.

countries
​string[] · style: form · explode: true

Send a JSON list in one value (countries=["a","b"]) or repeat the key (countries=a&countries=b). A single plain value (countries=a) is refused with 400.

taskOpencodeBranchId
​string · minLength: 1
skillIds
​string[] · style: form · explode: true

Send a JSON list in one value (skillIds=["a","b"]) or repeat the key (skillIds=a&skillIds=b). A single plain value (skillIds=a) is refused with 400.

workflowIds
​string[] · minItems: 1 · maxItems: 50 · style: form · explode: true

Workflow ids. A record matches when its chat is classified into any of them. Send a JSON list in one value (workflowIds=["a","b"]) or repeat the key (workflowIds=a&workflowIds=b). A single plain value (workflowIds=a) is refused with 400.

errorMessage
​string · minLength: 1 · maxLength: 200

Case-insensitive substring matched against the error messages of calls in the record's own chat (the same filter the app's Traces view offers). A record with no chat never matches.

from
​string · date-time
to
​string · date-time
minRating
​number · min: 1 · max: 5
maxRating
​number · min: 1 · max: 5
hasFeedback
​boolean
search
​string · minLength: 1 · maxLength: 200

Case-insensitive substring matched against the task title (a dispatch run matches on its task's title, otherwise its prompt). A task with no title of its own matches on its latest dispatch run's title or prompt, the same fallback the list shows.

statuses
​string[] · minItems: 1 · style: form · explode: true

Keep only records whose current status (as shown in the status breakdown) is ANY of these. Send a JSON list in one value (statuses=["a","b"]) or repeat the key (statuses=a&statuses=b). A single plain value (statuses=a) is refused with 400.

Enum values:
completed
failed
running
pending
cancelled
archived
origins
​string[] · minItems: 1 · style: form · explode: true

Keep only records started by ANY of these kinds of work: production, evaluation-run, judge, or skill-learning-replay. The origin comes from the record's root task: whether an evaluation started it, then whether it runs as the organization's judge agent. Omit to keep every origin. Send a JSON list in one value (origins=["a","b"]) or repeat the key (origins=a&origins=b). A single plain value (origins=a) is refused with 400.

Enum values:
evaluation-run
judge
skill-learning-replay
production
includeFeedback
​boolean

When true (default), each row includes aggregated feedback per scorecard in the feedback array. When false, the feedback array is always empty and the export skips feedback work.

Default: true
limit
​integer · min: 1 · max: 100

Optional row limit, useful for fetching a small sample. When omitted, every matching record is streamed.

columns
​string[] · style: form · explode: true

Optional list of CSV column headers to include. Applies only to the app's CSV download; the JSONL stream always includes every key. When omitted, all columns are included. Send a JSON list in one value (columns=["a","b"]) or repeat the key (columns=a&columns=b). A single plain value (columns=a) is refused with 400.

Export analytics records › Responses

Line-delimited JSON: one AnalyticsExportJsonRow per line, each ending in a newline, then one final line {"recordType":"end","rowCount":<n>}. A body without that final line was cut off after its last complete row. Rows arrive page by page in the Tasks list's order (newest first, sub-agents under their parent), so you can read them as they arrive.

One JSONL row from the export. Converts cleanly to CSV with flat 'Feedback: <scorecard name> - <criterionName>' and 'Feedback Comments: <scorecard name>' columns.
recordId
​string · minLength: 1 · required

Stable analytics record identifier; always present, so exported rows can be matched back to their records

recordType
​string · enum · required

Kind of record: rootTask, subAgent, or dispatchRun

Enum values:
rootTask
subAgent
dispatchRun
taskId
​string | null · required

Task ID when the record is a task; null for standalone dispatch runs

parentTaskId
​string | null · required

Parent task ID when this row is a sub-agent task; null for root tasks and standalone dispatch runs

runId
​string | null · required

Run ID when the record is a dispatch run; null for tasks

taskOpencodeBranchId
​string | null · required

Chat ID when available; the preferred identifier for building project URLs

sourceType
​string · enum · required

Started from: the one source the record started on. The CSV shows it as a label (manual → Web, local-device → CLI, internal-api → Automation).

Enum values:
manual
scheduled
api
internal-api
prewarmed
local-device
agent-brain
subagent
usedFrom
​string[] · required

Used from: every interface a person acted on this record through, in a fixed order (web, mobile, cli, api, excel, word, powerpoint), based on the record's turns, its runs on paired machines, and where it started. Empty for records no interface touched (scheduled, started ahead of use, or a sub-agent with no turns of its own). api means started through the Task API with your own key. excel, word and powerpoint mean a prompt was sent from the Context add-in's pane in that Office application (recorded from November 2026; earlier Office use reads as web). The platform's own automation (the scheduler, applets, judges, replays) shows as Started from: Automation, with no interface. Known limits: a task started with POST /api/v1/tasks/prompt using a service-account key reads as automation, and a task later continued through the API is not detected. Replaces the removed interfacesUsed map.

Enum values:
web
mobile
cli
api
excel
word
powerpoint
taskApiKeyName
​string | null · required

Name of the task API key that started this task, taken from the task's first dispatch (later continuations are ignored). Null for tasks and runs not started with a key (for example a task started in the web app, or an automated flow that uses no key, such as an agent judge). When the scheduler started the task, this is internal-scheduler.

taskApiKeyPrincipalType
​string | null · enum · required

Type of account behind the originating key (same dispatch as taskApiKeyName): user for a person's own key, agentServiceAccount for a service key the platform created. Null when the record was not started with a key.

Enum values:
user
agentServiceAccount
applet
service
taskApiKeyNamespace
​string | null · required

Namespace of the originating key (same dispatch as taskApiKeyName). A reserved namespace means an automated flow, not a person's key, dispatched the record. Null when the record was not started with a key.

invokedBy
​string · minLength: 1 · required

Who invoked the record: the dispatching key's name for records started by a service key or by platform automation (or the record's agent for automated flows that use no key, such as an agent judge); otherwise the owning user's display name.

title
​string · minLength: 1 · required

Readable title of the task or run

createdAt
​string · required

Creation time in ISO 8601; the CSV formats it for display

taskStatus
​string | null · enum · required
Enum values:
active
completed
failed
archived
latestRunStatus
​string | null · enum · required
Enum values:
queued
running
succeeded
failed
cancelled
displayStatus
​string · minLength: 1 · required

Status label combining the task status and its latest run's status

​object · required
​object · required
workspace
​object | null · required
workspaceTag
​object | null · required
messageCount
​integer | null · min: 0 · required

Number of archived messages; null until it is computed

userMessageCount
​integer | null · min: 0 · required

Number of archived user-written messages; null until it is computed. The CSV shows null as an empty cell, not 0.

​object[] · required

Skills the record used. The CSV shows a comma-separated list of labels.

​object[] · required

Skills this record's task created. Always empty for dispatch-run records (they have no task). The CSV shows a comma-separated list of labels.

​object · required
tokenUsage
​object | null · required

Billed tokens split by type; the parts add up to metrics.totalTokens. Null (not 0) when no usage was reported.

​object · required

View summary. Tasks match views by task ID; standalone dispatch runs match by chat. viewCount is null (with unmeasuredReason set) when the record could not be measured: a run with no chat, or a record created before views were recorded. The CSV shows that as an empty cell, not 0.

​object · required

Feedback counts and ratings across all feedback on this record. Always present.

projectUrl
​string | null · uri · required

Absolute URL of the project or chat in the app; null when the record has no chat to link to or the deployment has no app address configured

isEditorShared
​boolean | null · required

Whether the project has an active editor-mode share. Null when the record has no shareable root task or the share state could not be read.

​object[] · required

Aggregated feedback for this record, one entry per scorecard. Empty when the record has no feedback or the request set includeFeedback=false.


Get an analytics record

GET
https://context.example.com/api/v1/evals
/analytics/records/{recordId}
Bearer (tsk_<prefix>_<secret>)
or
X-API-Key (header)

One analytics record plus its latest run and feedback entries.

Get an analytics record › path Parameters

recordId
​string · minLength: 1 · required

Stable analytics record identifier

Stable analytics record identifier

Get an analytics record › Responses

Successful response

record
​object | null · required

The record; null (with a 200) when the ID is unknown or outside what the key can read.

latestRun
​object | null · required
​object[] · required