Developers · API endpoints

Audit trail

Read the organisation’s audit trail: who changed what, when, and through which key.

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

Este artículo aún no está disponible en español; se muestra a continuación en inglés.

Every change to a model, battery, passport, document or registration is written to an audit trail with a hash of the record before and after. This is the "who, when, from which source" record (Art. 78(g)), readable over the API.

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

GET/v1/audit
read scope

List audit entries

Audit entries for your organisation, newest first, a page at a time. Each holds the SHA-256 of the record before and after the change, so you can prove what a record looked like. Changes made over the API are attributed to the member who created the key.

Parameters5

  • limitintegerqueryoptional

    Page size, 1–200. Default 50.

  • cursorstringqueryoptional

    The next_cursor of the previous page. Omit for the first page.

  • entitystringqueryoptional

    Only this entity type, e.g. BatteryPassport, BatteryModel, BatteryItem, Document, ApiKey, WebhookEndpoint.

  • entity_idstringqueryoptional

    One record’s history.

  • sinceISO 8601 date-timequeryoptional

    Only entries at or after this instant.

Responses

  • 200OK — A page of audit entries.

Errors2

Response fields · 200

object
  • has_morebooleanrequired
  • next_cursorstring | nullrequired

    Pass as cursor to get the next page.

GET /v1/audit
curl "https://dppapi-production.up.railway.app/v1/audit?entity=BatteryPassport&since=2027-01-01T00%3A00%3A00Z" \-H "Authorization: Bearer $DPP_API_KEY"
200 OK · A page of audit entries.
{"data": [{"id": "cm1qe0a1b0050l70fq1w2e3r4","entity": "BatteryPassport","entityId": "cm1q8y0bq0006l70fx9y8z7w6","action": "publish","beforeHash": "1b4f0a9c2e7d5b8361f4a0c9e2d7b5a8361f4a0c9e2d7b5a8361f4a0c9e2d7b5a","afterHash": "7c9e3b1d5f2a8460e7c9b3d1f5a2e8460c7e9b3d1f5a2e8460c7e9b3d1f5a2e84","at": "2027-01-15T10:02:11.000Z"}],"has_more": true,"next_cursor": "eyJpZCI6ImNtMXE4eTBicTAwMDZsNzBmeDl5OHo3dzYifQ"}

Preferencias de cookies

Tú decides qué cookies se usan. Puedes cambiar tu elección en cualquier momento desde «Configuración de cookies» en el pie de página. Política de privacidad

Necesarias

Siempre activas

Imprescindibles para que el sitio funcione: tu tema claro/oscuro y esta elección de cookies se guardan en tu navegador. No sirven para rastrearte.

Analítica

Google Analytics 4 mide cómo se usan las páginas mediante estadísticas, lo que nos ayuda a mejorar el sitio. Si aceptas, instala cookies y mide tu visita por completo. Si rechazas, no instala cookies, pero Google aún puede recibir datos técnicos como la página vista, el tipo de navegador y la dirección IP.

_ga, _ga_* · hasta 2 años · Google