Databases
Create a database with managed SQL roles
Create a DBHost database with separate owner, runtime and read-only roles through the API, with optional reservation before provisioning.
POST
Create a database with managed SQL roles
Fresh managed databases are opt-in from the dashboard on every plan. This
API endpoint is available on Pro and Business with a full-account API key.
The server chooses role names, connection budgets, and the database endpoint.
See Database roles and
Restore from a DBHost backup.
Idempotency-Key header with name and displayName. Ordinary
creation returns 202 while pending and 201 when completed. Responses contain
operation metadata, never passwords. Retrieve credentials separately.
For a new standard database, optional environment is production (default),
staging, development or other. Production requires daily scheduled logical
backup. Staging defaults to daily and can explicitly choose none; development
and other require scheduledBackup: "none" or "daily". Both fields are bound
to the idempotency key before SQL dispatch. Changing an existing database’s
environment label does not silently change its backup policy.
Reserve before creating
To obtain a stable target identity without dispatching database SQL or admitting connections, addreserveOnly: true:
202 response contains operationId, generation, status: "reserved" and
targetDatabaseId. The target database does not yet exist. Its reservation
counts against the account’s database quota, including pending reservations and
any lower pending-plan limit. An unlimited admin plan retains its existing
quota semantics.
Repeat without reserveOnly, or with reserveOnly: false, using the same names
and idempotency key to create and admit that exact identity. A completed replay
returns completed metadata without changing the database. If SQL was already
dispatched with an unresolved outcome, a reservation request returns 409 and
does not reset or restart the operation.
Do not send credentials, generated role names, budgets or endpoint settings.
Unknown request fields and non-boolean reserveOnly values are rejected. All
responses use Cache-Control: no-store.
Clone reservation
Any managed database you own can be cloned from one of its verified backups, with the Clone action on the dashboard’s Backups tab or withPOST /api/v1/databases/{id}/managed-clones. A database with legacy
additional roles cannot be cloned (409 LEGACY_OVERLAY_REQUIRES_V4). The
endpoint accepts the same reserveOnly
boolean alongside backupId, name and displayName. A small clone completes
in one request (201); repeat the request with the same idempotency key until
it returns 201 with status: "completed". Clone and managed-restore requests
are limited to six per hour per API key, so do not poll faster than every 15
seconds. The source database,
verified backup and future target identity are reserved together. A reserved
response contains no credentials and dispatches no SQL or import. Continue
using the same source, backup, target and idempotency key with reserveOnly
false or omitted. Claimed or unknown SQL/import outcomes require reconciliation
and cannot be converted back into reservations.
When the database agent cannot create a clone target yet, a new request is refused
before anything is reserved with 409 CLONE_NOT_AVAILABLE. If the database
agent refused a request before it created anything, a later call with the same
key returns 409 MANAGED_DISPATCH_NO_EFFECT: nothing was created, the
reservation and its name are released, and you can start again with a new
idempotency key. This happens no sooner than 15 minutes after the refusal.