# Pagination

API methods that return a large number of items, will return them inside a paginated array. Onehub utilizes offset-based pagination. Some methods will respond to an `offset` parameter. To retrieve a complete set of paginated results, you perform multiple requests while increasing the `offset`. This can be passed in the body of the request or by appending `?offset=` to the endpoint.

## Pagination Example

<mark style="color:blue;">`GET`</mark> `https://ws-api.onehub.com/:endpoint?offset=1`

#### Path Parameters

| Name      | Type   | Description                                  |
| --------- | ------ | -------------------------------------------- |
| :endpoint | string | The endpoint for the method you are hitting. |

#### Query Parameters

| Name   | Type    | Description                                                                                                                            |
| ------ | ------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| offset | integer | The number of items you want to move past in the response. Typically, this will be specified as a multiplier of the `per_page` amount. |

#### Request Body

| Name   | Type    | Description                                                                                                                            |
| ------ | ------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| offset | integer | The number of items you want to move past in the response. Typically, this will be specified as a multiplier of the `per_page` amount. |

{% tabs %}
{% tab title="200 " %}

```yaml
{
  "total_entries": 42,
  "current_page": 2,
  "total_pages": 2,
  "per_page": 30,
  "items": [
  ...
  ]
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.onehub.com/api/pagination.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
