Export usage statistics
Returns the same table as Organization → Export in the app, as JSON: headers plus one array of cells per row. Choose the period (days, or startDate/endDate), the row level (grain), the time bucket (timePeriod), clinics (workspaceIds) and columns. Only grain=consultation is paginated. A workspace key only ever gets its own clinic's rows. Read-only; every call is recorded in the audit log. Requests that include note-quality columns run an extra analytics query and are limited per key per day. Requires organization admin rights, like the overview endpoint.
Request
- Base URLhttps://vetnio.com/api/v2
- URLhttps://vetnio.com/api/v2/organizations/{organizationId}/data-export/usage
- AuthHTTP bearer
Path parameters
Identifier of the organization (a UUID). With an organization or workspace key, use the organizationId returned by GET /api-key; any other organization returns 403.
Query parameters
Comma-separated workspace (clinic) IDs to include, for example furunculotic-loud-chihuahua,brave-quick-heron. Every ID must belong to the organization (or, for a workspace key, be the key's own clinic), otherwise the request fails with 400. Default: every clinic attached to the organization, including locked clinics.
Comma-separated column keys, for example workspaceName,consultationCount,recordingHours. Columns are always returned in the export's fixed order, not the order listed. Columns that do not apply to the chosen grain are dropped silently: vet columns need grain=vet or consultation, consultation columns need grain=consultation, and at grain=consultation the aggregate columns are not available. An unknown key fails with 400 and the message lists every valid key. Default: every column except the note-quality ones (avgReadingSeconds, avgEditingSeconds, acceptanceRate, draftOutcome), which are only included when listed and are limited to 20 requests per key per day. The Export dialog's “Use via API” button builds this value for you.
First day of a fixed date range, YYYY-MM-DD (UTC). When set, days is ignored. The range may span at most 366 days; longer ranges fail with 400.
Last day of the fixed date range, inclusive, YYYY-MM-DD (UTC). Only used together with startDate; without startDate it is ignored. Default: up to the current moment.
Length of a rolling window ending now, in days (1-366, default 30). Today counts as the first day, so days=7 covers today and the 6 days before it, starting at midnight UTC. Ignored when startDate is set.
Size of the time bucket each row covers when grain is vet or clinic; ignored for snapshot and consultation. Buckets are UTC. The first column (Date) holds the bucket's first day as YYYY-MM-DD, clamped to the start of the range:
- daily — one bucket per calendar day.
- weekly — one bucket per week, starting Monday.
- monthly — one bucket per calendar month.
- yearly — one bucket per calendar year.
What one row represents:
- vet — one vet in one clinic for one time bucket; only vets with activity get rows, and a vet working in two clinics gets a row for each.
- clinic — one clinic for one time bucket; every clinic in scope gets a row (zero-filled) for each bucket with any activity.
- snapshot — one row per clinic for the whole period, without a Date column.
- consultation — one row per consultation, oldest first, including deleted ones (flagged in the Deleted column). The only paginated grain.
Page number, starting at 1. Only grain=consultation spans several pages; other grains always return everything on page 1. Pages that start beyond row 50,000 are rejected with 400: split the date range instead.
Rows per page for grain=consultation, 1-5000. Ignored for the other grains.
Response
One page of the usage table.
Example response
{
"headers": [
"Date",
"Clinic ID",
"Clinic Name",
"Consultations"
],
"rows": [
[
"2026-09-01",
"furunculotic-loud-chihuahua",
"Riverside Animal Clinic",
412
]
],
"start": "2026-09-01",
"end": "2026-09-30",
"totalRows": 24,
"page": 1,
"totalPages": 1
}Changes
No recorded changes to this operation across all 1 revision of this API.