> ## Documentation Index
> Fetch the complete documentation index at: https://docs.slm.m1amdocs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Pagination

All **GET** endpoints which return an object list support cursor based pagination with pagination information inside a pagination object. This means that to get all objects, you need to paginate through the results by always using the id of the last resource in the list as a starting\_after parameter for the next call.

To make it easier, the API will assign the next call into next attribute together with all the currently used pagination parameters. You know that you have paginated all the results when the return is empty (**next** value will be undefined, as well).

Using cursor-based pagination protects against the situation when the resulting object list changes during pagination (new resource gets added or removed).

The default limit is set to 20 but values up to 100 are permitted.

| Parameter |   | Description |
| - | - | - |
| limit | optional | A limit on the number of objects to be returned, between 1 and 100. |
| starting\_after | optional | A cursor for use in pagination. starting\_after is an object **id** that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj\_foo, your subsequent call can include starting\_after=obj\_foo in order to fetch the next page of the list. |
| ending\_before | optional | A cursor for use in pagination. ending\_before is an object **id** that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj\_bar, your subsequent call can include ending\_before=obj\_bar in order to fetch the previous page of the list. |

## Example Call

```

GET /foos
Content-Type: application/json
Content-Length: 32509

```

## Example Collection Pagination

```

{
  "object": "List",
  "data": [...],
  "total_count": 31,
  "url": "/foos",
  "next": "/foos?starting_after=Montly+Stream",
  "previous": "/foos?ending_before=Daily+Stream"
}
```

**Parent topic:**[Subscribe REST API Overview](../topics/Overview)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.