Developers · API endpoints

Fleet operations

Apply a lifecycle event to many passports, or update many from matched rows, with per-row results.

Version
v1.0.0
Base URL
https://dppapi-production.up.railway.app/v1
Format
JSON · OpenAPI 3.1
FeedbackLast updated

Cet article n'est pas encore disponible en français ; il est affiché ci-dessous en anglais.

The same change across many passports — up to 1,000 per request — reported per row: 200 when every row succeeded, 207 when some did not. A recycled passport is skipped and named, never silently changed.

Personalise the samples. Paste a test key and every snippet uses it — and your own model and passport ids.

POST/v1/passports/bulk-lifecycle
write scope

Apply a lifecycle event to many passports

putInService sets the in-service date and records a PUT_INTO_SERVICE event (a date is required). waste sets status WASTE. recycle ends each passport, exactly like Mark as recycled.

Per-battery readings differ by definition, so they are not a bulk lifecycle event — send them with import updates or as events.

Request body3

  • passportIdsstring[], 1–1000required

    Passport ids.

  • event"putInService" | "waste" | "recycle"required

    What happened.

  • datedateoptional

    Required for putInService.

Headers2

  • Idempotency-Keystringheaderoptional

    Optional. A unique string per logical operation (a UUID is ideal). The first response is stored for 24 hours and replayed for retries; see Idempotency.

  • X-DPP-Dry-Run"true"headeroptional

    Optional, live keys. Validate the write in full and store nothing. Test keys always dry-run; see Test keys.

Responses

  • 200OK — Per-row results.

Errors4

POST /v1/passports/bulk-lifecycle
curl -X POST "https://dppapi-production.up.railway.app/v1/passports/bulk-lifecycle" \-H "Authorization: Bearer $DPP_API_KEY" \-H "Content-Type: application/json" \-H "Idempotency-Key: 7b3e0c52-1f7d-4b8a-9a52-2f0e6d1c9a44" \-d '{"passportIds": ["cm1q8y0bq0006l70fx9y8z7w6","cm1q8y0bq0008l70fa1b2c3d4"],"event": "putInService","date": "2027-03-01"}'
200 OK · Per-row results.
{"requested": 2,"applied": 2,"failed": 0,"results": [{ "id": "cm1q8y0bq0006l70fx9y8z7w6", "ok": true },{ "id": "cm1q8y0bq0008l70fa1b2c3d4", "ok": true }]}
POST/v1/passports/import-updates
write scope

Update many passports from matched rows

Each row is matched to an existing battery of the model by uniqueIdentifier or serialNumber and can set an in-service date, a status (waste or recycled) and readings. Readings are recorded as events of the type their field belongs to. A row that matches nothing changes nothing and is reported as not_found — this endpoint never creates batteries.

Send dryRun: true first to see how many rows match and how many of those are already published, without writing anything.

Request body3

  • modelIdstringrequired

    The model whose batteries are matched.

  • rowsarray, 1–1000required

    [{ uniqueIdentifier?, serialNumber?, putIntoServiceAt?, status?, readings? }]; readings maps field names to numbers or strings.

  • dryRunbooleanoptional

    Match and count only.

Headers2

  • Idempotency-Keystringheaderoptional

    Optional. A unique string per logical operation (a UUID is ideal). The first response is stored for 24 hours and replayed for retries; see Idempotency.

  • X-DPP-Dry-Run"true"headeroptional

    Optional, live keys. Validate the write in full and store nothing. Test keys always dry-run; see Test keys.

Responses

  • 200OK — Per-row results; changes names what was applied.

Errors4

POST /v1/passports/import-updates
curl -X POST "https://dppapi-production.up.railway.app/v1/passports/import-updates" \-H "Authorization: Bearer $DPP_API_KEY" \-H "Content-Type: application/json" \-d '{"modelId": "cm1q8x2k40003l70f9a8s7d6e","rows": [{"serialNumber": "C48-2027-0001","readings": {"cycleCount": 812,"remainingCapacity": 14.1}},{"serialNumber": "C48-2027-0002","status": "waste"}]}'
200 OK · Per-row results; changes names what was applied.
{"requested": 2,"updated": 2,"failed": 0,"results": [{ "key": "C48-2027-0001", "ok": true, "changes": ["cycleCount", "remainingCapacity"] },{ "key": "C48-2027-0002", "ok": true, "changes": ["status:waste"] }]}

Préférences en matière de cookies

Vous choisissez les cookies utilisés. Vous pouvez modifier votre choix à tout moment via « Paramètres des cookies » en bas de page. Politique de confidentialité

Nécessaires

Toujours actifs

Indispensables au fonctionnement du site : votre thème clair/sombre et ce choix de cookies sont enregistrés dans votre navigateur. Ils ne servent pas à vous suivre.

Analyse

Google Analytics 4 mesure l’utilisation des pages au moyen de statistiques, ce qui nous aide à améliorer le site. Si vous acceptez, il dépose des cookies et mesure votre visite en détail. Si vous refusez, il ne dépose aucun cookie, mais Google peut tout de même recevoir des données techniques, comme la page consultée, le type de navigateur et l’adresse IP.

_ga, _ga_* · jusqu’à 2 ans · Google