> ## Documentation Index
> Fetch the complete documentation index at: https://api-docs.sevalla.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Pagination

> How to paginate through list responses in the Sevalla API.

List endpoints return paginated results using offset-based pagination. You control the page size and position with two query parameters.

## Parameters

| Parameter | Type    | Default | Range   | Description                       |
| --------- | ------- | ------- | ------- | --------------------------------- |
| `limit`   | integer | `25`    | 1-100   | Maximum number of items per page. |
| `offset`  | integer | `0`     | 0-10000 | Number of items to skip.          |

## Response shape

Every paginated response includes these fields:

```json theme={null}
{
  "data": [],
  "total": 42,
  "offset": 0,
  "limit": 25
}
```

| Field    | Type    | Description                                      |
| -------- | ------- | ------------------------------------------------ |
| `data`   | array   | The items for the current page.                  |
| `total`  | integer | Total number of matching items across all pages. |
| `offset` | integer | The offset used for this request.                |
| `limit`  | integer | The limit used for this request.                 |

## Example

Fetch the first page of applications:

```bash theme={null}
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.sevalla.com/v3/applications?limit=10&offset=0"
```

Fetch the next page:

```bash theme={null}
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.sevalla.com/v3/applications?limit=10&offset=10"
```

## Paging through all results

To iterate through every item, increment `offset` by `limit` until you've fetched `total` items.

```typescript theme={null}
const url = "https://api.sevalla.com/v3/applications";
const headers = { Authorization: "Bearer YOUR_API_KEY" };
let offset = 0;
const limit = 25;
const allItems: any[] = [];

while (true) {
  const resp = await fetch(`${url}?limit=${limit}&offset=${offset}`, { headers });
  const body = await resp.json();
  allItems.push(...body.data);

  if (offset + limit >= body.total) break;
  offset += limit;
}

console.log(`Fetched ${allItems.length} applications`);
```

<Tip>Use the smallest `limit` that works for your use case. If you only need to check whether items exist, `limit=1` keeps the response fast.</Tip>
