Skip to main content

Pagination

List endpoints return paginated results using offset-based pagination.

Query parameters

ParameterTypeDefaultDescription
pageinteger1Page number (1-indexed)
per_pageinteger25Items per page (max 100)

Response format

Paginated responses include a pagination object alongside the data array:
{
  "data": [
    {
      "uuid": "abc-123",
      "name": "Acme Corp"
    }
  ],
  "pagination": {
    "page": 1,
    "per_page": 25,
    "total": 42,
    "total_pages": 2
  }
}

Example

Fetch the second page with 10 items per page:
curl "https://api.journeybee.io/v1/partners?page=2&per_page=10" \
  -H "Authorization: Bearer YOUR_API_KEY"

Iterating through all results

Increment page until it exceeds total_pages:
let page = 1;
let totalPages = 1;

do {
  const response = await fetch(
    `https://api.journeybee.io/v1/partners?page=${page}&per_page=100`,
    { headers: { Authorization: "Bearer YOUR_API_KEY" } },
  );
  const { data, pagination } = await response.json();

  // Process data...

  totalPages = pagination.total_pages;
  page++;
} while (page <= totalPages);

Non-paginated endpoints

Some list endpoints (stages, tiers, categories, tags, custom fields) return all records without pagination since these collections are typically small.