ServerAvatarDocs
API Reference

Databases API

Database engines and connections, databases and their users, exports, imports, per-database backups and one-click Adminer and phpMyAdmin sign-in through the OSS Panel API.

These endpoints are the API behind Databases in the panel's sidebar: the engines installed on the server, the databases inside them, the users that can reach each database, and the export, import and backup tools.

All paths are relative to https://<your-panel-host>/api. Read Authentication first. The examples use:

PANEL=https://panel.example.com
TOKEN='1|xcMq8K3vZ2pL…'

Permissions and availability

Every endpoint needs the database permission (Databases in Roles). Reads need view; every endpoint marked manage below needs manage, which implies view.

Only a server that manages its own databases serves these routes. Where the panel does not manage databases on this server, every call answers 409 with "This server's databases are not managed by this panel." (the text follows Accept-Language).

Endpoint index

MethodPathPermissionPurpose
GET/databases/enginesviewEngines and what each can do.
POST/databases/engines/{engine}manageInstall an engine.
GET/databases/connectionsviewHow the panel reaches each engine.
PUT/databases/connections/{engine}manageChange a connection.
PUT/databases/connections/{engine}/root-passwordmanageSet or change the MySQL or MariaDB root password.
POST/databases/connections/{engine}/testmanageTest the connection.
GET/databasesviewList databases.
POST/databasesmanageCreate a database.
GET/databases/untrackedviewDatabases on the engine the panel does not know.
POST/databases/adoptmanageStart tracking untracked databases.
GET/databases/{database}viewOne database.
DELETE/databases/{database}manageDelete.
PUT/databases/{database}/applicationmanageAttach to or detach from an application.
GET/databases/{database}/tablesviewTables.
GET, POST/databases/{database}/usersview / manageList or add users.
PATCH, DELETE/databases/{database}/users/{user}manageChange or delete a user.
PUT/databases/{database}/users/{user}/passwordmanageSet a user's password.
POST/databases/{database}/exportmanageStart an export.
GET/databases/exportsviewExports.
GET/databases/exports/{file}manageDownload an export file.
DELETE/databases/exports/{export}manageDelete an export.
GET, POST/databases/{database}/importsview / manageList or begin an import.
PUT/databases/{database}/imports/{import}/chunkmanageUpload a piece.
POST/databases/{database}/imports/{import}/startmanageRun the import.
DELETE/databases/{database}/imports/{import}manageCancel or remove.
GET, PUT, DELETE/databases/{database}/backup-targetview / manageThe database's backup plan.
GET, POST/databases/{database}/backupsview / manageList backups, back up now.
GET/databases/{database}/backups/{backup}/downloadmanageDownload a backup file.
DELETE/databases/{database}/backups/{backup}manageDelete a backup.
POST/databases/{database}/backups/{backup}/restoremanageRestore.
GET/databases/status/{engine}viewLive engine status.
GET/databases/processesviewRunning queries.
DELETE/databases/processes/{id}manageStop one.
GET/databases/metrics/historyviewRecent engine metrics.
POST/databases/{database}/adminer-ssomanageOne-click Adminer sign-in.
POST/databases/{database}/phpmyadmin-ssomanageOne-click phpMyAdmin sign-in.

{engine} is mysql, mariadb, mongodb or postgresql. {database} and {user} are numeric ids. A {database}, user, import or backup that is not the one in the URL's parent answers 404.

A few have their own per-minute limits: 5 for the root password; 6 for export, import start, back up now and backup download; 2 for backup restore; 12 for deleting a backup or a backup plan; 20 for beginning an import, deleting an import and saving a backup plan; 1200 for an import chunk. The status endpoint uses the progress budget so it can be polled.

Engines and connections

GET /databases/engines

Returns {"engines": { … }}: for each engine whether it is installed, reachable and installable. POST /databases/engines/{engine} installs one and answers 202 with {"queued": true}. If the engine is already installed and reachable it answers 200 with {"engines": { … }, "queued": false}. A second install while one runs is 409 (reason: install_in_progress). An engine the panel cannot install here (MongoDB has no installer) answers 422 with the reason.

GET /databases/connections

Returns {"connections": { … }}, one entry per engine: engine, driver, connection_type (tcp or socket), host, port, socket, username, has_password, has_root_password, options. Passwords are never returned.

PUT /databases/connections/{engine}

Changes how the panel reaches the engine.

