---
title: "Remove a domain"
description: "Removes the domain from the workspace. Its addresses stop receiving, mail from it can no longer be sent, its tracking and files domains stop answering, and `domain.deleted` fires. Mail already received stays in the mailbox."
url: "https://openemail.uk/docs/api/domains/delete"
area: "API"
category: "Mailbox"
---

# Remove a domain

Removes the domain from the workspace. Its addresses stop receiving, mail from it can no longer be sent, its tracking and files domains stop answering, and `domain.deleted` fires. Mail already received stays in the mailbox.

`DELETE /domains/{id}`

## DELETE /domains/{id}

Removes the domain from the workspace. Its addresses stop receiving, mail from it can no longer be sent, its tracking and files domains stop answering, and `domain.deleted` fires. Mail already received stays in the mailbox.

## Example

Needs `domains:write`. A key limited to particular addresses or domains needs to hold the whole domain.

**curl**

```
curl -X DELETE "$OE/domains/b3e1f0a4-6c2d-4e8a-9f17-2d5c8a0b4e6f" -H "$AUTH"
```

**Response**

```
{
  "object": "domain",
  "id": "b3e1f0a4-6c2d-4e8a-9f17-2d5c8a0b4e6f",
  "domain": "acme.com",
  "deleted": true,
  "leftBehind": []
}
```

> Records OpenEmail wrote for you through a connected DNS account are withdrawn. Anything it could not withdraw is listed in `leftBehind`, and records you published by hand stay where they are until you remove them.

> The last domain in a workspace cannot be removed through the API and answers `409` `last_domain`, because removing it in the app deletes the whole mailbox with it. Do that in the app, where it is confirmed first.

> A domain that holds reserved account addresses answers `409` `domain_holds_reserved_addresses`.
