Skip to main content

Pagination

List endpoints return the newest records first, one page at a time.

curl "https://api.kosoor.com.sa/v1/customers?limit=50" \
-H "Authorization: Bearer ksr_live_..."
{
"data": [
{ "id": "0f8fad5b-d9cb-469f-a165-70867728950e" }
],
"hasMore": true
}
ParameterMeaning
limit1 to 100; 20 when omitted
startingAfterthe id of the last record of the previous page

While hasMore is true, ask for the next page with startingAfter set to the last id you received. A record added while you page appears at the top of the list, so it never shifts the pages you are reading.