Create email endpoint
Creates a new inbound email endpoint (custom inbox) and returns it with its counters. Admin only. The localpart must be valid and not reserved or equal to the workspace mailbox; ‘agent’ (plane=agent) endpoints require a handler agent belonging to the workspace, while ‘light’ quick-reply endpoints must not name an agent. Returns 402 if the plan’s email-inbox limit is reached and 409 if the address (or an agent’s existing endpoint) already exists.
Authorizations
Personal Access Token. Send as Authorization: Bearer hq_pat_....
Body
The editable behavior fields. All optional on PATCH (a full-form replace); on create, missing values fall back to the DB column defaults.
Replaces the allowlist set wholesale when present.
Court-document intake on/off (docs/court-document-intake.md). Omitted = keep current.
Secure-mail password for the court portal. WRITE-ONLY: a non-empty value is vault-sealed and stored; it is never echoed back. Omitted/empty = keep the stored password.
Response
Endpoint created
Court-document intake (docs/court-document-intake.md) is enabled on this
inbox: an inbound carrying a securemail.domstol.se link additionally
downloads the court documents into the library. Off by default.
A secure-mail password is stored (vault-sealed) for this inbox. The password is write-only; this flag is the only thing the API discloses.
True for the workspace outbound mailbox (HQ-managed): not deletable, not a normal custom inbox - the UI renders it as the workspace mailbox.
Total mail (in + out) attributed to this endpoint.
Items needing a human (handling_state <> 'handled').
Disposition counters (E7.2): inbound received, outbound replies sent, per-state queues, and threads escalated light -> agent.
Reply-language distribution: { "English": 12, "Swedish": 3 }.