Skip to content

Pagination

When calling the People Cloud API, some endpoints may return a large number of records.
This guide covers pagination for the inquiries listing endpoint.
Use query parameters to page through results and reduce payload sizes.

Note: The positions endpoint returns all positions for an inquiry as a plain array — it does not support pagination.


Query Parameters

Parameter Type Description
page integer The page number to retrieve (default: 1)
per_page integer Number of items per page (e.g., 5, 10, 50)

How Pagination Works

Paginated responses include metadata such as:

  • current_page
  • per_page
  • total
  • last_page
  • from, to

Example Request

To request a specific page of results, use the page query parameter:

Inquiries

curl -s -X GET \
  "https://your-domain.com/api/v1/inquiries?page=1&per_page=10&q=cloud" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json" | jq

Paginated Response (Sample)

Example response structure for inquiries

{
  "total": 7,
  "per_page": 10,
  "current_page": 1,
  "last_page": 1,
  "from": 1,
  "to": 7,
  "orders": [ /* array of inquiry summary objects */ ]
}

Pagination Fields Explained

Field Description
current_page The current page number
total Total number of records in the dataset
per_page Number of items per page as requested
last_page Total number of pages available
from, to Range of items shown on the current page

Tips

  • Use .last_page in the frontend to build pagination buttons.

  • When piping curl into jq, avoid -i which prints response headers. Use -s (silent) so only the JSON body reaches jq:

curl -s "https://your-domain.com/api/v1/inquiries?page=1&per_page=10" \
  -H "Authorization: Bearer $TOKEN" -H "Accept: application/json" | jq
  • Note about inquiries: the controller applies some filtering in-memory and then returns pagination metadata based on the filtered collection. This is correct for the filtered results but may be less efficient than DB-side pagination for very large datasets.