Skip to main content

Query Events

Query your Tenant's event history. See Events for authentication, searchable history, consistency, and availability. Individual runtime-log records have their own endpoints: List Reactor Logs and List Proxy Logs.

List Events​

Get a page of events for the Tenant, newest first.

GET
https://api.basistheory.com/events
Copy

Permissions​

event:read

Request​

data.<path> filters are not fixed request fields, so the SDKs send them as extra query parameters through each SDK's per-request options. The examples below show how.

curl "https://api.basistheory.com/events?type=token.created&data.token.metadata.order=order-1&size=20" \
-H "BT-API-KEY: <MANAGEMENT_API_KEY>"

Query Parameters​

ParameterRequiredTypeDefaultDescription
start_datefalsedate24 hours before end_dateReturns events whose timestamp is greater than or equal to this value. ISO 8601 with a timezone and at most millisecond precision; URL-encode a + offset as %2B. A value earlier than your searchable history is raised to the oldest visible instant. Must not be after end_date.
end_datefalsedateTime of the requestReturns events whose timestamp is less than this value. Same format as start_date. A future value is lowered to the time of the request.
sizefalseinteger20Maximum number of unique events to return, from 1 to 100.
typefalsestringnullExact event type, such as token.created.
trace_idfalsestringnullExact event trace ID.
data.<path>falsestringnullExact payload value, such as data.token.metadata.order=order-1. See Filtering by Payload.
startfalsestringnullCursor from a previous response's pagination.next. See Ordering and Pagination.

Equal start_date and end_date values return an empty page. Each parameter accepts a single value; unknown or repeated parameters return 400. A request accepts at most 36 query parameters. Values are limited to 1,024 characters, except start, which allows 12,000.

Filtering by Payload​

Payload filters are exact, case-sensitive string equality on a dotted path under data, and multiple filters combine with AND.

  • Any leaf under data is filterable, including keys you define, such as data.token.metadata.<key>, as long as the key uses only ASCII letters, digits, underscores, and hyphens. There is no escape syntax: a dot in a filter path always separates segments, so a key that contains a dot, a space, or any other character cannot be addressed.
  • Numbers and booleans compare as their string form, for example data.destination.response.status=200.
  • An array path matches when any element matches. Two filters on the same array are not correlated to the same element.
  • Paths are up to 256 characters, including data., made of dot-separated segments of ASCII letters, digits, underscores, and hyphens. The combined filters are limited to 4,096 bytes.

Substring, wildcard, prefix, and case-insensitive matching are not supported, nor are numeric or date ranges on payload values, membership operators, or sorting and aggregation on payload fields. start_date and end_date apply to the event timestamp only; a date inside data matches only by exact string.

The event types and the fields in each payload are listed on Event Types. The Events API returns the event object described there, without the delivered_at wrapper. data.records.message on reactor.log and proxy.log events is also exact-match only; use List Reactor Logs or List Proxy Logs to search messages by word.

Ordering and Pagination​

Events are sorted by timestamp, newest first, then by id descending. Responses use the cursor paginated object. pagination.page_size is the number of events returned, pagination.next is null when there are no more results, and no total count is returned.

To get the next page, send pagination.next as the start parameter. The cursor carries the original filters, dates, and size, so start alone is enough; if you send those parameters again, they must match. Cursors are opaque, bound to your Tenant, and valid only on the route that issued them. A short page can still have a next cursor, so keep paging until next is null.

Every page re-checks your permissions and current searchable history. History that has expired since the first page is excluded from later pages.

A single page never contains the same id twice, but the same event can appear on more than one page, after you restart a query, or in overlapping polling windows. Deduplicate by id.

A cursor can expire. The API then returns 400 with errors.start set to Invalid or expired cursor. Restart the query without 'start'. Restart the query without start.

Response​

Returns a cursor paginated object with the data property containing an array of events. Returns an error if events could not be retrieved.

{
"data": [
{
"id": "ad393f80-3cc7-4f30-902f-02e239f6a039",
"tenant_id": "d87c3e57-e7e3-45e6-bfce-db5177102019",
"type": "token.created",
"timestamp": "2026-09-16T12:00:00.000Z",
"trace_id": "example-trace",
"data": {
"token": {
"metadata": {
"order": "order-1"
}
}
}
}
],
"pagination": {
"next": "opaque-cursor",
"page_size": 1
}
}

An empty or exhausted result has no cursor:

{
"data": [],
"pagination": {
"next": null,
"page_size": 0
}
}

Event Object​

AttributeTypeDescription
iduuidUnique identifier of the event.
tenant_iduuidThe Tenant that owns the event.
typestringThe event type, such as token.created.
timestampdateWhen the operation happened, in ISO 8601 format. start_date and end_date filter on this field.
trace_idstring(Optional) Identifier that correlates related events.
dataobjectThe event payload. Its shape depends on type; see Event Types.

Errors​

Errors use the Problem Details format with the application/problem+json content type. Validation errors include a field-level errors object. The same statuses apply to List Reactor Logs and List Proxy Logs.

StatusMeaning
400A date is malformed; start_date is after end_date; size, a filter, a path, or the resource ID is invalid; or the cursor is invalid, does not match the query, or has expired.
401The credential is missing or invalid.
403The Application lacks event:read (List Events) or log:read (runtime-log endpoints).
429The request was rate limited. Retry after the number of seconds in the Retry-After header.
500An unexpected error occurred.
503The service is temporarily unavailable. Retry later. The API never returns an empty page in this case.

An unsupported query parameter or payload path:

{
"type": "about:blank",
"title": "One or more validation errors occurred.",
"status": 400,
"detail": "The inputs supplied to the API are invalid",
"instance": "/events",
"errors": {
"query": ["Unsupported query parameter or field path."]
}
}

An expired cursor:

{
"type": "about:blank",
"title": "One or more validation errors occurred.",
"status": 400,
"detail": "The inputs supplied to the API are invalid",
"instance": "/events",
"errors": {
"start": ["Invalid or expired cursor. Restart the query without 'start'."]
}
}