Create database
Changed onCreate a managed database.
<Note> Before creating a database, you need: - A **plan ID** from [List database plans](/api-reference/databases/list-database-plans). The free plan is marked `is_free_tier`; one free database per account. - Optionally an **engine version** from [List database engines](/api-reference/databases/list-database-engines). Omit it for the newest. - A **project ID** in `X-Project-ID` from [List projects](/api-reference/projects/list-projects). - Optionally a **VPC ID** for a private endpoint. </Note>Provisioning is asynchronous: the database is created in status pending and moves through deploying to running. Poll GET /api/v1/databases/{database_id} for progress. A free PostgreSQL or MySQL database is usually running within seconds. With public_access: true, running means the public address already accepts connections.
Networking
Databases live on private VPC networking by default. Set vpc_id to place the private endpoint ({database_id}.db.raffusercloud.com) inside an existing VPC, or attach a VPC later via POST /api/v1/databases/{database_id}/vpc. Public access is optional and off by default. TLS is always required.
Engines
- PostgreSQL: pooled endpoint on port 6432 (PgBouncer, transaction mode) plus a direct endpoint on 5432. Nightly base backup with continuous WAL archiving for point-in-time restore.
- MySQL: TLS endpoint on port 3306. Nightly backups plus on-demand backups.
- Valkey: single TLS endpoint on port 6379. Nightly RDB snapshots plus on-demand snapshots. No read replicas; high availability adds a standby with automatic Sentinel failover.
- ClickHouse and Kafka: see the engine catalog for versions. Kafka clients must trust the ca_cert returned by the connection endpoint.
Pricing
The plan sets the base price. High availability adds 70% of the plan price for PostgreSQL, Valkey and ClickHouse, 140% for MySQL and Kafka. Each PostgreSQL read replica costs the plan price. Storage above the plan's included storage is $0.15/GB/month. The same numbers are in GET /api/v1/databases/plans and, without authentication, GET /api/v1/public/pricing/database.
Errors
- 409: the name is taken in this project, or the account already has a free database.
- 402: a paid plan on a monthly account without a card that can be charged automatically. The response links to the dashboard to add one.
- 403: the account's billing status or your role does not allow creating databases.
Billing
- Free plan: no charge and no card needed. One free database per account.
- Paid plan: a monthly subscription, the same as buying the database in the dashboard. The account needs a card that can be charged automatically, or the create is refused with 402 and a link to add one. The first month is charged within seconds of the create, from the account balance first and then the card.
- Accounts on pay-as-you-go billing are billed by the hour instead.
Request
- Base URLhttps://api.rafftechnologies.com
- URLhttps://api.rafftechnologies.com/api/v1/databases
- AuthAPI key in header X-API-Key
Headers
Project ID. Required for all mutating operations (create, delete, power actions, resize).
Request body
Example request
{
"name": "orders-db",
"engine": "postgres",
"engine_version": "16",
"plan_id": 5,
"engine_config": {
"maxmemory-policy": "allkeys-lru"
},
"extensions": [
"vector"
]
}Response
Database created (status pending while provisioning)
Example response
{
"database": {
"name": "orders-db",
"engine": "postgres",
"engine_version": "16",
"region": "us-east",
"plan_id": 5,
"storage_gb": 25,
"connection_host": "a1b2c3d4.db.raffusercloud.com",
"connection_port": 5432,
"billing_type": "payg",
"price_per_hour": 0.010945,
"monthly_price": 7.99,
"public_port": 20104,
"public_dns_hostname": "a1b2c3d4.public.db.raffusercloud.com",
"public_allowlist": [
"203.0.113.0/24"
]
}
}Changes
- warning
added the new
movingenum value to the/response property for the response status - info
added the non-success response with the status
- info
added the optional property
/to the response with the status - info
added the optional property
/to the response with the status
- warning
- info
added the new optional request property
- info