Skip to content
RelayDocumentation

API ReferenceOverview

Pagination

List endpoints return results in pages using cursors.

Every list endpoint (GET /v1/events, GET /v1/endpoints…) is paginated with cursors. Results are sorted newest first.

Parameters

Query parameters

limitintegerdefault: 20
Number of results, between 1 and 100.
starting_afterstring
An object ID. Returns the page after this object.
ending_beforestring
An object ID. Returns the page before this object.

Response

{
  "object": "list",
  "data": [{ "id": "evt_9fK2mLq81" }, { "id": "evt_9fK2mLq80" }],
  "has_more": true
}

To get the next page, pass the id of the last item as starting_after.

Auto-pagination

The SDKs can iterate through every page for you:

for await (const event of relay.events.list({ type: "invoice.paid" })) {
  console.log(event.id);
}