Skip to content
Catalog

Units (individual batteries) of the active organisation

Scope: readSee also:Authentication ·Errors ·Pagination ·Rate limits
GET
/batteries

Any member. Ordered by serial number, then id; filter by model, version, passport status, serial number prefix or the import that created the units.

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.

Query Parameters

limit?integer

Maximum number of items to return.

Range1 <= value <= 200
Default50
cursor?string

Opaque cursor from a previous page's next_cursor.

Length1 <= length <= 512
battery_model_id?string
Formatuuid
model_version_id?string
Formatuuid
passport_status?string

Status of a unit's passport (docs/domain-model.md §7).

Value in"draft""qr_locked""published""update_needed""suspended""withdrawn""deleted_recycled"
serial_prefix?string
Length1 <= length <= 50
import_id?string
Formatuuid

Response Body

One page of units.

application/json
  1. response
items*array<>
next_cursor*|

Cursor for the next page, or null when this is the last page.

Example Request
curl -X GET 'https://example.com/api/v1/batteries'
Example Response
{  "items": [    {      "battery_model_id": "6a002912-62a3-4058-99d0-53cbf87e9e1c",      "battery_status": "original",      "created_at": "2019-08-24T14:15:22Z",      "facility_id": "82d24387-b696-4928-8926-f6f7f16d3353",      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "identifiers_locked_at": "2019-08-24T14:15:22Z",      "import_id": "13230382-dadc-41f2-963d-e123bd5c0585",      "manufacturing_date": "2019-08-24",      "model_version_id": "337b5de9-de8e-4f60-90b9-4857763aa5cd",      "passport_status": "draft",      "predecessor_battery_id": "2d846581-4798-4b11-872b-c08d9dbbd2f8",      "putting_into_service": "2019-08-24",      "row_version": 1,      "serial_number": "string",      "successor_battery_ids": [        "5baa088d-7bb3-4e66-8627-37644733d9aa"      ],      "updated_at": "2019-08-24T14:15:22Z"    }  ],  "next_cursor": "string"}