FieldRules
connection_typeRequired: tcp or socket.
host, portRequired for tcp. port is 1 to 65535.
socketRequired for socket; up to 255 characters.
username, passwordOptional, up to 255 characters.
optionsOptional object.
root_passwordOptional, up to 128 characters, no control characters.
testOptional boolean: test before saving.

Returns {"<engine>": { … }}: the connection as saved. An unknown engine is 404.

PUT /databases/connections/{engine}/root-password

MySQL and MariaDB only (404 for the others). 5 per minute.

FieldRules
passwordRequired, 12 to 128 characters, no control characters.
password_confirmationRequired: must equal password.
current_passwordOptional, up to 128 characters: the current root password, when the panel does not already hold it.

Returns {"<engine>": { … }}.

POST /databases/connections/{engine}/test

Returns {"reachable": true|false}.

Databases

GET /databases

QueryRules
searchUp to 255 characters.
filter[engine]One of the engines the server knows.
filter[application_id]An application id.
filter[attached]true for databases attached to an application, false for the others.
sortcreated_at, name, engine, users_count or size_bytes; - for descending.
per_pageOne of 10, 20, 30, 50, 100.
curl "$PANEL/api/databases?filter[engine]=mariadb&sort=name" \
  -H "Authorization: Bearer $TOKEN" -H 'Accept: application/json'
{
  "databases": [
    {
      "id": 4,
      "name": "shop_db",
      "engine": "mariadb",
      "charset": "utf8mb4",
      "collation": "utf8mb4_unicode_ci",
      "application_id": 12,
      "application_name": "shop",
      "size_bytes": 3145728,
      "size_human": "3 MB",
      "users_count": 1,
      "created_at": "02-11-2026 09:14:03"
    }
  ],
  "meta": { "current_page": 1, "per_page": 10, "total": 1, "last_page": 1 }
}

POST /databases

Answers 201 with {"database": { … }}.

FieldRules
nameRequired, letters, digits and _, 1 to 63 characters, not a system schema, unique within the engine.
engineRequired, an engine from the engines list.
charset, collationOptional, from what the engine offers.
application_idOptional, an existing application to attach it to.
create_userOptional object to create a user at the same time (below).

create_user:

FieldRules
usernameRequired with create_user: letters, digits, _, 1 to 32 characters; not a system user and not starting with pg_.
passwordOptional, 8 to 255 characters; the panel generates one when left out.
connection_preferencelocalhost, remote or anywhere, if the engine supports remote users.
hostRequired for remote: the address allowed to connect.
restart_clusterOptional boolean, for engines that need a restart to listen on a new address.

GET /databases/{database}

Returns {"database": { … }} with the same fields as the list, plus users and size_reason (why a size is missing, when it is).

DELETE /databases/{database}

Answers 204.

PUT /databases/{database}/application

Body {"application_id": 12}, or null to detach. The key must be present. Returns {"database": { … }}.

GET /databases/{database}/tables

Returns {"tables": [ … ]}. 503 with reason: engine_unreachable when the engine does not answer.

GET /databases/untracked and POST /databases/adopt

GET /databases/untracked?engine=mariadb returns {"untracked": [ "name", … ]}: databases that exist on the engine but not in the panel. POST /databases/adopt with engine and names (a non-empty array of names, each 1 to 63 letters, digits or _) starts tracking them and answers 201 with {"databases": [ … ]}.

Database users

GET /databases/{database}/users

Returns {"users": [ … ]}. Each user has id, username, connection_preference, host, password_known and timestamps. The plaintext password and the ready-made connection_string are returned only to callers with manage; everyone else gets null for those two.

POST /databases/{database}/users

Answers 201 with {"user": { … }}.

FieldRules
usernameRequired: letters, digits, _, 1 to 32 characters; not a system user; not starting with pg_.
passwordOptional, 8 to 255 characters; the panel generates one when left out.
connection_preferenceRequired: localhost, remote or anywhere. remote and anywhere are refused for an engine that does not support remote users.
hostRequired for remote.
restart_clusterOptional boolean.

PATCH /databases/{database}/users/{user}

Any of username, connection_preference, host, restart_cluster, password (same rules as above, password 8 to 255). Returns {"user": { … }}.

PUT /databases/{database}/users/{user}/password

Body {"password": "…"}, 8 to 255 characters. Returns {"user": { … }}.

DELETE /databases/{database}/users/{user}

Answers 204.

Export

POST /databases/{database}/export

Starts a gzipped export in the background, 6 per minute. Answers 202 with {"export": { … }}. A second export while one runs, or an export while an import, restore or backup of the same database is running, answers 422 on database.

