Managed Databases

Create 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.
post/api/v1/databases

Request

  • Base URL
    https://api.rafftechnologies.com
  • URL
    https://api.rafftechnologies.com/api/v1/databases
  • Auth
    API key in header X-API-Key

Headers

X-Project-IDstring uuid required

Project ID. Required for all mutating operations (create, delete, power actions, resize).

Request body

namestring required

Display name, unique within the project across all engines. Lowercase letters, digits and hyphens work everywhere.

engine'postgres' | 'mysql' | 'valkey' | 'clickhouse' | 'kafka'

Database engine identifier. Defaults to postgres on create; the live catalog (including availability and versions) is GET /api/v1/databases/engines.

engine_versionstring

Engine major version from the engine catalog. Omit for the default version.

plan_idinteger required

Pricing plan ID from GET /api/v1/databases/plans

storage_gbinteger

Storage in GB. Omit to use the plan's included storage; storage above it is billed per GB per month ($0.15 today). Fixed on the free plan.

ha_enabledboolean

Enable high availability (+70% of the plan price for PostgreSQL, Valkey and ClickHouse, +140% for MySQL and Kafka). Not available on the free plan.

replica_countinteger

Read replicas, PostgreSQL only. Each costs the same as the plan. Not available on the free plan.

region'us-east'

Data center region

vpc_idstring uuid

VPC to place the private endpoint in. Omit to create without VPC connectivity and attach one later via POST /api/v1/databases/{database_id}/vpc.

public_accessboolean

Give the database a public address (TLS required) as soon as it is created. If the public address cannot be set up, the database is still created, without it; check public_access in the response of GET /api/v1/databases/{database_id}. Kafka is private only.

engine_configobject

Engine settings you can choose at create. Anything else is refused with 400.

  • Valkey maxmemory-policy: noeviction (default; nothing is ever removed, writes fail when memory is full; for queues and data you cannot lose) or allkeys-lru (the least recently used keys are removed when memory is full; for caches).
extensionsstring[]

PostgreSQL only. Extensions to turn on before the database is marked running, so it is ready for them the moment you connect. Allowed: vector (AI embeddings), pg_trgm, pg_stat_statements, hstore, uuid-ossp, citext, ltree, pgcrypto, unaccent. Other engines or other names are refused with 400. Any other extension the image ships can be turned on later with the extensions endpoint.

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)

successboolean

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 moving enum 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

    • info

      added the new optional request property