> ## Documentation Index
> Fetch the complete documentation index at: https://developer.sandbox.co.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Pagination

> Learn how to retrieve paginated data using page_size and last_evaluated_key.

List endpoints may return paginated results. When a response includes `last_evaluated_key`, more items are available. Include this value in subsequent requests to fetch the next page.

> [!NOTE]
>
> Pagination is forward-only. You cannot navigate to previous pages.

## How pagination works

**1. Send initial request**

Send a request with `page_size` to specify how many items you want per page.

**2. Receive first page**

The response includes `items` and `last_evaluated_key` if more pages exist.

**3. Request next page**

Include the `last_evaluated_key` from the previous response in your next request.

**4. Repeat until complete**

Continue until the response doesn't include `last_evaluated_key`, indicating you've reached the last page.

```mermaid theme={null}
sequenceDiagram
    participant Client
    participant Server
    
    Client->>Server: Request with page_size
    Server->>Client: items + last_evaluated_key
    
    Client->>Server: Request with last_evaluated_key
    Server->>Client: items + last_evaluated_key
    
    Client->>Server: Request with last_evaluated_key
    Server->>Client: items (no last_evaluated_key)
    
    Note over Client: End of results
```

## Request parameters

**page\_size** `integer`

Maximum items to return per page (up to 50)

**last\_evaluated\_key** `string`

Cursor from previous response to fetch the next page

## Response fields

**items** `array`

Results for the current page

**last\_evaluated\_key** `string`

Present only when more pages exist. Include in your next request to continue.

## Example

### First request

```json theme={null}
{
  "@entity": "in.co.sandbox.tds.reports.jobs.search",
  "tan": "AHMQ00112A",
  "quarter": "Q1",
  "form": "24Q",
  "financial_year": "FY 2024-25",
  "from_date": 1765530000000,
  "to_date": 1765536568538,
  "page_size": 10
}
```

### First response

```json theme={null}
{
  "code": 200,
  "timestamp": 1715757773000,
  "transaction_id": "109469b2-0748-4135-a569-e86fc9e45756",
  "data": {
    "@entity": "in.co.sandbox.tds.reports.paginated_list",
    "items": [
      { /* job item */ },
      { /* job item */ }
    ],
    "last_evaluated_key": "ZDVkMzAyZmUtMWFjYS00YjkxLTgyMWUtMTQxYmM4ZGE1NmNmIA=="
  }
}
```

### Next request

Include the `last_evaluated_key` from the previous response:

```json theme={null}
{
  "@entity": "in.co.sandbox.tds.reports.jobs.search",
  "tan": "AHMQ00112A",
  "quarter": "Q1",
  "form": "24Q",
  "financial_year": "FY 2024-25",
  "from_date": 1765530000000,
  "to_date": 1765536568538,
  "page_size": 10,
  "last_evaluated_key": "ZDVkMzAyZmUtMWFjYS00YjkxLTgyMWUtMTQxYmM4ZGE1NmNmIA=="
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.