Skip to content
Lifecycle

Report measured condition data (merge)

Scope: conditionSee also:Authentication ·Errors ·Pagination ·Rate limits
PATCH
/batteries/{batteryId}/condition

Editor and above, or an API key with the condition scope (source api, ADR-016, ADR-017). Merge semantics: only the named fields change, null clears a field. Each value has a measured_at (its own or the request's), which must not lie in the future or before the manufacturing date. Fields that are not dynamic fields of the unit are refused (unknown_field); so is the whole update when a value is invalid or the merged condition data fails a cross-field check. A value older than the stored one, or equal to it, is skipped and listed. Accepted values are stored as approved measurements and recorded as a condition_update lifecycle event; a published passport is re-published as the organisation's condition_republish setting says (immediately in this request, or by the daily job).

Authorization

apiKey
headerAuthorizationBearer <token>

Organisation API key sent as Authorization: Bearer bp_live_… (ADR-017). Accepted only by the operations that list this scheme, with the scope in their x-api-key-scope.

Path Parameters

batteryId*string
Formatuuid

Request Body

application/json
  1. body
measured_at?string

The measurement time of values without their own.

Formatdate-time
note?string

Becomes the description of the lifecycle event.

Lengthlength <= 500
values*array<>
Items1 <= items <= 50

Response Body

What was accepted, what was skipped, and the publication.

application/json
  1. response
accepted*array<>
event?
publication*
skipped*array<>
Example Request
curl -X PATCH 'https://example.com/api/v1/batteries/497f6eca-6276-4993-bfeb-53cbbbba6f08/condition' \  -H 'Content-Type: application/json' \  -d '{  "values": [    {      "field_key": "string",      "value": null    }  ]}'
Example Response
{  "accepted": [    {      "checks": [        {          "check_key": "string",          "message": {            "de": "string",            "en": "string"          },          "result": "pass"        }      ],      "evidence": [        {          "access_tier": "public",          "filename": "string",          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",          "kind": "declaration_of_conformity",          "revision": 1,          "superseded": true,          "title": "string"        }      ],      "field_key": "string",      "measured_at": "2019-08-24T14:15:22Z",      "recorded_at": "2019-08-24T14:15:22Z",      "recorded_by": {        "display_name": "string",        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"      },      "registry_version": "string",      "responsible": {        "display_name": "string",        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"      },      "review_note": "string",      "review_status": "captured",      "reviewed_at": "2019-08-24T14:15:22Z",      "reviewed_by": {        "display_name": "string",        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"      },      "revision": 1,      "source": "manual",      "superseded_at": "2019-08-24T14:15:22Z",      "unit": "string",      "value": null    }  ],  "event": {    "api_key": {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "name": "string"    },    "battery_id": "bf9efcd2-a647-473f-b459-71d521ebe1ad",    "created_at": "2019-08-24T14:15:22Z",    "description": "string",    "evidence": [      {        "access_tier": "public",        "filename": "string",        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",        "kind": "declaration_of_conformity",        "revision": 1,        "superseded": true,        "title": "string"      }    ],    "field_keys": [      "string"    ],    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "occurred_on": "2019-08-24",    "partner": {      "email": "user@example.com",      "name": "string",      "request_id": "266ea41d-adf5-480b-af50-15b940c2b846"    },    "related_battery_id": "1ce5ea42-7c27-4051-b607-ecc81b42bedf",    "related_serial_number": "string",    "reported_by": {      "display_name": "string",      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"    },    "source": "manual",    "type": "placed_on_market"  },  "publication": {    "blockers": [      {        "check_key": "string",        "code": "organization_identifier_missing",        "field_key": "string",        "target": {          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",          "type": "model_version"        }      }    ],    "outcome": "published",    "version": {      "batterypass_v2_issue_count": 0,      "batterypass_v2_valid": true,      "canonical_hash": "string",      "key_id": "string",      "public_hash": "string",      "published_at": "2019-08-24T14:15:22Z",      "published_by": "9ac9eee7-2153-423d-b22d-04e12679154a",      "published_by_name": "string",      "reason": "string",      "registry_version": "string",      "valid_until": "2019-08-24T14:15:22Z",      "version_no": 1    }  },  "skipped": [    {      "field_key": "string",      "reason": "older_measurement"    }  ]}