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

# Pagination

> How pagination works across Deel. PayAndBill API endpoints

All list endpoints support standard pagination, sorting, and filtering through query parameters.

## Query Parameters

| Parameter      | Type    | Description                                             |
| -------------- | ------- | ------------------------------------------------------- |
| `page`         | integer | Page number to retrieve. Starts from `1`.               |
| `limit`        | integer | Number of records per page.                             |
| `sortColumn`   | string  | Column used for sorting (e.g. `lastName`, `firstName`). |
| `sortOrder`    | string  | Sorting direction: `asc` or `desc`.                     |
| `statusFilter` | string  | Filter by status (e.g. `1` for active employees).       |
| `searchCol`    | string  | Column to search on. Used together with `searchVal`.    |
| `searchVal`    | string  | Value to search for in the specified column.            |
| `payCycleId`   | string  | Filter results to a specific pay cycle.                 |

## Example Request

```bash
curl -X GET "https://api.astutepayroll.com/employees/list?page=1&limit=20&sortColumn=lastName&sortOrder=asc&statusFilter=1" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Accept: application/json"
```

## Response Metadata

Every paginated response includes metadata to help you navigate through results:

| Field         | Type    | Description                       |
| ------------- | ------- | --------------------------------- |
| `totalCount`  | integer | Total number of matching records. |
| `totalPages`  | integer | Total number of pages available.  |
| `limit`       | integer | Page size used for the request.   |
| `currentPage` | integer | Current page number returned.     |

## Example Response

```json
{
  "rows": [
    {
      "UUID": "e2ed0e36-de0f-445e-9340-68974de2664b",
      "firstName": "John",
      "lastName": "Doe",
      "employeeStatus": "active"
    }
  ],
  "totalCount": 1310,
  "totalPages": 66,
  "limit": 20,
  "currentPage": 1
}
```

## Navigating Pages

To retrieve subsequent pages, increment the `page` parameter:

| Page             | Query              |
| ---------------- | ------------------ |
| First 20 records | `page=1&limit=20`  |
| Records 21-40    | `page=2&limit=20`  |
| Records 201-300  | `page=3&limit=100` |

> **Info**
>
> If `page` exceeds `totalPages`, an empty `rows` array is returned.