> For the complete documentation index, see [llms.txt](https://developers.swish.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.swish.app/swish-api/pagination.md).

# Pagination

Some endpoints return paginated results. The formatting of a paginated result is always:

```json
{
  "pageInfo": {
    "next": "...",
    "previous": "..."
  },
  "data": []
}
```

The object `pageInfo` will be omitted if there are no next and previous pages.

The `pageInfo.next` or `pageInfo.previous` value can be added to the query parameters of the original query under the `page` key in order to get the next or previous page. The values can be omitted, which indicates that there is no next or previous page respectively.

## Example

You make a `GET` request to a paginated endpoint `/items`, and receive the following response:

```json
{
  "pageInfo": {
    "next": "next-page-cursor"
  },
  "data": []
}
```

In order to get the next page of results, you would take the cursor from `pageInfo.next` in the response body, and provide it as the value of the `page` key in a query to the same endpoint. The full path including query parameters of your request to get the next page of the listing is:

```
/items?page=next-page-cursor
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.swish.app/swish-api/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.
