# Pagination

All top-level API resources have support for bulk fetches via "list" API methods. For instance, you can list Users, list Portals, and list Roles. These list API methods share a common structure, taking at least these two parameters: limit, after.

The response of a list API method represents a single page in a chronological stream of objects. If you do not specify `after`, you will receive the first page of this stream, containing the oldest objects.&#x20;

In each page, the value to be used to get to the next page in the `after` parameter is supplied.

See an example of paginated response that returns 2 items:

```json
{
    "data": [
        {
            "id": "ro_ZW9dbXgfX2L0Dg",
            "name": "Admin Builder",
            "is_system": true
        },
        {
            "id": "ro_3zrr1XRrXMyYG6",
            "name": "Builder",
            "is_system": true
        }
    ],
    "paging": {
        "next": {
            "after": "MQit=" // This should be the value to use in the `after` parameter to get to the next page
        }
    }
}
```

You are at the end of the pages when the `after` parameter is not longer returned in the responses.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.whaly.io/pagination.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
