Developer API

Lists and limits

How v2 list operations limit their results, and how to read every record you need.

Limits

Send limit between 1 and 100; a larger value is capped at 100 and a missing or invalid value uses the endpoint default (50 for most lists, 100 for document versions, logs and portals). Every list returns an items array. GET /api/v2/documents, GET /api/v2/secure-links, GET /api/v2/secure-links/{linkId}/sessions and GET /api/v2/rooms also return nextCursor: pass it back as the cursor query parameter to read the next page, and stop when it is null. The other lists return no cursor: one response is the complete answer for that limit, so narrow the request with the documented filters (for example endpointId on webhook deliveries or accountId on connector operations) instead of paging.

Filters

OperationQuery parameterEffect
GET /api/v2/documentsq, cursorDocuments whose title or ID contains q (ignoring case); cursor continues from nextCursor
GET /api/v2/secure-linksdocumentId, status, cursorOnly links for that document or in that status; cursor continues from nextCursor
GET /api/v2/webhook-deliveriesendpointIdOnly deliveries for that endpoint
GET /api/v2/connector-operationsaccountIdOnly operations for that connector account
GET /api/v2/documents/{documentId}/analyticsversionIdOnly engagement with that version
GET /api/v2/usagefrom, toAn RFC 3339 range of at most 366 days (default: the last month)

List example

A complete Node.js 20+ ES module (save it as list-documents.mjs). It reads the key from the environment and prints every document ID with its version IDs.

REST lists (Node.js)
const apiKey = process.env.WELLFRIEND_API_KEY;
if (!apiKey) throw new Error("Set WELLFRIEND_API_KEY.");

async function get(path) {
  const response = await fetch(new URL(path, "https://wellfriend.dev"), {
    headers: { Authorization: `Bearer ${apiKey}` },
    signal: AbortSignal.timeout(30_000),
  });
  if (!response.ok) throw new Error(`${path} failed: ${response.status} ${await response.text()}`);
  return response.json();
}

const documents = await get("/api/v2/documents?limit=100");
for (const document of documents.items) {
  const versions = await get(`/api/v2/documents/${encodeURIComponent(document.id)}/versions?limit=100`);
  console.log(document.id, versions.items.map((version) => version.id).join(","));
}

Consistency

  • Records can be added or changed while you read; each list response is a snapshot.
  • Deduplicate by ID when you combine several responses.
  • To get one resource's current state, read it by ID (for example GET /api/v2/documents/{documentId}) instead of scanning a list.
  • Store the IDs you create; do not rely on lists to find them again.