# Delete domains — DELETE /v1/projects/{slug}/domains/{host}

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

> Gives a custom hostname back, so the name is free to reuse.

`DELETE /v1/projects/{slug}/domains/{host}`

> [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/projects/{slug}/domains/{host}` |
| **Method**    | `DELETE`                                                 |
| **Operation** | `delete_projects_by_slug_domains_by_host`                |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`                   |

Gives a custom hostname back, so the name is free to reuse.

A claim is FIRST-COME and global, so ownership includes giving a name back: a
customer who mistyped a domain, or moved one elsewhere, releases it here and
the name is free for them or anyone else. The release is scoped to (host, org,
slug), so it can only ever drop THIS tenant's own claim, and it is IDEMPOTENT:
releasing a host we do not hold is a clean 204, never a 404 that would let a
caller probe which hosts other tenants hold. The edge cache-tag is flushed,
since the host stops routing here.

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

## Request

2 fields.

| Field  | In   | Type   | Required | Description                                                 |
| ------ | ---- | ------ | -------- | ----------------------------------------------------------- |
| `slug` | path | string | yes      | Slug is the project the host is attached to, from the path. |
| `host` | path | string | yes      | Host is the custom hostname, 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 projects domains rm <slug> <host>
```

**SDK**

**.ts**

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

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

**.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_projects_by_slug_domains_by_host(slug='slug', host='host')
```

**.go**

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

resp, _, err := client.ProjectAPI.DeleteProjectsBySlugDomainsByHost(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_projects_by_slug_domains_by_host(&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).deleteProjectsBySlugDomainsByHost();
```

The method above is the one at the current release of the document. `hanzoai@8.5.914` (npm) and `hanzoai@8.5.914` (PyPI) were generated from an earlier release, where this operation carried a different id, so it spells the method differently — regenerating the clients is what makes the two agree. [SDKs →](https://docs.hanzo.ai/docs/sdks)

**HTTP**

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

**MCP**

Tool `project`, op `delete_projects_by_slug_domains_by_host` — 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_projects_by_slug_domains_by_host",
           "input": {
             "slug": "<slug>",
             "host": "<host>"
           }
         }
       }
     }'
```

---

[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)
