Create an agent inbox
Create an address on your workspace subdomain that receives mail at once with POST /v3/agent-inboxes — pick the handle, add an optional sender allow-list.
Creates <handle>@<your subdomain> — for example support@k7f3q2.wemail.io — and starts receiving immediately. See Agent inboxes for how they work.
POST /v3/agent-inboxes
Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
handle | string | Optional | The part before the @: lower-case letters, digits, dots, dashes and underscores, at most 40. Omitted = a random handle. A handle that was used before on your subdomain gets a short suffix (addresses are never reused). Role mailboxes such as postmaster and abuse are reserved. |
label | string | Optional | Your name for the inbox, at most 120 characters. |
sender_allowlist | string[] | Optional | Only these senders arrive as normal mail: user@domain or @domain (subdomains included), at most 50. Anyone else is stored as quarantined. Omitted = everyone. |
| Status | Description |
|---|---|
201 | The new inbox (id, address, label, sender_allowlist, status, created_at). |
400 | validation_error — invalid handle or allow-list entry. |
403 | agent_inbox_limit_reached — your plan’s inbox count is used; insufficient_scope — needs a full_access key. |
404 | feature_disabled — agent inboxes are not enabled for your workspace yet. |
409 | address_unavailable — choose another handle. |
401 | Missing or invalid API key. |
Use your brand
PUT /v3/agent-inboxes/subdomain
PUT /v3/agent-inboxes/subdomain with { "slug": "acme" } switches your subdomain once from the neutral name to your brand. The name must be a label of a domain you have verified under Domains (owning acme.com or mail.acme.gr ⇒ acme), and it may not look like another brand — digit swaps (paypa1), separators (pay-pal), typos and brand names inside longer names are refused. Every inbox gets its address under the new name; the old addresses keep receiving. Errors: 403 domain_not_verified, 409 subdomain_taken, 409 already_renamed, 400 validation_error.
Code examples
curl -X POST https://api.wemail.io/v3/agent-inboxes \
-H "Authorization: Bearer afn_live_…" \
-H "Content-Type: application/json" \
-d '{ "handle": "support", "label": "Support agent" }'const res = await fetch("https://api.wemail.io/v3/agent-inboxes", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.WEMAIL_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ "handle": "support", "label": "Support agent" }),
});
const data = await res.json();import os, requests
r = requests.post(
"https://api.wemail.io/v3/agent-inboxes",
headers={"Authorization": f"Bearer {os.environ['WEMAIL_API_KEY']}"},
json={ "handle": "support", "label": "Support agent" },
)
data = r.json()