TracePass
Passports

List measurement history

Returns the full measurement history for a battery passport, newest first (by `measuredAt`). Each entry is a `PassportMeasurement` object with `_id`, `passportId`, `fieldKey`, `value`, `measuredAt`, `receivedAt`, `externalId?`, `unit?`, `materialized` (whether this entry became the passport's current value), and `source`. **Battery passports only** — a non-battery passport returns 422 `not_a_battery`.

GET/api/v1/passports/{id}/measurements
Download OpenAPI 3.1
GET/api/v1/passports/{id}/measurements

List measurement history

Returns the full measurement history for a battery passport, newest first (by `measuredAt`). Each entry is a `PassportMeasurement` object with `_id`, `passportId`, `fieldKey`, `value`, `measuredAt`, `receivedAt`, `externalId?`, `unit?`, `materialized` (whether this entry became the passport's current value), and `source`. **Battery passports only** — a non-battery passport returns 422 `not_a_battery`.

Filter with `?fieldKey=<key>` to restrict to one field, `?from=<ISO 8601>` and `?to=<ISO 8601>` to constrain the `measuredAt` window. Page size is controlled by `?limit` (1–200, default 50). Paginate with `?cursor=<nextCursor>` — pass the `nextCursor` value from the previous page's response exactly as returned; it is opaque and its internal format must not be relied upon. The response carries `hasMore: true` and a non-null `nextCursor` when additional results exist; `hasMore: false` means you have reached the last page.

An alternate addressing form exists at `GET /api/v1/passports/by-serial/{serial}/measurements` with the same query parameters and response shape. If a serial is not unique within your account, add `?gtin=<gtin>` to disambiguate. Read-only; OAuth scope: `passports:read`.

Path parameters

  • idrequired

    ObjectId

    Passport ID.

Query parameters

  • fieldKey

    string

    Filter to a single field key (e.g. `stateOfHealth`).

  • from

    string (ISO 8601)

    Return measurements with `measuredAt` ≥ this value.

    e.g. 2027-01-01T00:00:00Z

  • to

    string (ISO 8601)

    Return measurements with `measuredAt` ≤ this value.

    e.g. 2027-03-31T23:59:59Z

  • limit

    integer

    Page size (1–200, default 50).

  • cursor

    string

    The `nextCursor` value from the previous page's response. Opaque — pass it as-is; do not parse or construct it.

Headers

  • Authorizationrequired

    string

    `Bearer <token>` — either a `tp_` API key (Developer → API Keys; simplest, for server-to-server) or an OAuth 2.0 access token (Developer → OAuth Apps; for user-authorized apps, scoped + revocable). The Authentication page has the full OAuth flow and scope list.

    e.g. Bearer tp_REDACTED_xxxxxxxxxxxx

Request

curl -sS \
  "https://app.tracepass.eu/api/v1/passports/6650b2c3d4e5f6a7b8c9d0e1/measurements?fieldKey=stateOfHealth&limit=50" \
  -H "Authorization: Bearer tp_REDACTED_xxxxxxxxxxxx"

Response

{
  "data": [
    {
      "_id": "6750a1b2c3d4e5f6a7b8c9d0",
      "passportId": "6650b2c3d4e5f6a7b8c9d0e1",
      "fieldKey": "stateOfHealth",
      "value": 96.4,
      "measuredAt": "2027-03-01T06:00:00Z",
      "receivedAt": "2027-03-01T06:01:12Z",
      "externalId": "bms-7781-2027-03-01",
      "materialized": true,
      "source": "api:tp_abc123"
    },
    {
      "_id": "6740a1b2c3d4e5f6a7b8c9d0",
      "passportId": "6650b2c3d4e5f6a7b8c9d0e1",
      "fieldKey": "stateOfHealth",
      "value": 97.1,
      "measuredAt": "2027-02-01T06:00:00Z",
      "receivedAt": "2027-02-01T06:00:55Z",
      "materialized": false,
      "source": "api:tp_abc123"
    }
  ],
  "hasMore": false,
  "nextCursor": null
}