# Remove a custom domain

Source: https://straitlink.in/docs/api/remove-domain/

`DELETE /v1/domains/{hostname}`

Auth: secret key as Authorization: Bearer. Server-side only.

**Coming soon:** custom domains aren't switched on yet. Until they are, this endpoint answers `enabled: false` (the list) or `503 domains_not_enabled`.

Deletes the hostname at Cloudflare, then the domain; links stop working on it. Then delete the CNAME and TXT records at your DNS provider. Owners, admins and members. Shares the add limit (10, then 1 every 6 minutes).

| Parameter | In | Type | Notes |
|---|---|---|---|
| `hostname` (required) | path | `string` | The domain to remove |
| `tenantId` | query | `string` | Required with a dashboard session |

```bash
curl -X DELETE https://strait.link/v1/domains/hostname \
  -H "Authorization: Bearer $SECRET_KEY"
```

- `204`: Removed
- `401`: Missing or invalid secret key or session
- `403`: Viewers cannot remove domains
- `404`: No such domain in this workspace
- `429`: Too many domain changes (Retry-After: 360)
- `502`: Cloudflare didn't answer; the domain is still listed
- `503`: domains_read_only: removing is switched off right now
