---
docId: doc_a7a6e7c8e5b740f1a19ab337da1ff1cd
title: Delete a database
description: "Delete a connection and its tools, keeping its password secret."
api:
  group: herramientas/bases-de-datos
  auth: bearer
  operations:
    - operationId: deleteDatabase
      method: DELETE
      path: '/v1/tools/databases/{databaseId}'
      postmanName: Delete a database
---

<script>
  import { Ways } from '$lib/components';
</script>

# Delete a database

Delete the connection, its four catalog tools, and their connections to agents. The password secret remains in [Secrets](/api-reference/secrets/list).

## Example

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl -X DELETE https://api.platic.ai/v1/tools/databases/$DB_ID \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
await platic.tools.databases.delete("db_123");
```

</Ways.Way>
</Ways>

## Path parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `databaseId` | string | The `id` of the connection | ✓ |

## Response

`200 OK`.

```json
{
  "status": "success",
  "message": "Connection deleted",
  "data": { "id": "Xb2mQe7LtR9sKd4fHw1N", "deleted": true }
}
```

## Errors

| Status | `details.code` | When it happens |
|--------|----------------|-----------------|
| `403` | `FORBIDDEN` or `INSUFFICIENT_SCOPE` | The person behind the token does not have access to Integrations, or the token does not have write permission |
| `404` | `NOT_FOUND` | There is no connection with that id in the workspace |
| `409` | `TOO_MANY_BINDINGS` | The connection is linked to too many agents to delete it at once. Disconnect it from some first |

## Notes

- This cannot be undone. If you only want agents to stop using it, [pause it](/api-reference/databases/pause).
- If you no longer need the secret with the password, delete it with [delete a secret](/api-reference/secrets/delete).
