> ## Documentation Index
> Fetch the complete documentation index at: /developers/llms.txt
> Use this file to discover all available pages before exploring further.

# Query usage

> Read daily consultation, document, audio, and task activity.

Get a UTC daily activity report for your application or one clinician grant.
Requires `scribe:read`.

## Request a report

`POST /usage/query`

```bash theme={null}
curl --request POST "$CORTEXA_API_BASE/usage/query" \
  --header "Cortexa-Api-Key: $CORTEXA_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{"name":"user_daily_report","since":"2026-11-01","until":"2026-11-16","limit":100,"offset":0}'
```

| Field | Description |
| - | - |
| `name` | Report name; `user_daily_report` |
| `since`, `until` | Inclusive UTC dates; defaults to the last 30 dates including today. Maximum range: 366 dates. |
| `limit` | Rows per request; 1–2,000, default 100 |
| `offset` | Starting row; default 0 |

### Credentials

| Header | Report scope |
| - | - |
| `Cortexa-Api-Key` | Your application's grants, including historical usage for revoked grants |
| `Authorization: Bearer <Partner JWT>` | Only the JWT's active grant |

If both headers are sent, the JWT determines the scope and must be valid.

## Read the response

| Field | Description |
| - | - |
| `name` | `user_daily_report` |
| `timezone` | `UTC` |
| `data` | Daily rows identified by `report_date`, `grant_id`, `external_user_id`, and `workspace_id` |
| `has_more` | Whether another page is available |
| `next_offset` | Offset for the next request, or null |

Rows are ordered by date and grant ID. Days without activity are omitted.
Follow `next_offset` while `has_more` is true, keeping the same date range.

### Metrics

| Metric | Description |
| - | - |
| `sessions` | Consultations created that day |
| `consult_notes` | Currently ready consult-note records, grouped by creation date |
| `documents` | Other currently ready outputs, grouped by creation date |
| `transcription_minutes` | Stored duration of completed or stopped non-dictation recordings |
| `dictation_minutes` | Corresponding duration for dictation recordings |
| `structured_responses` | Structured form responses created that day |
| `tasks` | Tasks created that day |

Only grant-owned sessions contribute. Segmented audio counts the parent recording
once; text-only transcripts add no audio minutes.

## How counts change

This is an activity report, not a billing ledger. Regenerating an output does not
add a document. Later status changes can affect earlier ready-document counts.
Soft-deleted records remain countable; permanent deletion can remove them.
Clinician activity within grant-owned sessions contributes to their totals.

Invalid dates or ranges return `422`; expired or revoked JWTs return `401`.
Application [rate limits](/developers/errors.md#request-limits) also apply.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.