Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.reachedapp.com/llms.txt

Use this file to discover all available pages before exploring further.

Pagination

All list endpoints return paginated results. Use the page and per_page query parameters to control pagination.

Query Parameters

ParameterTypeDefaultDescription
pageinteger1Page number (starts at 1)
per_pageinteger25Number of results per page (max 100)

Response Format

Every paginated response includes a meta object with pagination information:
{
  "data": [...],
  "meta": {
    "page": 1,
    "per_page": 25,
    "total": 142
  }
}
FieldTypeDescription
meta.pageintegerCurrent page number
meta.per_pageintegerNumber of items per page
meta.totalintegerTotal number of matching records

Example

Fetch the second page of leads with 10 results per page:
curl -X GET \
  "https://api.reachedapp.com/v1/leads?page=2&per_page=10" \
  -H "Authorization: Bearer rchd_live_xxxxxxxxxxxx"

Iterating Through All Pages

async function fetchAllLeads(apiKey) {
  const baseUrl = "https://api.reachedapp.com/v1/leads";
  const allLeads = [];
  let page = 1;
  let hasMore = true;

  while (hasMore) {
    const response = await fetch(`${baseUrl}?page=${page}&per_page=100`, {
      headers: { "Authorization": `Bearer ${apiKey}` }
    });
    const { data, meta } = await response.json();
    allLeads.push(...data);
    hasMore = page * meta.per_page < meta.total;
    page++;
  }

  return allLeads;
}
To minimize the number of requests, use per_page=100 (the maximum) when fetching all records.