Every usage event, oldest first: a page at a time, or all as CSV or NDJSON
GET
/v1/admin/usage
const url = 'https://example.com/v1/admin/usage?format=json';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://example.com/v1/admin/usage?format=json' \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”tenant
string
Only this tenant’s events.
from
string
At or after this day or time.
to
string
Before this day or time.
format
string
Json (a page at a time), or every event as csv or ndjson.
limit
integer
At most this many (1 to 200, 50 by default).
cursor
string
The page after the one whose next this is.
Responses
Section titled “Responses”The answer.
object
metering
required
string
items
required
Array<object>
object
id
required
string
at
required
string
tenant
required
string
key
required
string
source
required
string
kind
required
string
job
required
null | string
batch
required
null | string
template
required
null | string
version
required
null | integer
tier
required
string | null
pages
required
integer | null
bytes
required
integer | null
images
required
null | integer
dpi
required
null | integer
waitMs
required
integer | null
renderMs
required
integer | null
outcome
required
string
requestId
required
string | null
details
object
next
required
Example generated
{ "metering": "example", "items": [ { "id": "example", "at": "example", "tenant": "example", "key": "example", "source": "example", "kind": "example", "job": "example", "batch": "example", "template": "example", "version": 1, "tier": "example", "pages": 1, "bytes": 1, "images": 1, "dpi": 1, "waitMs": 1, "renderMs": 1, "outcome": "example", "requestId": "example", "details": {} } ], "next": "example"}With format=csv: a header line, then an event a line.
string
With format=ndjson: an event a line, as JSON.
string
Example generated
exampleThe request is malformed (bad-request).
Media typeapplication/json
object
code
required
string
message
required
string
requestId
string
Example
{ "code": "field-unknown"}No key, or not a valid one.
Media typeapplication/json
object
code
required
string
message
required
string
requestId
string
Example
{ "code": "field-unknown"}The key lacks the scope, or its tenant is suspended or deleted.
Media typeapplication/json
object
code
required
string
message
required
string
requestId
string
Example
{ "code": "field-unknown"}