# Delete project

URL: https://docs.hanzo.ai/docs/openapi/project/delete-project-by-slug

> Deletes a project and takes its site off the internet.

`DELETE /v1/project/{slug}`

> [Project →](https://docs.hanzo.ai/docs/openapi/project) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                          |
| ------------- | ---------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/project/{slug}` |
| **Method**    | `DELETE`                                 |
| **Operation** | `delete_project_by_slug`                 |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`   |

Deletes a project and takes its site off the internet.

The metadata delete is authoritative and everything after it is best-effort,
in this order: the public `<slug>` subdomain binding is released so the slug is
free to reclaim, the release rows are dropped so a reclaimed slug never
inherits the previous owner's rollback menu, the git source is retired on
every copy it has so a reclaimed slug never adopts a repository left behind
(visibility.go), the S3 origin is purged under BOTH `<org>/<slug>/` and the
site's sibling release space, and the edge cache-tag is flushed. A failure in
any of those is logged and the delete still answers 204 — resurrecting a
project because a purge missed would be worse than a leaked prefix.

Scope: a validated principal is required (401 without one) and the project is
resolved within that principal's org, so another tenant's slug is a 404 and
nothing of theirs is touched.

## Request

1 field.

| Field  | In   | Type   | Required | Description                                   |
| ------ | ---- | ------ | -------- | --------------------------------------------- |
| `slug` | path | string | yes      | Slug is the project to act on, from the path. |

## Response

| Status    | Body            | Meaning    |
| --------- | --------------- | ---------- |
| `204`     | —               | no content |
| `default` | problem-details | refused    |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo project rm <slug>
```

**SDK**

**.ts**

```ts
import { Configuration, ProjectApi } from 'hanzoai';

const api = new ProjectApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.deleteProjectBySlug({ slug: 'slug' });
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import ProjectApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = ProjectApi(client).delete_project_by_slug(slug='slug')
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.ProjectAPI.DeleteProjectBySlug(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, project_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = project_api::delete_project_by_slug(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.ProjectApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new ProjectApi(client).deleteProjectBySlug();
```

**HTTP**

```bash
curl -X DELETE https://api.hanzo.ai/v1/project/<slug> \
  -H "Authorization: Bearer $HANZO_API_KEY"
```

**MCP**

Tool `project`, op `delete_project_by_slug` — POST the JSON-RPC envelope to `https://api.hanzo.ai/v1/mcp`.

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "project",
         "arguments": {
           "op": "delete_project_by_slug",
           "input": {
             "slug": "<slug>"
           }
         }
       }
     }'
```

---

[Project API](https://docs.hanzo.ai/docs/openapi/project) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
