---
title: "Retire the project's mail domain while the project stays active"
method: DELETE
path: "/v1/projects/{project_id}/environments/{environment_id}/mail-domain"
---

# Retire the project's mail domain while the project stays active

`DELETE /v1/projects/{project_id}/environments/{environment_id}/mail-domain`

## Request

- Base URL: `https://app.ohmyho.st`
- URL: `https://app.ohmyho.st/v1/projects/{project_id}/environments/{environment_id}/mail-domain`
- Auth: HTTP bearer

Ends sending and receiving at once, removes the webhook, then removes the domain and its sending key from the mail provider and confirms their absence. DNS is not changed; dns_records lists the records to remove from the domain's DNS, including any that Cloudflare authorization added. Repeat the same idempotency key after an uncertain response. A later mail setup starts a new domain registration.

## Path parameters

- `project_id` string, required
- `environment_id` string, required

## Headers

- `X-Request-Id` string
- `Idempotency-Key` string, required

## Response `200`

The mail domain is retired.

- ManagedMailDomainDeleted
  - `status` 'deleted', required
  - `domain` string, required
  - `dns_records` ManagedMailDnsRecord[], required: Records ohmyho.st no longer manages; remove them from the domain's DNS.
    - `type` 'TXT' | 'CNAME' | 'MX', required
    - `name` string, required
    - `value` string, required
    - `purpose` string, required
    - `status` string, required
    - `priority` integer

## Other responses

- `400`: The request failed.
- `401`: The request failed.
- `403`: The request failed.
- `404`: The request failed.
- `409`: The request failed.
- `429`: The request failed.
- `503`: The request failed.

---

[API](https://skmtc.dev/ohmyho/apis/ohmyho-st-api.md) · [All operations](https://skmtc.dev/ohmyho/apis/ohmyho-st-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ohmyho/apis/ohmyho-st-api/revisions/d069888c0017?raw)
