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

# Delete Database

> Delete a database hosted on Square Cloud.

<ParamField header="Authorization" type="string" placeholder="API Key" required>
  The API key for your account. You can find this in your [account settings](https://squarecloud.app/en/account/security).
</ParamField>

Permanently removes the database container and releases its public DNS record (`square-cloud-db-<id>.squareweb.app`). This is destructive and immediate: there is no confirmation step, and the connection URL stops resolving as soon as the DNS record is released.

If you need the data afterward, take a [Create Snapshot](/en/api-reference/endpoint/databases/snapshots/create) before deleting. The request is rejected while a snapshot restore is in progress on the database. Rate limited to 1 deletion every 3 seconds per user.

### Parameters

<ParamField path="database_id" type="string" placeholder="Database ID" required>
  The ID of the database.
</ParamField>

### Response

<ResponseField name="status" type="string">
  Indicates whether the call was successful.. `success` if successful, `error` if not.
</ResponseField>

<ResponseExample>
  ```json theme={null}
  {
    "status":"success"
  }
  ```
</ResponseExample>

### Common errors

| Code                  | HTTP | Meaning                                                                           |
| --------------------- | ---- | --------------------------------------------------------------------------------- |
| `RESTORE_IN_PROGRESS` | 403  | A snapshot restore is currently running for this database; wait for it to finish. |
| `DATABASE_NOT_FOUND`  | 404  | The database does not exist or is not owned by the caller.                        |
| `DELETE_FAILED`       | 404  | The cluster rejected the delete operation.                                        |
