# Pagination

## Pagination

The CAMS API uses cursor based pagination using the following query parameters:

* `after` A cursor for use in pagination. `after` is the token of the last item retrieved from the previous page. By placing the `after` token in the argument, you are requesting the list *after* that cursor.
* `limit` A string representation of an integer that defines the maximum number of list items to return in the response. The maximum `limit` allowed is dependent on the server's maximum setting.

#### Paginated Responses <a href="#paginated-responses" id="paginated-responses"></a>

Not all queries are paginated. Those which are will return a response with the following format: {items: \[ Items ],after: "c3f7d835-795d-4ce3-ac1b-2b1e288be8b0",totalCount: 100,}

* `items` The items are the data in the current page
* `after` This field in the response can be used directly in place of the `after` query parameter to retrieve the next page of data in the list. It will correlate directly to the token of the last item in the list
* `totalCount` The `totalCount` field is the total number of items in the entire data set

**Last page**

If the `after` field returned in the query is `null`, this means you have retrieved the last page in the data set, and no more items are available.

**Filters and Sorting**

Note that the pages in a list only correlate to one another should the filters and sorting remain the same for all queries. Should either change, the paging process will likely need to be restarted.


---

# 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://docs.aquanow.io/cams/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.
