GET
/
api
/
v1
/
usage
/
events
{
  "data": [
    {
      "id": "<string>",
      "accessTokenId": "<string>",
      "userId": "<string>",
      "workspaceId": "<string>",
      "timestamp": "2023-11-07T05:31:56Z"
    }
  ],
  "hasMore": false,
  "totalCount": 123
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

workspace_id
string[] | null

Filter by workspace IDs

user_id
string[] | null

Filter by user IDs

access_token_id
string[] | null

Filter events by access token IDs

IMPORTANT: This is not the same as the access token used in the authorization header of the request as this would be insecure but the id of the token. The id can be look up using the access token lookup endpoint.

start_time
string | null

Include events starting from this time (inclusive).

Format: Unix timestamp, e.g., 1717689600, or ISO 8601 with timezone, e.g., 2024-06-06T16:00:00Z

end_time
string | null

Include events until this time (exclusive).

Format: Unix timestamp, e.g., 1717689600, or ISO 8601 with timezone, e.g., 2024-06-06T16:00:00Z

starting_after
string | null

Return events after this event ID; to be used for pagination, won't change the total_count

limit
integer
default:10

Maximum number of events to return (in the response). The lower the faster the response time (less memory consumption or bandwidth).

Required range: 1 <= x <= 1000
expand
enum<string>[] | null

Include additional fields in the response.

  • The total count represents all the number of events that match the query, not only the ones returned in the response, but is only accurate up to 100000 events.
Available options:
total_count

Response

200
application/json
Usage events listed successfully
data
object[]
required

List of usage events matching the query

hasMore
boolean
default:false

Whether more events exist beyond the limit

totalCount
integer | null

The total number of events that match the query, only accurate up to 100000.