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

ParameterTypeRequiredDescription
handlestringOptionalThe 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.
labelstringOptionalYour name for the inbox, at most 120 characters.
sender_allowliststring[]OptionalOnly these senders arrive as normal mail: user@domain or @domain (subdomains included), at most 50. Anyone else is stored as quarantined. Omitted = everyone.
StatusDescription
201The new inbox (id, address, label, sender_allowlist, status, created_at).
400validation_error — invalid handle or allow-list entry.
403agent_inbox_limit_reached — your plan’s inbox count is used; insufficient_scope — needs a full_access key.
404feature_disabled — agent inboxes are not enabled for your workspace yet.
409address_unavailable — choose another handle.
401Missing 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
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" }'
Node.js
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();
Python
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()