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

# Scribe API pagination: page-based list endpoints

> Scribe API list endpoints use page-based pagination. Page through results with the page and limit parameters and the pagination object.

List endpoints, such as `GET /v1/signatures` and `GET /v1/teammates`, return results one page at a time using page-based pagination. Results are ordered newest first.

## Query parameters

| Parameter | Type    | Description                                        |
| --------- | ------- | -------------------------------------------------- |
| `page`    | integer | The 1-based page number to fetch. Defaults to `1`. |
| `limit`   | integer | Page size. Defaults to `50`. Maximum `100`.        |

## The pagination object

Every list response includes a `pagination` object alongside the `data` array:

```json theme={null}
{
  "data": [ ... ],
  "pagination": {
    "page": 1,
    "limit": 50,
    "total_count": 1284,
    "total_pages": 26,
    "has_more": true
  }
}
```

| Field         | Description                                                               |
| ------------- | ------------------------------------------------------------------------- |
| `page`        | The page number returned in this response.                                |
| `limit`       | The page size applied to this response.                                   |
| `total_count` | Total number of records across all pages.                                 |
| `total_pages` | Total number of pages at this `limit`.                                    |
| `has_more`    | `true` when more pages are available (`page` is less than `total_pages`). |

## Fetch every page

Request page 1, then increment `page` until `has_more` is `false`:

```bash theme={null}
# First page
curl "https://api.scribe-mail.com/v1/teammates?limit=100&page=1" \
  -H "Authorization: Bearer YOUR_API_KEY"

# Next page
curl "https://api.scribe-mail.com/v1/teammates?limit=100&page=2" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

The same loop in JavaScript:

```javascript theme={null}
async function listAllTeammates(apiKey) {
  const results = [];
  let page = 1;
  let hasMore = true;

  while (hasMore) {
    const url = new URL("https://api.scribe-mail.com/v1/teammates");
    url.searchParams.set("limit", "100");
    url.searchParams.set("page", String(page));

    const res = await fetch(url, {
      headers: { Authorization: `Bearer ${apiKey}` },
    });
    const body = await res.json();

    results.push(...body.data);
    hasMore = body.pagination.has_more;
    page += 1;
  }

  return results;
}
```