An export has id, status (queued, running, completed or failed), file, size_bytes, available, download_url, and reason, message and reference when it failed.

GET /databases/exports

Returns {"exports": [ … ]}.

GET /databases/exports/{file}

Downloads the file. {file} is the export's file name. 404 for a missing file or an invalid name. Needs manage.

DELETE /databases/exports/{export}

Answers 204; 409 (reason: export_in_progress) while it is still being made.

Import

An import is three calls: begin it, send the file in pieces, start it.

  1. POST /databases/{database}/imports with file_name (required, up to 255 characters) and size_bytes (required, at least 1, at most the server's limit: 2 GB unless the administrator changed it). Answers 201 with {"import": { … }, "max_chunk": <bytes>}. 422 on database when the panel has no account to import with, or another import of the same database is open.
  2. PUT /databases/{database}/imports/{import}/chunk with a piece of the file as the raw request body, no larger than max_chunk. Returns {"received": <total bytes so far>}. 409 (reason: import_not_uploading) if the import is no longer in the uploading state.
  3. POST /databases/{database}/imports/{import}/start with confirm_replace: true (required) and optional safety_copy (boolean). Answers 202 with {"import": { … }}. 422 on file if not all bytes arrived.

An import's status is uploading, queued, running, completed or failed; received_bytes, step, reason, message, line and reference tell you how far it got and why it failed.

GET /databases/{database}/imports returns {"imports": [ … ]}. DELETE …/imports/{import} removes one; a running import answers 409 (reason: import_in_progress).

Backups of one database

A database that belongs to an application is backed up with the application (see Backups and storage API). A database on its own has its own plan.

GET /databases/{database}/backup-target

Returns {"backup_target": { … } | null, "backed_up_with": { … } | null}. backed_up_with names the application whose plan covers this database.

PUT /databases/{database}/backup-target

20 per minute.

FieldRules
storage_destination_idRequired, an existing storage destination.
retention_countRequired, 1 to 365.
frequencyRequired: manual, hourly, every_3_hours, every_6_hours, every_12_hours, daily, weekly or monthly.
schedule_timeOptional, HH:mm.
enabledRequired boolean.

Returns {"backup_target": { … }}.

DELETE removes the plan and answers 204. While the database still has backups it is refused with 422; send delete_backups=true to delete them as well. While a backup is still running the plan cannot be removed (422).

GET /databases/{database}/backups

Paged like other lists. Query: filter[status], filter[type], filter[from], filter[to] (dates; to not before from) and per_page (1 to 100).

POST /databases/{database}/backups

Backs up now. Answers 202 with {"backup_target": { … }}. 422 on database when there is no plan, a restore is running on the database, or a backup is already running.

GET /databases/{database}/backups/{backup}/download

Downloads the backup file. 6 per minute.

DELETE /databases/{database}/backups/{backup}

Answers 204.

POST /databases/{database}/backups/{backup}/restore

2 per minute. Replaces the database with the backup. Answers 202 with {"restore": { … }}.

FieldRules
confirmRequired: the database's name, typed.
safety_copyOptional boolean, default true: back up the database first so the restore can be undone.

The backup must be verified, and either this database's own or an archived backup of a database of the same engine. The database needs a backup plan, and no restore, import or export may be running on it. Each failure is a 422 naming backup, database or confirm.

Monitor

EndpointReturns
GET /databases/status/{engine}{"status": { … }}: live engine status.
GET /databases/processes?engine=mariadb{"processes": [ … ]}. engine is required.
DELETE /databases/processes/{id}?engine=mariadb204. The panel's own connection cannot be stopped: 422, reason: panel_process.
GET /databases/metrics/history?engine=mariadb{"metrics": [ … ]}: recent samples, 24 hours by default.

One-click sign-in to Adminer and phpMyAdmin

POST /databases/{database}/adminer-sso and POST /databases/{database}/phpmyadmin-sso take an optional database_user_id (a user of this database) and an optional application_id, and return {"redirect_url": "…"}. Open that URL in a browser to be signed in.

Common errors

StatusMessage or cause
403Your role does not include management for Databases.
404Unknown engine, database, user, import, backup or export file.
409The server does not manage databases here; an install, import or export is already in progress.
422Validation ({"message", "errors": {"field": ["…"]}}), or a refusal that names the field it is about.
429Over a limit; wait for Retry-After.
503The engine is not reachable.

On this page