OORQO API

Pagination

Every list endpoint pages with a cursor. Pass meta.next_cursor back as ?cursor= until has_more is false.

All list endpoints return a page of results and a cursor to the next page:

GET /api/v1/contacts?limit=2
{
  "data": [
    { "id": 1043, "first_name": "Rahim" },
    { "id": 1042, "first_name": "Sara" }
  ],
  "meta": {
    "limit": 2,
    "has_more": true,
    "next_cursor": "eyJpZCI6MTA0MiwiX3BvaW50c1RvTmV4dEl0ZW1zIjp0cnVlfQ",
    "prev_cursor": null
  }
}
ParameterDefaultMeaning
limit25Items per page, 1 to 100.
cursor—meta.next_cursor (forward) or meta.prev_cursor (back) from the previous page.

Cursors are opaque: don't build or parse them. A cursor stays valid while the list's filters stay the same, and rows added while you page never make you skip or repeat an item.

Fetch every page

async function* allContacts() {
  let cursor = null;
  do {
    const url = new URL('https://app.orqo.site/api/v1/contacts');
    url.searchParams.set('limit', '100');
    if (cursor) url.searchParams.set('cursor', cursor);

    const res = await fetch(url, { headers: { Authorization: `Bearer ${process.env.ORQO_API_TOKEN}` } });
    const { data, meta } = await res.json();
    yield* data;
    cursor = meta.has_more ? meta.next_cursor : null;
  } while (cursor);
}

Order of each list

EndpointOrder
GET /contacts, /segments, /campaigns, /campaigns/{id}/recipients, /segments/{id}/contactsNewest first
GET /conversationsMost recent message first
GET /conversations/{id}/messagesOldest first (reading order)
GET /notificationsNewest first

Filters are plain query parameters (?status=open&channel=whatsapp). An unknown value is a 422 validation_failed, never silently ignored.

On this page