---
title: "Delete a database"
method: DELETE
path: "/api/v1/databases/{databaseId}"
tags: ["Databases"]
---

# Delete a database

`DELETE /api/v1/databases/{databaseId}`

## Request

- Base URL: `https://app.khotan.com`
- URL: `https://app.khotan.com/api/v1/databases/{databaseId}`
- Auth: one of:
  - HTTP bearer
  - API key in header `x-api-key`

Tears down the provider project, then soft-deletes the record — the same semantics as deleting from the dashboard. Deletion is permanent. Returns 403 resource_protected when the database has deletion protection enabled; protection can only be removed from the dashboard.

## Path parameters

- `databaseId` string, required

## Response `200`

The database was deleted.

- object
  - `deleted` true, required

## Other responses

- `401`: Authentication is missing or invalid.
- `403`: The database is protected from deletion (code resource_protected). Remove protection from the dashboard before deleting via the API.
- `404`: The resource was not found.
- `429`: Too many requests; retry after the indicated delay.
- `502`: Response.

---

[API](https://skmtc.dev/khotan/apis/khotan-api.md) - [All operations](https://skmtc.dev/khotan/apis/khotan-api/llms.txt) - [OpenAPI document](https://skmtc.dev/khotan/apis/khotan-api/revisions/90b512a53e42?raw)
