This reference documents version
1.0.0-draft.1 of the API.Conventions
Time
- Timestamps are RFC 3339, in UTC, with a
Zsuffix:2026-11-12T18:00:00Z. - Durations are ISO 8601:
PT15M. - Time windows are half-open,
[start, end):startis included,endis excluded.
Power
Power is in watts (W), as integers.- Positive (+): the battery is discharging, or the site is exporting to the grid.
- Negative (−): the battery is charging, or the site is importing from the grid.
nominal_charge_power_w are magnitudes and are always positive.
Energy
Energy is in watt-hours (Wh), as integers. Battery levels are expressed as stored energy in Wh rather than state of charge in %, because the meaning of SoC differs between manufacturers. Stored energy is measured against the usable capacity: it ranges from 0 tousable_capacity_wh.
Telemetry
- Each data point carries two times:
measured_at, when the device took the measurement, andreceived_at, when Kapa retrieved it from the manufacturer’s cloud. - Data points are never interpolated or resampled. Each point is an actual
measurement reported by the manufacturer. Units, signs and field names are
standardised across manufacturers; a field the manufacturer does not report is
null.
Commands
- Commands are asynchronous. Command endpoints return
202 Acceptedwith a command whosestatusthen evolves. Follow it withGET /bat/v1/{id}/commandsor thecommand.status_changedwebhook. - A
startin the past is treated as the time Kapa accepts the command. - Overlaps: when a new command overlaps existing commands on the same battery,
the newest command takes precedence over the overlapping period. Older commands
stay in effect outside it. A command whose whole window is covered by newer
commands becomes
superseded. - Outside any command window, the battery follows its default behaviour: the mode its owner configured in the manufacturer’s app.
Idempotency
Command and batch endpoints accept an optionalIdempotency-Key header. Kapa stores
the key with the response for 24 hours. A retry with the same key and the same body
returns the original response without sending anything again.
Errors
Errors use RFC 9457 Problem Details (application/problem+json). The code field is
stable and meant for programs; title and detail are meant for humans.
Webhooks
Kapa pushes telemetry and command status changes to an HTTPS endpoint. Delivery is at least once and not ordered: deduplicate withevent_id, and order data with
measured_at or updated_at. Webhook registration is not covered by this version
of the API.