---
title: "Create a new PostgreSQL database"
method: POST
path: "/projects/{id}/databases"
tags: ["Databases"]
---

# Create a new PostgreSQL database

`POST /projects/{id}/databases`

## Request

- Base URL: `https://api.volcano.dev`
- URL: `https://api.volcano.dev/projects/{id}/databases`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Creates a PostgreSQL database in the project.
Each project can hold 1 database on HOBBY and up to 10,000 on SUPERAGENT.
Requests over the plan's cap return 403.

## Path parameters

- `id` string, uuid, required

## Request body

- CreateDatabaseRequest: Create a new PostgreSQL database. Volcano automatically sets up: - Auth helpers (auth.uid(), auth.email(), auth.role()) - Database roles (anon for unauthenticated, authenticated for signed-in users) - Secure multi-tenant isolation - Ready for Row-Level Security
  - `name` string, required: Database name (must be unique within project)
  - `region` string, required: Region for database hosting, such as `us-east-1`. The accepted values are the regions this environment runs in, so read them from `GET /databases/regions` rather than hardcoding a list. A region the environment does not offer is rejected with 400. Region IDs issued by earlier versions of the API are still accepted.
  - `pg_version` '16' | '17' | '18', required: PostgreSQL major version. `GET /databases/postgres-versions` lists the versions this environment accepts; local mode accepts only the version its server runs. Any other value is rejected with 400.
  - `database_type` 'volcano-db-xs' | 'volcano-db-s' | 'volcano-db-m' | 'volcano-db-l' | 'volcano-db-xl' | 'volcano-db-2xl': Compute size tier (optional, defaults to volcano-db-xs). Determines autoscaling limits for the database.

## Response `201`

Database created (provisioning)

- Database: PostgreSQL database with automatic scalability and security features.
  - `id` string, uuid, required
  - `project_id` string, uuid, required
  - `name` string, required: Database name
  - `status` 'provisioning' | 'active' | 'failed' | 'restoring' | 'deleting', required: Database status. `restoring` means a restore is replacing the database's data: it does not accept connections, and the operations that would race the restore are rejected until it finishes. Its branches keep serving throughout.
  - `provisioning_started_at` string, date-time: Timestamp when the current provisioning phase started
  - `connection_string` string: Secure PostgreSQL connection URI for your database. The database is identified by the globally-unique username (`volcano_client_{database_id}`) already in this URI; the `application_name` parameter only selects the access mode: - `volcano_full_access` — Full admin access (DDL, migrations) - `volcano_user_access:{user_id}` — User impersonation (RLS enforced) - `volcano_user_access` — Anonymous access (anon role, RLS enforced)
  - `region` string: Region where the database is hosted
  - `pg_version` string: PostgreSQL major version
  - `database_type` 'volcano-db-xs' | 'volcano-db-s' | 'volcano-db-m' | 'volcano-db-l' | 'volcano-db-xl' | 'volcano-db-2xl': Database size tier that determines available RAM and scaling limits.
  - `storage_bytes` integer: Latest observed storage for this database, in bytes: its own on-disk size, plus what each branch has diverged from it, plus what its backups cost to hold. This is the figure the storage allowance is enforced against, and the stats endpoint breaks it down. A point-in-time gauge recorded by a background pass, so it may be absent until the database has been sampled, and it can trail the stats endpoint's `current_storage_bytes`, which measures on request. Summing the latest samples for every database in a project produces the project's "Database Storage (Bytes)" usage gauge. Populated on database list responses; single-database responses omit it.
  - `last_invoked_at` string, date-time: Most recent request timestamp for this database
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `403`: Database limit exceeded for the project

## Changes

- **2026-10-08** `f03633d398ec`: 1 breaking
  - removed the enum value `15` of the request property `pg_version`
- **2026-10-07** `23e7875e7c4c`: 3 info
  - the endpoint scheme security `ProjectAccessToken` was added to the API
  - added the new `17` enum value to the request property `pg_version`
  - added the new `18` enum value to the request property `pg_version`
- **2026-09-19** `3a6f365f3f35`: 7 breaking, 16 info
  - added the new path request parameter `id`
  - added the new required request property `name`
  - added the new required request property `pg_version`
  - added the new required request property `region`
  - …19 more
- **2026-08-27** `bb44e98aba2e`: 10 breaking, 12 warning
  - the request's body type changed from `object` to no type
  - the response's body type changed from `object` to no type for status `201`
  - the response's body type changed from `object` to no type for status `403`
  - removed the required property `created_at` from the response with the `201` status
  - …18 more
- **2026-07-27** `bb52784e098a`: 1 info
  - added the optional property `code` to the response with the `403` status

[Operation history](https://skmtc.dev/kong/apis/volcano-api/changes/projects/:id/databases/post.md)

---

[API](https://skmtc.dev/kong/apis/volcano-api.md) - [All operations](https://skmtc.dev/kong/apis/volcano-api/llms.txt) - [OpenAPI document](https://skmtc.dev/kong/apis/volcano-api/revisions/84c4488f91e9?raw)
