Query a usage report
Query a usage report.
AuthorizationBearer <esk_live_…>A workspace API key created in workspace settings. It acts as the member who created it, narrowed to its abilities, projects and credit limit. Each operation names the ability it needs.
Scope: reports:read
Endless-Api-Version?stringPin the caller to an API major (1). Omit to accept the current version. A major this deployment cannot serve is refused with 400 unsupported_api_version.
application/json- body
organization_ids*array<>The workspaces the report covers, by id. The caller must be a member of every one.
1 <= items <= 100metrics*array<>The first metric orders a ranking and a breakdown.
1 <= itemsgroup_by?string"none""none""day""week""month""user""workspace""team""feature""model""variant""output_type""status""provider""source""credit_type""channel""tool"period*|||timezone?stringDay, week and month buckets and the period edges use this zone.
"UTC"filters?{}limit?integerRows in a ranking or a breakdown.
1 <= value <= 10010OK
application/json- response
audience*|array<>Whose usage the report counted: each workspace by id, name and slug. user_ids: null = every member of that workspace; a list = only those people.
period*result*|||curl -X POST 'https://api.endless.app/reports/query' \ -H 'Content-Type: application/json' \ -d '{ "organization_ids": [ "string" ], "metrics": [ "credits_spent" ], "period": { "kind": "last_days", "days": 1 }}'{ "audience": "all", "period": { "from": "2019-08-24T14:15:22Z", "to": "2019-08-24T14:15:22Z", "timezone": "string", "earlier_cycle": true }, "result": { "shape": "kpi", "values": { "property1": 0, "property2": 0 } }}