Delete a domain

Remove a sending domain.

Removes the domain immediately and permanently — there is no grace period on the API path. Sends from addresses under a deleted domain are rejected with a sender-domain error. Returns 204 on success, 404 if the domain isn't on your account.

DELETE /v3/domains/{name}

Responses

StatusDescription
204Deleted. No body.
401Missing or invalid API key.
403The domain is shared with you by another workspace — only its owner workspace can delete it.
404No such domain on your account.

Code examples

cURL
curl -X DELETE https://api.wemail.io/v3/domains/{name} \
  -H "Authorization: Bearer afn_live_…"
Node.js
const res = await fetch("https://api.wemail.io/v3/domains/{name}", {
  method: "DELETE",
  headers: {
    Authorization: `Bearer ${process.env.WEMAIL_API_KEY}`,
  },
});
const data = await res.json();
Python
import os, requests

r = requests.delete(
    "https://api.wemail.io/v3/domains/{name}",
    headers={"Authorization": f"Bearer {os.environ['WEMAIL_API_KEY']}"},
)
data = r.json()