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

# Delete Repository

> Delete a repository, its documents and their files.

> [!NOTE]
>
> **Preview.** This endpoint is available to organisations in the Wordsmith MCP pilot. Other organisations receive `403 mcp_not_enabled`. See the [preview overview](/preview).

Deletes a repository, its folders and its search index. Its documents are deleted too, with the files behind them: the repository owns the file of each document it holds (see [Add Documents](/api-reference/repositories/add-documents)), so it does not outlive the repository. The repository's agent stops being listed at once. Download any file you want to keep first.

Reports whose rows followed this repository stop following it. They keep their current rows and cells.

This endpoint is REST only. No MCP tool deletes a repository.

## Authentication

Requires an API key, or an OAuth token with `repositories:write`. The caller also needs delete access to the repository.

## Path parameters

**repository\_id** `string` *required*

The repository id.

## Response

Returns `204` with no body. The documents and the index are removed in the background over the next minutes.

```bash cURL theme={null}
curl -X DELETE "https://api.wordsmith.ai/api/v1/repositories/b23066a1-44cb-4b31-8b44-c723dc507d9b" \
  -H "Authorization: Bearer sk-ws-api1-your_api_key_here"
```

```text Response theme={null}
204 No Content
```

## Errors

| Status | `error_code` | When |
| - | - | - |
| 401 | `unauthorized` | The API key or token is missing or invalid. |
| 403 | `mcp_not_enabled` | Your organisation is not in the preview. |
| 403 | `forbidden` | The caller can read the repository but cannot delete it. |
| 404 | `resource_not_found` | No repository with this id, or the caller cannot read it. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.