Skip to main content

Before you begin

You need your OAuth client ID and client secret. The API base URL is https://api.kapa.energy.

Get an access token

Set KAPA_CLIENT_ID and KAPA_CLIENT_SECRET in your environment, then send a client credentials request:
The response includes access_token, token_type, and expires_in. Set KAPA_ACCESS_TOKEN to the returned access token. Request a new token when it expires.

Authenticate requests

Send Authorization: Bearer <access_token> with every request except POST /token. Use the token to read battery information.

Errors

Token requests return OAuth errors as JSON. A 400 response indicates an invalid token request, such as an unsupported grant type. A 401 response with invalid_client indicates an unknown client or an incorrect secret. Other API endpoints return 401 with the Problem Details code unauthorized when your token is missing, invalid, or expired. Request a new token when it expires.