Update an agent inbox

Change the label or the sender allow-list of an agent inbox with PATCH /v3/agent-inboxes/{id}; the address itself never changes.

PATCH /v3/agent-inboxes/{id}

Request body
ParameterTypeRequiredDescription
labelstring | nullOptionalYour name for the inbox; null clears it.
sender_allowliststring[] | nullOptionalOnly these senders arrive as normal mail (user@domain or @domain); null or [] = everyone. Takes effect within 30 seconds.
StatusDescription
200The updated inbox.
400validation_error — invalid allow-list entry.
403insufficient_scope — needs a full_access key.
404No such inbox on your workspace, or feature_disabled.
401Missing or invalid API key.

Use an address on your own domain

Attach hello@agents.papergo.io to the inbox and mail to it lands here next to mail to the wemail address; replies to that mail go out from your own domain. The domain must be verified under Domains and receiving (inbound turned on, its MX pointing to wemail) — use a subdomain such as agents.papergo.io so your company mailboxes keep their MX. At most 10 per inbox. No DNS at all: forward a mailbox you already have (e.g. support@papergo.io in Google Workspace or Microsoft 365) to the inbox’s wemail address instead.

POST /v3/agent-inboxes/{id}/addresses

DELETE /v3/agent-inboxes/{id}/addresses/{address}

Errors: 409 domain_not_verified, 409 domain_not_receiving, 409 address_in_use, 403 own_address_limit_reached, 400 validation_error (a wemail address or an invalid one). Detaching hands the address back to your normal inbound routes for that domain; wemail addresses are never removed.

Code examples

cURL
curl -X PATCH https://api.wemail.io/v3/agent-inboxes/{id} \
  -H "Authorization: Bearer afn_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "sender_allowlist": ["@client.example.com"] }'
Node.js
const res = await fetch("https://api.wemail.io/v3/agent-inboxes/{id}", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.WEMAIL_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ "sender_allowlist": ["@client.example.com"] }),
});
const data = await res.json();
Python
import os, requests

r = requests.patch(
    "https://api.wemail.io/v3/agent-inboxes/{id}",
    headers={"Authorization": f"Bearer {os.environ['WEMAIL_API_KEY']}"},
    json={ "sender_allowlist": ["@client.example.com"] },
)
data = r.json()