Provision a Managed Database

POST /v1/applications/{uuid}/database

Add a managed database to a managed backend app (type managed or fullstack). Ngris creates a dedicated database with a least-privilege, per-app user, then delivers the connection details to the running backend as environment variables — you never handle a raw credential.

The app gets its own database, its own user, and a GRANT scoped to that one schema. The password reaches the app only as the encrypted DB_PASSWORD env var; it is never returned by the API. One managed database per application.

Engine. MySQL / MariaDB is the only engine available today. Postgres and Redis are planned — the request takes no engine parameter yet.

Injected environment variables

Once the database reaches ready, these variables appear in the app's env list and are delivered to the running backend on its next rollout:

DB_HOST string
The in-cluster database host.
DB_PORT string
3306 for MySQL / MariaDB.
DB_NAME string
The app's database name.
DB_USER string
The per-app least-privilege user.
DB_PASSWORD secret
Encrypted at rest, masked in the env list — delivered to the backend, never returned.
DATABASE_URL secret
A ready-to-use DSN (e.g. mysql://user:pass@host:3306/db). Also a masked secret.

Response (202 Accepted)

Provisioning is asynchronous. The binding is created with status: "provisioning"; poll GET /database until it is ready. The response wraps the binding under database.

status string
provisioningready (or failed).
db_name string
The derived database name.
db_user string
The derived per-app user.
db_host string
The in-cluster database host.
uuid string
The binding identifier.

Errors

403
The managed_backends or managed_database entitlement is not on your plan.
404
Application not found, or it is a static app (no backend) — a managed database needs a managed backend.
409
A managed database already exists for this application.
Request
curl -X POST \ "https://api.ngris.com/v1/applications/a1b2c3d4-…/database" \ -H "X-API-KEY: <your_api_key>"
Response — 202 Accepted
{ "database": { "uuid": "db12ab…", "db_name": "app_7_42", "db_user": "a_16", "db_host": "mariadb-apps.ngris-appdb.svc", "status": "provisioning", "created_at": "2026-08-04T12:00:00Z" } }

Get the Managed Database

GET /v1/applications/{uuid}/database

Read the app's managed-database binding: its status and the connection identifiers (db_name, db_user, db_host). The password is never included — it lives only in the encrypted DB_PASSWORD env var delivered to the backend. Poll this after provisioning until status is ready.

Response (200 OK)

database object | null
null when no database has been provisioned; otherwise the binding.
database.status string
provisioning, ready, or failed.
database.db_name / db_user / db_host string
Connection identifiers — no password.
entitled bool
Whether the account has the managed_database entitlement (so a client can show the right affordance).

Errors

403
The managed_backends entitlement is not on your plan.
404
Application not found, or it is a static app (no backend).
Request
curl "https://api.ngris.com/v1/applications/a1b2c3d4-…/database" \ -H "X-API-KEY: <your_api_key>"
Response — 200 OK (ready)
{ "database": { "uuid": "db12ab…", "db_name": "app_7_42", "db_user": "a_16", "db_host": "mariadb-apps.ngris-appdb.svc", "status": "ready", "created_at": "2026-08-04T12:00:00Z" }, "entitled": true }
Response — 200 OK (none yet)
{ "database": null, "entitled": true }
Iris