Pagination
List endpoints return a subset of matching records controlled by limit and offset query parameters.
Parameters
Section titled “Parameters”| Parameter | Type | Default | Maximum | Description |
|---|---|---|---|---|
limit | integer | 20 | 100 | Number of records to return |
offset | integer | 0 | — | Number of records to skip |
Response Shape
Section titled “Response Shape”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 } }}| Field | Description |
|---|---|
total | Total number of records matching the query (before pagination) |
limit | The limit that was applied |
offset | The offset that was applied |
Iterating All Pages
Section titled “Iterating All Pages”To retrieve all records, advance offset by limit until offset >= total:
#!/bin/bashLIMIT=100OFFSET=0REGION=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 fidoneExample: Second Page
Section titled “Example: Second Page”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.
totalreflects 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
offsetbeyondtotalreturns an emptydataarray withtotalunchanged — it is not an error.