Pagination & filtering
List endpoints return one page at a time. Record lists also support filters, tags, free-text search and sorting.
Cursor pagination
curl "https://crm.codefab.dev/api/v1/objects/contact/records?limit=100" \-H "X-API-Key: $CRM_API_KEY"
Pass nextCursor back as cursor to get the next page. When nextCursor is null, you have reached the end. limit is 50 by default and at most 200.
async function* allContacts() {let cursordo {const url = new URL('https://crm.codefab.dev/api/v1/objects/contact/records')url.searchParams.set('limit', '200')if (cursor) url.searchParams.set('cursor', cursor)const page = await fetch(url, { headers: { 'X-API-Key': process.env.CRM_API_KEY } }).then((r) => r.json())yield* page.itemscursor = page.nextCursor} while (cursor)}
Cursors are opaque. Don't build or change them yourself.
Follow-ups page the same way: GET /api/v1/followups/page?scope=all&limit=100, oldest due first. Its response also has totals: how many follow-ups match in all, split into overdue, today, this week, later and done.
Filtering records
Add one or more filter parameters in the form field:operator:value. Filters are combined with AND.
curl -G "https://crm.codefab.dev/api/v1/objects/contact/records" \-H "X-API-Key: $CRM_API_KEY" \--data-urlencode "filter=locale:eq:sv" \--data-urlencode "filter=email:contains:@example.com"
| Operator | Meaning | Example |
|---|---|---|
eq / neq | Equals / not equals | locale:eq:sv |
contains | Contains text (case-insensitive) | email:contains:@example.com |
gt, gte, lt, lte | Greater / less than (numbers, dates) | total:gte:1000 |
exists | The field has a value | phone:exists |
within_days | Date within the last N days | last_order_at:within_days:30 |
before_days | Date more than N days ago | last_order_at:before_days:180 |
More options:
tag=vip: only records with the tag (repeat for several).q=anna: free-text search across the record.sort=field:ascorsort=field:desc: sort by a field, or bycreated_at. Newest first by default.
Complex conditions
For OR groups, relations ("contacts with an order over 1 000 SEK") and event conditions, create a segment and list its members. Segments use the full condition model and stay up to date.