Skip to main content

Workspace metrics

Ask for several numbers about the workspace in one request: how many documents arrived or failed in the last 12 hours, how many lack a value, verdicts by state, median cost per document. Only numbers come back, never document content, and only documents the connected person may see are counted.

Listed when the workspace offers metrics to the connection. One metrics request per workspace runs at a time; a second one answers 429 and should be retried after a few seconds.

talonic_aggregate_catalog

What can be counted: every dataset with its fields, which fields can be grouped and filtered with which operators, the measures, the limits (window length, queries per request) and whether this workspace may see cost fields. Free; call it before the first metrics request.

talonic_aggregate

Computes several named numbers (20 by default) over a half-open window [from, to) of at most 31 days by default; the catalog states the limits that apply. Each query picks a dataset and a measure (count, count_distinct, sum, avg, min, max, median, p1-p99), optional filters and up to three group-by fields or hour / day. A count over nothing is 0; an average or percentile over nothing is null. Cost fields are in US dollars.

ParameterTypeDescription
from *stringWindow start, inclusive, ISO-8601 with an offset (`2026-11-05T12:00:00Z`).
to *stringWindow end, exclusive, with an offset.
scopeobjectDocument selectors for every query: `document_ids`, `tags`, `system_tags`, `source_connection_ids`, `document_types`, `client_batch_ids`, `roots_only`, `attachments_only`.
queries *object[]Each `{ id, dataset, measure, of?, where?, group_by? }`; `id` is lowercase letters, digits and underscores and keys the result.
Documents received and failed today
{
  "from": "2026-11-25T00:00:00Z",
  "to": "2026-11-26T00:00:00Z",
  "queries": [
    { "id": "received", "dataset": "documents", "measure": "count" },
    { "id": "failed", "dataset": "documents", "measure": "count", "where": [{ "field": "failed", "op": "eq", "value": true }] }
  ]
}

Errors: 400 invalid_aggregate names the allowed datasets, fields or measures; 403 cost_not_visible when the workspace may not see costs; 422 aggregate_timeout names the dataset to narrow.