Pagination

All endpoints that return a list of objects will include a metadata object property. We used cursor based pagination for efficiency and accuracy (if something changes between the loading of the first page and visiting of the second we don’t want anything missed.

On each request either before or after is required, but both may not be specified together.

Request Properties
Name Type Description
before UUID Required The starting point used to calculate this list result going backward
after UUID Required The starting point used to calculate this list result going forward
offset int [Optional - Default is 0] How far behind or ahead of the cursor (before or after) to skip before returning results. (Useful in implementing pagination UI where multiple pages are visible at once)
limit int [Optional - Default is 20] The currently visible page size
Response Properties
Name Description
cursor/before A cursor that points to the start of the data that has been returned
cursor/after A cursor that points to the end of the data that has been returned
offset How far along the total list the first item is
limit Required The currently visible page size
count Required The total count of items in the list
previous Optional A link to the previous page in the list
next Optional A link to the next page in the list

If previous is not specified, this is the first page in the list. If next is not specified, there are no further pages in the list.

metadata: {
    "limit": 20,
    "offset": 40,
    "count": 511,
    "cursors": {
        "before": "7790d316-b1bc-48e3-8759-5d722d30545e",
        "after": "9620050c-c53e-4d93-b53b-f5056c456428"
    },
    "previous": "/locks/{lock_id}/events?limit=3&before=7790d316-b1bc-48e3-8759-5d722d30545e",
    "next": "/locks/{lock_id}/events?limit=3&after=9620050c-c53e-4d93-b53b-f5056c456428"
}