Skip to content
Dashboard

Pagination

List endpoints return a subset of matching records controlled by limit and offset query parameters.

ParameterTypeDefaultMaximumDescription
limitinteger20100Number of records to return
offsetinteger0Number of records to skip

List responses include a meta.pagination object alongside the data array:

{
"data": [
{ "id": "task_01j...", "title": "Clean Unit 12B" },
{ "id": "task_01j...", "title": "Inspect Pool Area" }
],
"meta": {
"requestId": "req_01j...",
"pagination": {
"total": 142,
"limit": 20,
"offset": 0
}
}
}
FieldDescription
totalTotal number of records matching the query (before pagination)
limitThe limit that was applied
offsetThe offset that was applied

To retrieve all records, advance offset by limit until offset >= total:

#!/bin/bash
LIMIT=100
OFFSET=0
REGION=us
while true; do
response=$(curl -s \
"https://api-${REGION}.suiteop.com/api/v1/tasks?limit=${LIMIT}&offset=${OFFSET}" \
-H "Authorization: Bearer sk_test_your_key_here")
# process $response here
total=$(echo "$response" | python3 -c "import json,sys; d=json.load(sys.stdin); print(d['meta']['pagination']['total'])")
OFFSET=$((OFFSET + LIMIT))
if [ "$OFFSET" -ge "$total" ]; then
break
fi
done
Terminal window
curl "https://api-us.suiteop.com/api/v1/tasks?limit=20&offset=20" \
-H "Authorization: Bearer sk_test_your_key_here"

Returns records 21–40.

  • total reflects the count at query time. If records are created or deleted between pages, you may see gaps or duplicates. For strictly consistent iteration, use a narrower time-range filter if available on the endpoint.
  • Requesting an offset beyond total returns an empty data array with total unchanged — it is not an error.