The Lynked Public API is in development. Endpoints will appear here as they go live.

Pagination

Endpoints that return lists (for example, the customers of your business) return them in pages. Lynked uses cursor pagination: instead of asking for "page 3", you ask for "the page after this point". The point is called a cursor.

Request#

Every list endpoint accepts two query parameters:

ParameterTypeDescription
limitinteger, 1–100, default 20How many items one page holds at most.
cursorstringWhere the page starts. Omit it for the first page; for every next page, send the next_cursor of the previous response.

Response#

Every list endpoint returns an object with the same two fields:

FieldTypeDescription
itemsarrayThe items of this page, in the order the endpoint describes (usually oldest first).
next_cursorstring or nullThe cursor of the next page. null means this is the last page.
json
{
  "items": [
    { "id": 101, "first_name": "Anna" },
    { "id": 102, "first_name": "Liam" }
  ],
  "next_cursor": "eyJpZCI6MTAyfQ"
}

Reading every page#

  1. Request the first page without cursor.
  2. Process items.
  3. If next_cursor is null, stop. Otherwise request again with cursor=<next_cursor> and the same other parameters, and go back to step 2.
http
GET /api/public/v1/customers?limit=100 HTTP/1.1
Authorization: Bearer lk_live_...
http
GET /api/public/v1/customers?limit=100&cursor=eyJpZCI6MTAyfQ HTTP/1.1
Authorization: Bearer lk_live_...
js
let cursor = null;
do {
  const url = new URL('https://api.lynked.ie/api/public/v1/customers');
  url.searchParams.set('limit', '100');
  if (cursor) url.searchParams.set('cursor', cursor);


  const response = await fetch(url, { headers: { Authorization: `Bearer ${process.env.LYNKED_API_KEY}` } });
  const page = await response.json();


  for (const customer of page.items) {
    // process the customer
  }
  cursor = page.next_cursor;
} while (cursor !== null);

A page can hold fewer than limit items even when more pages follow. Rely on next_cursor, not on the number of items, to know whether you are done.