Cet article n'est pas encore disponible en français ; il est affiché ci-dessous en anglais.
On this pageParameters and envelope
List endpoints return one page at a time with an opaque cursor to the next. Cursors stay correct while records are being added, which offsets cannot promise.
Parameters and envelope
| Parameter | Meaning |
|---|---|
limit | Page size, 1–200. Default 50. |
cursor | The next_cursor from the previous page. Omit for the first page. |
Every list response
{"data": [ { "id": "…" } ],"has_more": true,"next_cursor": "eyJpZCI6ImNtMXE4eTBicTAwMDZsNzBmeDl5OHo3dzYifQ"}- Stop when
has_moreisfalse;next_cursoris thennull. - Treat the cursor as opaque: do not build, decode or modify it.
- Keep the same filters on every page of one walk; change filters, start again without a cursor.
- Lists are newest first, and the cursor marks the position of the last row. Records created during a walk land before your starting point, so a walk never skips or repeats a row — pick them up on the next incremental run.
Paginated endpoints
| Endpoint | Filters |
|---|---|
| `GET /models` | category, updated_since, complete |
| `GET /passports` | model_id, serial, unique_identifier, status, published, updated_since, created_since |
| `GET /passports/{id}/events` | since, event_type |
| `GET /documents` | model_id, type |
| `GET /audit` | entity, entity_id, since |
| `GET /webhooks/{id}/deliveries` | status |
GET /models/{id}/items predates cursors and pages by number (page, pageSize); for syncing batteries use GET /passports?model_id= instead.
The first page
curl "https://dppapi-production.up.railway.app/v1/passports?model_id=cm1q8x2k40003l70f9a8s7d6e&limit=200" \-H "Authorization: Bearer $DPP_API_KEY"Complete loops
Each of these walks every page and stops on its own:
// Node.js 18+. An async iterator over every passport, page by page.const BASE = 'https://dppapi-production.up.railway.app/v1';async function* passports(filters = {}) {let cursor;do {const qs = new URLSearchParams({ ...filters, limit: '200', ...(cursor && { cursor }) });const res = await fetch(`${BASE}/passports?${qs}`, {headers: { Authorization: `Bearer ${process.env.DPP_API_KEY}` },});if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);const page = await res.json();yield* page.data;cursor = page.has_more ? page.next_cursor : undefined;} while (cursor);}for await (const passport of passports({ model_id: 'cm1q8x2k40003l70f9a8s7d6e' })) {console.log(passport.id, passport.status);}To keep a copy up to date after the first walk, see incremental sync.