> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dbhost.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete database

> Queue a guarded, recoverable deletion for a managed database.

Queues guarded database deletion. The request must confirm the exact internal
database name. DBHost creates and verifies a deletion backup, removes routing,
and creates a tombstone with a seven-day self-service recovery window. The
tombstone does not consume active database quota but reserves the name.

<Warning>
  Deletion requires an authenticated API key with access to the database, the
  exact managed-registry/OID identity, a verified backup and a bound operation
  ID. Unsafe, unmanaged and protected targets receive
  `FEATURE_NOT_AVAILABLE`; a name alone is never authority.
</Warning>

## Path parameters

| Parameter | Type | Description           |
| --------- | ---- | --------------------- |
| `id`      | uuid | Canonical database ID |

## Request

```json theme={null}
{
  "confirmationName": "exact_internal_database_name"
}
```

The operation validates ownership, database ID/name binding, managed-registry
membership, destructive capability, and the permanent protected-target list.
Names alone are never sufficient authorization.

## Response

```json 202 Accepted theme={null}
{
  "message": "Database deletion queued",
  "operation": {
    "id": "op_01J...",
    "type": "delete",
    "status": "queued",
    "stage": "verify_deletion_backup",
    "progress": 0
  }
}
```

Poll `GET /api/v1/operations/{id}`. After success, use the deleted-databases
endpoint to inspect the recovery deadline or queue recovery while quota permits.

## Errors

| Status | Code                           | Description                                                             |
| ------ | ------------------------------ | ----------------------------------------------------------------------- |
| 400    | `CONFIRMATION_REQUIRED`        | Typed name does not match the bound database                            |
| 401    | `UNAUTHORIZED`                 | Missing or invalid API key                                              |
| 404    | `DATABASE_NOT_FOUND`           | Database is missing or outside key scope                                |
| 404    | `FEATURE_NOT_AVAILABLE`        | Feature is disabled or the target is not a safe managed tenant database |
| 409    | `OPERATION_CONFLICT`           | Another destructive operation is active                                 |
| 409    | `BACKUP_NOT_VERIFIED`          | Required deletion backup is not verified                                |
| 503    | `AGENT_CAPABILITY_UNAVAILABLE` | Agent cannot execute guarded deletion                                   |
