Restore database backup
POST
/db/restore
const url = 'https://demo.evcc.io/api/db/restore';const form = new FormData();form.append('file', 'file');
const options = {method: 'POST', headers: {cookie: 'auth=<auth>'}};
options.body = form;
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://demo.evcc.io/api/db/restore \ --header 'Content-Type: multipart/form-data' \ --cookie auth=<auth> \ --form file=@fileRestores 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.
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)
Request Bodyrequired
Section titled “Request Bodyrequired”Media typemultipart/form-data
object
file
required
SQLite database backup file
string format: binary
Responses
Section titled “Responses”Restore successful, instance is restarting
Invalid file or missing fields
Unauthorized - Login and try again
Media typetext/plain
string