Skip to main content

Pagination

Most List endpoints support offset pagination to allow bulk fetching multiple items. Each List endpoint shares a common response structure. Examples of these requests can be seen in List Applications and List Tokens.

The List Logs endpoint supports cursor pagination.

Offset Pagination

Request

curl "https://api.basistheory.com/applications?page=2&size=10" \
-H "BT-API-KEY: <API_KEY>"

Query Parameters

ParameterRequiredTypeDefaultDescription
pagefalseinteger1Page number of the results to return.
sizefalseinteger20Number of results per page to return. Maximum size of 100 results.

Response

{
"pagination": {
"total_items": 924,
"page_number": 2,
"page_size": 10,
"total_pages": 93
},
"data": [
{...},
{...},
{...}
]
}

Offset Pagination Object

AttributeTypeDescription
paginationoffset pagination metadataPagination metadata for the response
dataarrayQuery results of the request. See list endpoint resource for response schema definition

Offset Pagination Metadata Object

AttributeTypeDescription
total_itemsintegerTotal number of items in the Tenant
page_numberintegerCurrent page number. Should match page query parameter.
page_sizeintegerThe size of each page. Should match size query parameter.
total_pagesintegerThe total number of pages.

Cursor Pagination

Request

curl "https://api.basistheory.com/logs?start=AAAAAAAAAAAAAAAABBBBBBBBBBBBBBCCCCCCCCCCDDDDDDDDDD&size=10" \
-H "BT-API-KEY: <API_KEY>"

Query Parameters

ParameterRequiredTypeDefaultDescription
startfalsestringnullCursor provided in the previous query to get the next set of results.
sizefalseinteger20The maximum number of results to return. Maximum size of 100 results.

Response

{
"pagination": {
"next": "AAAAAAAAAAAAAAAABBBBBBBBBBBBBBCCCCCCCCCCDDDDDDDDDD",
"page_size": 10
},
"data": [
{...},
{...},
{...}
]
}

Cursor Pagination Object

AttributeTypeDescription
paginationcursor pagination metadataPagination metadata for the response
dataarrayQuery results of the request. See list endpoint resource for response schema definition

Cursor Pagination Metadata Object

AttributeTypeDescription
nextstringCursor to get the next set of results.
page_sizeintegerThe maximum number of results returned. Should match size query parameter.