---
title: "Disconnect database from VPC"
method: DELETE
path: "/api/v1/databases/{database_id}/vpc"
tags: ["Managed Databases"]
---

# Disconnect database from VPC

`DELETE /api/v1/databases/{database_id}/vpc`

## Request

- Base URL: `https://api.rafftechnologies.com`
- URL: `https://api.rafftechnologies.com/api/v1/databases/{database_id}/vpc`
- Auth: API key in header `X-API-Key`

Detach the database's private endpoint from its VPC. Clients inside the VPC lose access; public access, if enabled, keeps working. Calling it on a database without a VPC succeeds and changes nothing.

## Path parameters

- `database_id` string, required

## Response `200`

Database disconnected from the VPC

- object
  - `success` boolean
  - `database` Database: A managed database instance. The private endpoint `{database_id}.db.raffusercloud.com` lives inside the attached VPC; public access is optional. TLS is always required.
    - `id` string, uuid: Unique database identifier
    - `database_id` string: Short reference id used in URLs and DNS hostnames, e.g. `a1b2c3d4`
    - `project_id` string, uuid: Project this database belongs to
    - `name` string: Display name
    - `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_version` string: Engine major version
    - `status` 'pending' | 'deploying' | 'running' | 'warning' | 'resizing' | 'restoring' | 'moving' | 'suspended' | 'failed' | 'deleting' | 'deleted': Lifecycle status. - Creation: `pending`, then `deploying`, then `running`. A database with public access reports `running` only once its public address accepts connections. - `warning`: running with a problem (a component down, storage full). When the database stopped answering, `down_since` is set. - `resizing`: a plan, storage, high availability or replica change is being applied (a short restart, not an outage). - `restoring`: an in-place restore is in progress. - `moving`: Raff is moving the database to other hardware for maintenance. - `suspended`: a free database paused after 7 days without connections. Data is kept; resume with `POST /api/v1/databases/{database_id}/resume`. - `failed`: provisioning did not complete. - `deleting`, `deleted`: being deleted, deleted.
    - `status_message` string: Plain-words detail for `warning`, `resizing` and `failed`
    - `region` 'us-east': Data center region
    - `plan_id` integer: Pricing plan ID (see `GET /api/v1/databases/plans`)
    - `storage_gb` integer: Provisioned storage in GB. Storage above the plan's included storage is billed per GB per month (`storage_pricing` in `GET /api/v1/databases/plans`, $0.15 today).
    - `ha_enabled` boolean: High availability: copies on separate servers that take over automatically on failure. PostgreSQL and Valkey run a primary and a standby, ClickHouse two replicas, MySQL a 3-node cluster, Kafka 3 brokers. Adds 70% of the plan price for PostgreSQL, Valkey and ClickHouse, 140% for MySQL and Kafka (`ha_pricing` in `GET /api/v1/databases/plans`).
    - `replica_count` integer: Number of read replicas (PostgreSQL only; 0 for other engines). Each costs the same as the plan.
    - `vpc_id` string: VPC the private endpoint is attached to (empty if not yet connected)
    - `public_access` boolean: Whether public access is enabled
    - `connection_host` string: Private endpoint hostname, resolvable inside the attached VPC. Use it only when `vpc_id` is set; without a VPC the database has no private address you can reach.
    - `connection_port` integer: Private endpoint port. PostgreSQL: 5432 direct; the pooler (PgBouncer, transaction mode) is on 6432 of the same host. MySQL: 3306. Valkey: 6379. ClickHouse: 8443 (HTTPS), 9440 (native). Kafka: 9092. Use TLS: databases created from October 13, 2026 refuse unencrypted connections.
    - `billing_type` 'payg' | 'subscription': Billing type for this database
    - `subscription_id` string: Subscription ID if billing_type is subscription (empty otherwise)
    - `price_per_hour` number: Hourly billing rate in USD
    - `monthly_price` number: Monthly price in USD
    - `public_port` integer: The database's own public port on `public_dns_hostname`; `0` when public access is off. For PostgreSQL and ClickHouse, `public_port` and `public_port + 1` (PostgreSQL: pooled and direct; ClickHouse: HTTPS and native). PostgreSQL is also reachable on the standard ports 6543 (pooled) and 5432 (direct), routed by the hostname the client sends over TLS; use `public_port` for old clients that do not send it. The port stays the same when public access is turned off and on again.
    - `public_dns_hostname` string: Public endpoint hostname (empty when public access is off)
    - `public_allowlist` string[]: Source CIDRs allowed on the public endpoint. Empty = allow all sources.
    - `is_free` boolean: True for a free-tier database. Free databases pause after 7 days without connections.
    - `suspended_at` string: When a free-tier database was paused for idleness, RFC 3339 (empty when not paused)
    - `down_since` string: When the database stopped answering, RFC 3339 (empty while it answers). Set with status `warning`.
    - `metrics` object, nullable: Latest live numbers, sampled every minute. `null` until the first sample.
      - `connections_active` integer
      - `connections_max` integer
      - `pooled_connections_active` integer: PostgreSQL pooler
      - `pooled_connections_max` integer: PostgreSQL pooler
      - `storage_used_bytes` integer
      - `storage_capacity_bytes` integer
      - `ops_per_sec` number: Transactions (PostgreSQL), queries (MySQL, ClickHouse) or commands (Valkey) per second
      - `cache_hit_pct` number
      - `metrics_updated_at` string: When the numbers were sampled, RFC 3339
    - `created_at` string, date-time
    - `updated_at` string, date-time

## Other responses

- `400`: Invalid request parameters
- `401`: Authentication required
- `404`: Resource not found

## Changes

- **2026-10-11** `89ec42a2108b`: 1 warning, 2 info
  - added the new `moving` enum value to the `database/status` response property for the response status `200`
  - added the optional property `database/down_since` to the response with the `200` status
  - added the optional property `database/metrics` to the response with the `200` status
- **2026-10-05** `26292956c4b3`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/rafftechnologies/apis/raff-api/changes/api/v1/databases/:database_id/vpc/delete.md)

---

[API](https://skmtc.dev/rafftechnologies/apis/raff-api.md) - [All operations](https://skmtc.dev/rafftechnologies/apis/raff-api/llms.txt) - [OpenAPI document](https://skmtc.dev/rafftechnologies/apis/raff-api/revisions/3d30cde0acb4?raw)
