Pagination
The Pointeron API uses cursor-based pagination for all list endpoints. This guide explains the pagination parameters, response format, and how to iterate through complete result sets.
How it works
Every list endpoint returns results in pages. The response includes a meta object that tells you whether more results exist and provides the cursor to fetch the next page. Cursors are opaque strings -- do not attempt to construct or modify them.
Request parameters
- Name
limit- Type
- integer
- Description
The number of items to return per page. Minimum
1, maximum100, default20.
- Name
cursor- Type
- string
- Description
An opaque cursor string returned from a previous response. Omit this parameter to fetch the first page.
Fetching the first page
curl -G https://api.pointeron.com/v2/assets \
-H "Authorization: Bearer sk_live_your_api_key_here" \
-d limit=10
Response format
List responses include a meta object alongside the data array:
- Name
has_more- Type
- boolean
- Description
trueif there are additional pages of results beyond the current one.
- Name
next_cursor- Type
- string | null
- Description
The cursor to pass as the
cursorparameter for the next page.nullwhen there are no more results.
Paginated response
{
"object": "list",
"data": [
{
"id": "ast_WAz8eIbvDR60rouK",
"name": "Delivery Van 01",
"type": "vehicle"
// ...
},
{
"id": "ast_hSIhXBhNe8X1d8Et",
"name": "Fleet Truck 05",
"type": "vehicle"
// ...
}
],
"meta": {
"has_more": true,
"next_cursor": "eyJpZCI6ImFzdF9oU0loWEJoTmU4WDFkOEV0In0"
}
}
Fetching the next page
To get the next page of results, pass the next_cursor value from the previous response as the cursor parameter.
curl -G https://api.pointeron.com/v2/assets \
-H "Authorization: Bearer sk_live_your_api_key_here" \
-d limit=10 \
-d cursor="eyJpZCI6ImFzdF9oU0loWEJoTmU4WDFkOEV0In0"
Paginating through all results
Here is a complete example that fetches every asset in your organization by following cursors until has_more is false.
async function getAllAssets(apiKey) {
const baseUrl = 'https://api.pointeron.com/v2/assets'
const allAssets = []
let cursor = null
do {
const params = new URLSearchParams({ limit: '100' })
if (cursor) params.set('cursor', cursor)
const response = await fetch(`${baseUrl}?${params}`, {
headers: { 'Authorization': `Bearer ${apiKey}` },
})
const json = await response.json()
allAssets.push(...json.data)
cursor = json.meta.next_cursor
} while (cursor)
return allAssets
}
Cursors are opaque and should not be constructed, parsed, or stored long-term. They may change format without notice. Always use the next_cursor value exactly as returned by the API.