evcc (self-hosted) Db API

The db API from evcc (self-hosted) — 5 operation(s) for db.

Operations 5

GET /db/backup Download database backup #
POST /db/restore Restore database backup #
POST /db/reset Reset database #
DELETE /db/metrics/energy Delete energy metrics #
DELETE /db/metrics/tariffs Delete tariff metrics #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/evcc:evcc-db-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

evcc-db-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: evcc Db API
  description: smart charging. open source energy management.
  version: 0.2.0
  contact:
    url: https://github.com/evcc-io/evcc
servers:
- url: https://demo.evcc.io/api
tags:
- name: db
paths:
  /db/backup:
    get:
      operationId: downloadBackup
      summary: Download database backup
      description: Downloads the SQLite database as a backup file. Session users must supply the admin password in the X-Admin-Password header. API key holders via Bearer token are exempt.
      tags:
      - db
      security:
      - cookieAuth: []
      - bearerAuth: []
      parameters:
      - $ref: '#/components/parameters/adminPassword'
      responses:
        '200':
          description: SQLite database file
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '401':
          $ref: '#/components/responses/Unauthorized'
  /db/restore:
    post:
      operationId: restoreBackup
      summary: Restore database backup
      description: Restores the database from a previously downloaded backup file. Session users must supply the admin password in the X-Admin-Password header. API key holders via Bearer token are exempt. The instance restarts after a successful restore.
      tags:
      - db
      security:
      - cookieAuth: []
      - bearerAuth: []
      parameters:
      - $ref: '#/components/parameters/adminPassword'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
              - file
              properties:
                file:
                  type: string
                  format: binary
                  description: SQLite database backup file
      responses:
        '204':
          description: Restore successful, instance is restarting
        '400':
          description: Invalid file or missing fields
        '401':
          $ref: '#/components/responses/Unauthorized'
  /db/reset:
    post:
      operationId: resetDatabase
      summary: Reset database
      description: Selectively deletes sessions, settings and/or remote access data from the database. Session users must supply the admin password in the X-Admin-Password header. API key holders via Bearer token are exempt. The instance restarts after a successful reset.
      tags:
      - db
      security:
      - cookieAuth: []
      - bearerAuth: []
      parameters:
      - $ref: '#/components/parameters/adminPassword'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                sessions:
                  type: boolean
                  description: Delete all charging sessions
                settings:
                  type: boolean
                  description: Delete all settings, configs, and meters
                remote:
                  type: boolean
                  description: Delete remote access configuration and registered clients
      responses:
        '204':
          description: Reset successful, instance is restarting
        '401':
          $ref: '#/components/responses/Unauthorized'
  /db/metrics/energy:
    delete:
      operationId: deleteEnergyMetrics
      summary: Delete energy metrics
      description: Deletes recorded energy slots in the given time range, optionally narrowed by entity. Filter parameters match /history/energy, so the same request can be previewed there before deleting. Session users must supply the admin password in the X-Admin-Password header. API key holders via Bearer token are exempt.
      tags:
      - db
      security:
      - cookieAuth: []
      - bearerAuth: []
      parameters:
      - $ref: '#/components/parameters/adminPassword'
      - name: from
        in: query
        required: true
        description: Start time, inclusive (RFC3339)
        schema:
          type: string
          format: date-time
          example: '2026-07-01T00:00:00Z'
      - name: to
        in: query
        required: true
        description: End time, exclusive (RFC3339)
        schema:
          type: string
          format: date-time
          example: '2026-07-02T00:00:00Z'
      - name: group
        in: query
        description: Filter by entity group
        schema:
          type: string
          example: forecast
          enum:
          - forecast
          - battery
          - grid
          - pv
          - home
          - loadpoint
          - meter
          - consumer
          - temperature
      - name: name
        in: query
        description: Filter by entity name
        schema:
          type: string
          example: db:8
      - name: title
        in: query
        description: Filter by entity title
        schema:
          type: string
          example: Battery
      responses:
        '200':
          $ref: '#/components/responses/Deleted'
        '400':
          description: Invalid parameters or database offline
        '401':
          $ref: '#/components/responses/Unauthorized'
  /db/metrics/tariffs:
    delete:
      operationId: deleteTariffMetrics
      summary: Delete tariff metrics
      description: 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.
      tags:
      - db
      security:
      - cookieAuth: []
      - bearerAuth: []
      parameters:
      - $ref: '#/components/parameters/adminPassword'
      - name: from
        in: query
        required: true
        description: Start time, inclusive (RFC3339)
        schema:
          type: string
          format: date-time
          example: '2026-07-01T00:00:00Z'
      - name: to
        in: query
        required: true
        description: End time, exclusive (RFC3339)
        schema:
          type: string
          format: date-time
          example: '2026-07-02T00:00:00Z'
      - name: usage
        in: query
        description: Limit deletion to a single tariff usage
        schema:
          type: string
          example: co2
          enum:
          - grid
          - feedin
          - co2
          - temperature
      responses:
        '200':
          $ref: '#/components/responses/Deleted'
        '400':
          description: Invalid parameters or database offline
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    Password:
      description: Admin password
      type: string
  responses:
    Deleted:
      description: Success - number of deleted records
      content:
        application/json:
          schema:
            type: object
            properties:
              deleted:
                type: integer
                example: 96
    Unauthorized:
      description: Unauthorized - Login and try again
      content:
        text/plain:
          schema:
            type: string
            enum:
            - Unauthorized
  parameters:
    adminPassword:
      name: X-Admin-Password
      in: header
      description: Admin password (required for session auth, not needed for API key)
      schema:
        $ref: '#/components/schemas/Password'
  securitySchemes:
    cookieAuth:
      type: apiKey
      in: cookie
      name: auth
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Long-lived API key (prefixed `evcc_`, managed via /auth/apikey).

        Grants access to /api/db/* without requiring the X-Admin-Password header.

        '