Remove a custom domain
email.domains_delete
DELETE/api/v1/households/{household_id}/email/domains/{email_domain_id}
- Route
Removes the domain and its addresses, gives them up, and deletes the domain from the mail service. Fails with address_in_use while a draft is being sent from one of its addresses.
Parameters#
| Field | Description |
|---|---|
household_idpathstringrequired | The household's ID. |
email_domain_idpathstringrequired | The domain's ID. |
Response#
204 The domain was removed. No body.
Errors#
Every error has the same envelope: error.code, error.message, error.details, error.recovery and error.request_id.
| Status | Code | When |
|---|---|---|
400 | validation_failed | A field is missing, misspelled or out of range. details.fields lists each problem. |
401 | unauthenticated | The request has no valid session. |
404 | not_found | The household doesn't exist, or you aren't a member of it. |
409 | Read error.code | Described above. |
Examples#
These are real. Each was recorded from a sample household, the Okafors, running through the whole API when this site was built.
Remove a custom domain
Removes the domain and its addresses, gives them up, and deletes the domain from the mail service.
Request, curl
curl -X DELETE 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/email/domains/emd_01M6V9CSSD5VZEVZHZH5TE669F' \
-H "Cookie: rigel_session=$RIGEL_SESSION"Request, TypeScript
const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/email/domains/emd_01M6V9CSSD5VZEVZHZH5TE669F", {
method: "DELETE",
headers: {
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
});
const data = await response.json();Request, HTTP
DELETE /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/email/domains/emd_01M6V9CSSD5VZEVZHZH5TE669F HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>Response, 204
HTTP/1.1 204 No Content
X-Request-Id: req_01M6V9CSSFGVN8NV23AZDEW31B