Pagination
API lists are paginated with a cursor. Three parameters, the same everywhere:
| Parameter | Meaning |
|---|---|
limit |
Items per page, from 1 to 500. Defaults to 100. |
cursor |
The next_cursor from the previous page. Opaque: do not build it, do not decode it. |
updated_since |
ISO 8601 date: only return what was modified since then. |
Paginated endpoints:
| Endpoint | List in data |
Date filter | Order | limit |
|---|---|---|---|---|
GET /properties |
properties |
updated_since |
oldest change first | 100 by default, 500 max |
GET /reservations |
reservations |
updated_since |
oldest change first | 100 by default, 500 max |
GET /events |
events |
since (creation date) |
oldest first | 100 by default, 500 max |
GET /webhooks/deliveries |
deliveries |
status |
newest first | 50 by default, 200 max |
An unreadable cursor (tampered with, or coming from another endpoint) is rejected with
400 INVALID_PAYLOAD.
The response
Section titled “The response”data keeps its list field and gains next_cursor:
{ "success": true, "environment": "production", "data": { "properties": [ { "external_property_id": "PROP-4821", "…": "…" } ], "truncated": true, "next_cursor": "eyJ0IjoiMjAyNi0wOS0yOFQwODowMTo1MiIsImlkIjoiOWYyYyJ9" }}next_cursor is null on the last page. truncated is still present on GET /properties and
GET /reservations for integrations written before pagination existed: it is true when there is
a next page.
Walking a list
Section titled “Walking a list”let cursor = null;do { const url = new URL('https://localoge.com/api/v1/channel/properties'); url.searchParams.set('limit', '200'); if (cursor) url.searchParams.set('cursor', cursor); const r = await fetch(url, { headers: { Authorization: `Bearer ${process.env.LOCALOGE_KEY}` } }); const { data } = await r.json(); for (const p of data.properties) traiter(p); cursor = data.next_cursor;} while (cursor);The SDKs provide an iterator that runs this loop for you (see Reference).
Incremental sync
Section titled “Incremental sync”The recommended pattern for a recurring run:
- Record the time before you start (
started_at). - Walk
GET /reservations?updated_since=<last_run>untilnext_cursor: null. - Save
started_atas the newlast_run.
Taking the timestamp before the run, not after, guarantees that a change made during the run shows up on the next one. An item seen twice is harmless if you process by ID; an item never seen is a double booking waiting to happen.
On GET /reservations, updated_since applies to the modification date: a reservation
cancelled since your last run shows up again, with status: "cancelled".