Hail API
PATCH
/email-domains/{domain_id}

Path Parameters

domain_id*Domain Id
Formatuuid

Header Parameters

authorization?string|null

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Body for PATCH /email-domains/{id}.

Two clusters of mutable fields:

  • Hail-mail addressing — the user/org prefix pair (only valid on kind='hail_mail' rows; the handler returns 422 if a tenant tries to PATCH these on a custom row).
  • Inbound action — inbound_enabled + forward_to + the optional forward_rate_per_hour cap. These apply to either kind, but this milestone routes inbound only to hail_mail rows; custom-domain inbound (MX delegation) is the next milestone.

Every field is independently optional so PATCH semantics work the way callers expect: send only what you want to change. The route enforces the cross-field rules (the CHECK constraint on the table requires an action when inbound_enabled is true) — we don't re-implement it here because the patch may merge with existing row state to satisfy the invariant.

Response Body

application/json

application/json

curl -X PATCH "https://example.com/email-domains/497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "Content-Type: application/json" \  -d '{}'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",  "kind": "hail_mail",  "domain": "string",  "local_prefix_user": "string",  "local_prefix_org": "string",  "verification_status": "pending",  "dns_records": [    {      "name": "string",      "value": "string",      "type": "CNAME",      "priority": 0    }  ],  "mail_from_domain": "string",  "mail_from_status": "string",  "provider": "string",  "verified_at": "2019-08-24T14:15:22Z",  "inbound_enabled": false,  "forward_to": [    "string"  ],  "forward_rate_per_hour": 0,  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z",  "receive_ready": true}