Skip to main content
The Pxxl Database API lets you provision, inspect, and run lifecycle operations on managed databases from your terminal or backend code. It uses the same provisioning pipeline as the dashboard, so a database created with pxxl db create is identical to one created by clicking through the UI — it appears in the dashboard, can be linked to projects, and ships with the same connection credentials, backups, and metrics. Use the Database API when you want to:
  • Spin up a fresh database during a CI job, integration test, or per-tenant onboarding flow.
  • Restart or stop a database from an internal incident-response script without giving the operator dashboard access.
  • Pull stats, table lists, or sizes into your own monitoring dashboard.
  • Tear down ephemeral databases created for preview environments.

Supported Engines

You can provision any of the following engines. Pass the value as the --type flag (CLI) or type field (SDK).

CLI

Install the CLI and log in once with a Pxxl API key. The CLI stores credentials locally with restricted file permissions.
Databases belong to a spaceship (team). Select the spaceship you want to operate in before running database commands:
PXXL_TEAM_ID overrides the stored selection for a single command. Useful in CI where you want to be explicit instead of relying on local state.

Provisioning

Create a new managed database. Pxxl returns the database ID, connection string, and credentials.

Inspecting

Lifecycle

Lifecycle commands match the buttons in the dashboard. They are idempotent — starting an already-running database is a no-op.
pxxl db delete is irreversible. Once the command returns, the underlying volume is scheduled for deletion and connection strings stop resolving. Take a manual backup first if you might need the data.

Node SDK

The same operations are available from the @pxxlapp/pxxl Node package. The SDK is designed for backend automation — never instantiate it from browser code.

API Keys and Permissions

Database operations require an API key with scope=database or scope=all. Always pick the smallest permission level that fits the job — read-only keys are safe to share with monitoring jobs and on-call dashboards, while read_write keys should be limited to deployment automation. The Gateway re-checks spaceship membership on every request, so a stolen key cannot reach databases in spaceships the owning user does not belong to.
Treat database API keys like database passwords. Store them in your secret manager, never in repositories, browser code, or build logs. Rotate immediately if a key is exposed.