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

# Pagination

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

```json
{
  "pagination": {
    "next_page": "...",
    "prev_page": "...",
    "last_page": "...",
    "page": "...",
    "items": "...",
    "pages": "...",
    "from": "...",
    "to": "...",
    "count": "..."
  },
  "records": [
    ...
  ]
}
```

The pagination object contains metadata about the current page and links to other pages. The records array contains the actual data for the current page.

### Pagination Fields

* next\_page: The number of the next page (if available)
* prev\_page: The number of the previous page (if available)
* last\_page: The number of the last page
* page: The current page number
* items: The number of items per page
* pages: The total number of pages
* from: The starting index of the current page's items
* to: The ending index of the current page's items
* count: The total number of items across all pages

Fields that are not applicable (e.g., prev\_page on the first page) will be omitted from the response.

### Usage Example

Let's say you make a GET request to a paginated endpoint:

```
GET /api/v2/users
```

You might receive a response like this:

```json
{
  "pagination": {
    "next_page": 2,
    "last_page": 5,
    "page": 1,
    "items": 100,
    "pages": 5,
    "from": 1,
    "to": 100,
    "count": 450
  },
  "users": [
    ...
  ]
}
```

To get the next page of results, you would make a request to:

```
GET /api/v2/users?page=2
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.screendesk.io/api/screendesk-api/pagination.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
