Skip to content
EN | DE

Generate or rotate the API key

POST
/auth/apikey
curl --request POST \
--url https://demo.evcc.io/api/auth/apikey \
--header 'Content-Type: application/json' \
--cookie auth=<auth> \
--data '{ "password": "example" }'

Generates a fresh API key, replacing any existing one. The returned key is shown only once; store it immediately.

Even when the request is authenticated via API key (Bearer), the admin password must be supplied in the request body to prevent a leaked key from rotating itself. The password check is skipped when the server is started with --disable-auth.

Media typeapplication/json
object
password

Admin password

string
Examplegenerated
{
"password": "example"
}

Success

Media typeapplication/json
object
key

The new API key (cleartext, shown once).

string
Example
{
"key": "evcc_aB3xYz7k0Pq2sN5mWtR4"
}

Invalid admin password

Forbidden in demo mode