Retrieve the distribution of a collected field in text conversations

View as Markdown
Value counts for one data-collection field the agent extracts from text conversations (for example `tipo_visitante` or `pais`), over analysed threads created in the window that carry that field. Returns at most 50 values, most frequent first. The field id is the agent's own configuration, so any field becomes reportable without a deploy. For the top 10 values of every field at once, across voice and text, use `GET /api/analytics/analysis/data-collection`. Values are compared as text: boolean `false` and the string `"false"` are the same bucket, and surrounding double quotes are trimmed. **No data.** A thread where the field was extracted but came back empty is reported under the literal value `(sin dato)`. A field id that no conversation carries (misspelt or not configured) is not an error: it returns an empty `data` array. **Idempotency.** Read-only; safe to retry. **Consistency.** Computed live; `Cache-Control: private, max-age=30, stale-while-revalidate=900`. **Access** - **Required scope:** `read`. Signed-in users need the owner, admin, member or viewer role. - **Rate limit:** Analytics — 30 requests/min per workspace, shared with the rest of `/api/analytics/*` (except `/analysis/*`); also counts against the general API limit. See [Rate limits](/rate-limits). - **Plan:** Available on every plan (behind the `advancedDashboard` feature gate, which is enabled on every plan).

Authentication

AuthorizationBearer
Workspace API key: `jl_` followed by 64 lowercase hex characters, created by the workspace owner in the dashboard (**Settings → API Keys**) and sent as `Authorization: Bearer jl_...`. The plaintext is shown once, at creation; Jelliu stores only a SHA-256 hash. A workspace can hold up to 25 active keys. | Scope | GET / HEAD | POST / PUT / PATCH / DELETE | Admin-only routes | | --- | --- | --- | --- | | `read` | Yes | No | No | | `write` | Yes | Yes | No | | `full` | Yes | Yes | Yes | Operations restricted to admins or owners reject keys without the `full` scope with `403`, and say so in their description. No key, whatever its scope, can mint or revoke API keys or rotate a webhook secret — that requires a signed-in owner session. A revoked key stops authenticating within about 10 seconds. See [Authentication](/authentication).

Path parameters

fieldstringRequiredformat: "^[a-zA-Z][a-zA-Z0-9_]{0,63}$"1-64 characters

Data-collection field id as configured on the agent. Must start with a letter and contain only letters, digits and _, up to 64 characters (case-insensitive); anything else is a 400.

Query parameters

daysintegerOptional1-365Defaults to 30

Window in days ending now. Integer 1-365; anything else is rejected with 400.

Response

Field distribution, most frequent value first (max 50 rows).

datalist of objectsOptional

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
429
Too Many Requests Error