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

# Pagination

> Page through list endpoints with the page and limit query parameters.

Endpoints that return a list of entities return it one page at a time. The following endpoints are paginated:

| Endpoint | Returns |
| - | - |
| [`GET /v1/invites`](https://docs.theguarantors.com/application-api/invites/list-invites) | Your invites |
| [`GET /v1/applications/:application_id/bonds`](https://docs.theguarantors.com/application-api/bonds/list-bonds-for-an-application) | The bonds issued for an application |

## Query parameters

| Parameter | Type | Default | Description |
| - | - | - | - |
| `page` | integer | `1` | The page to return, starting at 1 |
| `limit` | integer | `10` | The number of items per page, between 1 and 500 |

A `page` below 1, a `limit` outside 1 to 500, or a value that isn't an integer returns a `400`:

```json theme={null}
{
  "message": "validation error: invalid pagination parameters: value for limit should be a valid integer between 1 and 500",
  "object": "error"
}
```

## Response

A paginated response wraps the page of entities in `items`, alongside the totals you need to request the rest:

| Field | Type | Description |
| - | - | - |
| `total_items` | integer | The number of items across all pages |
| `total_pages` | integer | The number of pages at the requested `limit` |
| `current_page` | integer | The page returned |
| `items_per_page` | integer | The number of items per page |
| `items` | array | The entities on this page |

**Example Request**

```
GET /v1/applications/sd_xyz789/bonds?page=1&limit=10
Authorization: Basic <your-api-key>
```

**Example Response**

```json theme={null}
{
  "total_items": 1,
  "total_pages": 1,
  "current_page": 1,
  "items_per_page": 10,
  "items": [
    {
      "id": "bond_def456",
      "application_id": "sd_xyz789",
      "status": "issued",
      ...
      "object": "bond"
    }
  ]
}
```

To fetch every item, request page 1 and then each following page up to `total_pages`.
