Provision Postgres database
provision_postgresProvision the project's managed Postgres database and inject DATABASE_URL into the app's environment — the same action as the dashboard's Settings → Postgres button; no external Postgres provider or pasted connection string is needed. Idempotent: a project that already has one gets its current state back (already_provisioned=true) and nothing is created. Returns the env var names that are now set, with masked values — the app reads them from its process environment at runtime. Deployed commits are rolled so the new variable lands in the running pods. Requires a read-write token.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | optional provisioning mode: nas (shared servers) or disk (Postgres and S3 as sidecars on the commit disk). Omit to use the platform default. A second call on an already-provisioned project returns the current mode and ignores this field | |
| project_id | Yes | the project id (from list_projects or deploy_files) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | Yes | ||
| mode | No | ||
| message | Yes | ||
| env_vars | Yes | ||
| repaired | Yes | ||
| converged | Yes | ||
| project_id | Yes | ||
| resource_name | No | ||
| rolled_commits | No | ||
| already_provisioned | Yes | ||
| env_secret_digest_after | No | ||
| env_secret_digest_before | No |