List department usage. GET /api/openapi/v1/analytics/usage/departments, scope admin.v1.analytics-usage.read.
- Scope: admin.v1.analytics-usage.read
- Permission: Read organization-wide usage (analytics-usage)
- Permission type: Read
- Endpoint: GET/api/openapi/v1/analytics/usage/departments
Authentication and request headers
Call with an application API key. This endpoint checks only the scope above; read, manage and execute permissions do not imply one another.
| Name | Location | Type | Required | Description | Example |
|---|---|---|---|---|---|
| Authorization | header | string | Yes | Application API key, passed as a Bearer token. | Bearer qwk_*** |
| X-Request-Id | header | string | No | Optional request tracing identifier; generated by the server if omitted. | req-20260831-001 |
Request parameters
| Name | Location | Type | Required | Description | Example |
|---|---|---|---|---|---|
| ds | query | string · date | Required | Data date | "<string>" |
| period | query | string | Required | Reporting period | "cycle" |
| department_id | query | array | null | Required | Repeated department UUIDs, unique and nonzero; includes descendants. | ["<string>"] |
Request example
cURL
Responses
200 OK
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
| items | array | null | Yes | Records | [{"department_id":"<uuid>","member_count":0,"used_credits":0}] |
| last_data_update_time | string | Yes | Source update time in YYYY-MM-DD HH:mm:ss format, also accepting the legacy YYYY-MM-DD date format. The time zone is not converted, and the value may differ from ds. | "2026-09-21 13:00:00" |
default Flat business error
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
| code | string | No | Stable business error code | "<string>" |
| detail | string | Yes | Human-readable error description | "<string>" |
| details | OpenapiErrorDetails | No | Error details | {"field":"<string>","reason":"<string>","suggestion":"<string>"} |
| details.field | string | No | Request field that failed validation | "<string>" |
| details.reason | string | No | Stable validation failure reason | "<string>" |
| details.suggestion | string | No | Suggested normalized value | "<string>" |
| error | string | Yes | Stable HTTP error type | "<string>" |