Delete tariff metrics
DELETE
/db/metrics/tariffs
const url = 'https://demo.evcc.io/api/db/metrics/tariffs?from=2026-07-01T00%3A00%3A00Z&to=2026-07-02T00%3A00%3A00Z&usage=grid';const options = {method: 'DELETE', headers: {cookie: 'auth=<auth>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request DELETE \ --url 'https://demo.evcc.io/api/db/metrics/tariffs?from=2026-07-01T00%3A00%3A00Z&to=2026-07-02T00%3A00%3A00Z&usage=grid' \ --cookie auth=<auth>Deletes recorded tariff values in the given time range. Without usage the entire record is removed, otherwise only that usage is cleared and records left without any value are removed. Session users must supply the admin password in the X-Admin-Password header. API key holders via Bearer token are exempt.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”X-Admin-Password
Admin password
string
Admin password (required for session auth, not needed for API key)
Query Parameters
Section titled “Query Parameters”from
required
string format: date-time
Example
2026-07-01T00:00:00ZStart time, inclusive (RFC3339)
to
required
string format: date-time
Example
2026-07-02T00:00:00ZEnd time, exclusive (RFC3339)
usage
string
Example
co2Limit deletion to a single tariff usage
Responses
Section titled “Responses”Success - number of deleted records
Media typeapplication/json
object
deleted
integer
Example
{ "deleted": 96}Invalid parameters or database offline
Unauthorized - Login and try again
Media typetext/plain
string