data-export

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.

get/organizations/{organizationId}/data-export/usage

Request

  • Base URL
    https://vetnio.com/api/v2
  • URL
    https://vetnio.com/api/v2/organizations/{organizationId}/data-export/usage
  • Auth
    HTTP bearer

Path parameters

organizationIdstring required

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.

Example:3f6c2a1e-8b4d-4c7a-9e2f-5d1b7a9c0e42

Query parameters

workspaceIdsstring

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.

Example:furunculotic-loud-chihuahua
columnsstring

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.

Example:workspaceName,consultationCount,recordingHours
startDatestring

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.

Example:2026-09-01
endDatestring

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.

Example:2026-09-30
daysinteger

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.

Example:30
timePeriod'daily' | 'weekly' | 'monthly' | 'yearly'

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.
Example:monthly
grain'clinic' | 'vet' | 'snapshot' | 'consultation'

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.
Example:clinic
pageinteger

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.

Example:1
pageSizeinteger

Rows per page for grain=consultation, 1-5000. Ignored for the other grains.

Example:1000

Response

One page of the usage table.

headersstring[] required

Column titles in display form (for example Clinic Name, Consultations), in the order of each row's cells. For grain=vet and grain=clinic the first column is Date.

startstring required

First day covered, YYYY-MM-DD (UTC).

endstring required

Last day covered, YYYY-MM-DD (UTC).

totalRowsnumber required

Number of rows across all pages. For grains other than consultation it equals the number of rows returned.

pagenumber required

The page returned. Always 1 unless grain=consultation.

totalPagesnumber required

Only the consultation grain spans several pages; the others always return 1.

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.