> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.awork.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.awork.com/_mcp/server.

# Pagination

> Dealing with paginated responses from the awork API.

To retrieve data, you have to make requests to the REST API. The response of such a request can lead to a huge data set. To avoid this, awork smartly paginates the responses so that they are flexible and easier for users to handle.\
For example, if you get all the projects, the response could end up with hundreds or thousands of projects and their details which, certainly creates a bad experience for your users. To avoid this, a built-in default limit on the server response is set, which varies on which data you are trying to retrieve. The limit is configurable, i.e., you can specify the number of results that you would like to receive from the server.

## Configuring the number of items

You can set the number of items that you would like to retrieve from the API via two properties: `page` and `pageSize`.

| Query Param | Type    | Description                                                     |
| ----------- | ------- | --------------------------------------------------------------- |
| `page`      | integer | The current page number                                         |
| `pageSize`  | integer | How many items should be returned on each page, maximum of 1000 |

For example, if you want to get the first 50 users, you would make the following request:

```sh
GET /users?page=1&pageSize=50
```

## Response Headers

When you make a request to retrieve a list of entries from the API, you get the response as well as headers containing more pagination information.
The following response headers are returned:

| Header Name     | Type    | Description                                     |
| --------------- | ------- | ----------------------------------------------- |
| `aw-page`       | integer | The current page                                |
| `aw-pagesize`   | integer | The current page size, 1000 by default          |
| `aw-items`      | integer | The items in the current page                   |
| `aw-totalitems` | integer | The total items available (considering filters) |