Responses that return lists of objects are paginated. Pagination breaks down a large response into smaller responses called pages that
the caller can step through to read all of the data. EncompassFi paginates responses to ensure that response sizes are kept small and
response times remain low.

EncompassFi provides two schemas for pagination depending on the resources being queried: the [API Query Response](#api-query-response) and
[Api List Response](#api-list-response).

## API Query Response

This is the default response scheme for queried results containing multiple resources. Pages can be navigated by sending the `page` and `pageSize`
query parameters in the HTTP request.

br
```
{
  "hasResources": boolean,
  "totalResources": number,
  "totalPages": number,
  "pageSize": number,
  "currentPage": number | null,
  "previousPage": number | null,
  "nextPage": number | null,
  "results": []
}
```

```json
{
  "type": "object",
  "title": "Api Query Response",
  "properties": {
    "hasResources": {
      "type": "boolean",
      "description": "Indicates whether the query would return any objects with no query parameters."
    },
    "totalResources": {
      "type": "integer",
      "description": "The count of the total objects that match the provided query parameters."
    },
    "totalPages": {
      "type": "integer",
      "description": "The page count of the queried resources."
    },
    "pageSize": {
      "type": "integer",
      "description": "The batch size of objects returned."
    },
    "currentPage": {
      "type": "integer or null",
      "description": "Indicates the current page being queried. `Null` if the total resources is 0."
    },
    "previousPage": {
      "type": "integer or null",
      "description": "Indicates the previous page of the page being queried. `Null` if the total resources is 0 or if `currentPage` is 1."
    },
    "nextPage": {
      "type": "integer or null",
      "description": "Indicates the previous page of the page being queried. `Null` if the total resources is 0 or if `currentPage` is equal to `totalPages`."
    },
    "results": {
      "type": "array<object>",
      "description": "All returned resources for the queried page."
    }
  }
}
```

## API List Response

Some query endpoints fetch data from multiple sources or return resources that are generated on demand. For these endpoints, an **API List Response**
is used. Pages can be navigated by creating an HTTP GET request to the provided URLs in `previousPage` or `nextPage`. Endpoints that use the API List
Response schema will be marked as such.

br
```
{
  "previousPage": string | null,
  "nextPage": string | null,
  "results": []
}
```

```json
{
  "type": "object",
  "title": "Api Query Response",
  "properties": {
    "previousPage": {
      "type": "string or null",
      "description": "The URL to the previous page of results."
    },
    "nextPage": {
      "type": "string or null",
      "description": "The URL to the next page of results."
    },
    "results": {
      "type": "array<object>",
      "description": "All returned resources for the queried page."
    }
  }
}
```