Pagination

How to page through list endpoints.

Every list response uses the same list envelope — object, url, has_more, next_cursor, and data — whether or not the endpoint actually paginates. That shared shape does not mean every list endpoint honours limit and next_cursor.

Cursor-paginated endpoints

These six index endpoints paginate with opaque cursors:

  • GET /accommodations
  • GET /accommodations/{accommodation_id}/variants
  • GET /bookings
  • GET /custom-fields
  • GET /packages
  • GET /voucher-codes

Results are ordered by creation time, newest first. Pass next_cursor from the previous response to fetch the next page. Use limit to set the page size — default 50, maximum 200. Out-of-range values are clamped rather than rejected: a limit above 200 or zero/negative returns a successful response with the clamped size. When has_more is false and next_cursor is null, you have reached the last page. Cursors are opaque — do not build or parse them yourself; a malformed cursor is ignored and the first page is returned.

curl "https://api.myeasol.com/accommodations?limit=50&next_cursor=eyJpZCI6Mn0" \
  -H "Authorization: Bearer YOUR_API_KEY"
{
  "object": "list",
  "url": "/accommodations",
  "has_more": true,
  "next_cursor": "eyJpZCI6Mn0",
  "data": [ /* … */ ]
}

Choosing the order

GET /bookings lets you order results with sort_by and sort_direction; its reference entry lists the fields it accepts. sort_by defaults to created_at and sort_direction to desc, so leaving both out lists the newest created first. Every other endpoint above returns creation order only.

A cursor belongs to the order that produced it, so keep sort_by and sort_direction the same for every request in a run of pages. Changing either mid-run returns the first page of the new order rather than continuing where you were — the same signal as a malformed cursor.

curl "https://api.myeasol.com/bookings?sort_by=booked_at&sort_direction=asc&limit=50" \
  -H "Authorization: Bearer YOUR_API_KEY"

Endpoints that return the full result set

These four list endpoints return every matching record in one response. They call the same list envelope, but has_more is always false and next_cursor is always null. limit and next_cursor query parameters are accepted but ignored — the endpoints do not reject unknown or extra query parameters either.

  • GET /packages/{package_id}/availability
  • GET /reports
  • GET /reports/runs
  • GET /terminal-readers

Some of these bound the response another way instead — GET /packages/{package_id}/availability, for example, requires a start_at window and rejects one wider than 90 days. Check the endpoint's own reference entry for the limits that apply to it.

On this page