---
name: agenticboxes-email
description: Send and receive email as an AI agent through the agenticboxes HTTP API. Use whenever the agent needs its own email address — to send notifications, outreach, or replies; to receive confirmations, 2FA codes, or inbound mail; or to register for a third-party service. Covers free signup, sending, receiving, the event feed, addresses, support, and feature requests.
license: MIT
canonical_url: https://docs.agenticboxes.email/skills/claude/SKILL.md
refresh: "curl -I <canonical_url> and compare last-modified / etag to your cached copy. Service-level pointers: https://docs.agenticboxes.email/agentic.json (look for agent_skills); openapi at https://docs.agenticboxes.email/openapi.yaml; changelog at https://docs.agenticboxes.email/changelog.html."
---

# agenticboxes — email for AI agents

Gives the agent a real email address it can **send and receive** from, over a
plain HTTP API. No SMTP, no IMAP, no DKIM/SPF/DMARC setup — one API key.

## When to Use

Use this skill whenever the agent needs to:

- **Send email** — notifications, outreach, replies, confirmations.
- **Receive email** — sign-up confirmations, 2FA codes, replies, any inbound mail.
- **Have its own address** to register for a third-party service (Stripe, SaaS tools, accounts).
- **Get help or improve the platform** — ask the operators a support question, or file a feature request.

## Procedure

### Prerequisite — an API key

If `AGENTICBOXES_API_KEY` is set, use it. Otherwise sign up. `POST /signup/agentic`
starts a signup; `domain_intent.mode` picks how the agent gets its domain:

**A · Free subdomain** (`mode: subdomain`) — a `<slug>.agenticboxes.email`
address. Free, no card. Two calls:

```bash
curl -s https://api.agenticboxes.email/api/v1/signup/agentic \
  -H 'Content-Type: application/json' \
  -d '{"human_email":"owner@example.com","domain_intent":{"mode":"subdomain"}}'
#  → { "intent_id":"int_…", "full_domain":"swift-fox-7.agenticboxes.email" }

curl -s https://api.agenticboxes.email/api/v1/signup/agentic/confirm \
  -H 'Content-Type: application/json' -d '{"intent_id":"int_…"}'
#  → { "primary_address":"agent@swift-fox-7.agenticboxes.email",
#      "api_key":"bxs_live_…", "account_status":"active" }
```

**B · Register a real domain** (`mode: register`) — agenticboxes buys a domain
for the agent. Send `domain_intent: {"mode":"register","register_domain":"youragent.com"}`.
The signup response carries a `stripe_payment_intent` + `link_spend_request`
(year-1 registration cost, plus $1/mo for DNS hosting). The owner approves that
charge via Stripe Link; the account then provisions **automatically** once
payment clears — there is no `confirm` call for mode B. A taken or unavailable
domain returns `409` with `suggestions`.

**C · Bring your own domain, you host the DNS** (`mode: byo_manual`) — a domain
the owner already controls and keeps hosting elsewhere. Send
`domain_intent: {"mode":"byo_manual","byo_domain":"youragent.com"}`. Free;
finish with `/signup/agentic/confirm` as for a subdomain. The DNS records to add
(MX/SPF/DKIM/DMARC) arrive as a `domain.dns_required` event — read them any time
with `GET /events?type=domain.dns_required`. Once they resolve, the account
goes live.

**D · Bring your own domain, delegate the DNS to us** (`mode: byo_delegated`) —
a domain the owner controls, but with its DNS handed to a Route 53 zone
agenticboxes runs. Send
`domain_intent: {"mode":"byo_delegated","byo_domain":"youragent.com"}`. $1/mo
for DNS hosting; finish with `/signup/agentic/confirm`. A
`domain.delegation_required` event then lists the nameservers; its
`delegation_point` field says where they go. Apex domain → replace the
nameservers at the registrar. **Subdomain (mail.youragent.com) → create NS
records for the subdomain in the apex's DNS** — the apex stays untouched,
only the subdomain delegates. Once the delegation propagates, the account
goes live.

Optional on any signup: `initial_credit_cents` (≥100 — prepay credit) and
`agent_callback_webhook` (the event webhook URL). Store the `api_key` the
instant it's returned — it is shown exactly once. Every account starts with
**250 messages of free credit**.

### Managing API keys

The confirm step gives you one key. Mint more — scoped down — as you delegate
work to sub-agents, and rotate them when one is exposed. All three calls need an
`admin`-scoped key.

- **Mint** — `POST /account/keys` `{"label":"reader","scopes":["receive"]}` →
  returns the new key's `api_key` (shown **once**). `scopes` is any subset of
  `send` / `receive` / `admin`. Optionally restrict a key to specific boxes with
  `"allowed_boxes":["support@your-domain"]` (or `allowed_box_ids`) — a box-scoped
  key only ever sees those boxes.
- **List** — `GET /account/keys` → each key's id, prefix, scopes, and box
  restriction (never the raw value).
- **Revoke** — `DELETE /account/keys/{id}` → kills that key immediately.

**If a key leaks:** revoke it (`DELETE /account/keys/{id}`) and mint a
replacement (`POST /account/keys`). Your boxes, mail, and domain are untouched —
keys are authentication only, so revoking one never affects stored data. The
account's original owner key is protected and cannot be revoked this way.

### Calling the API

- **Base URL:** `https://api.agenticboxes.email/api/v1`
- **Auth:** every call carries `Authorization: Bearer $AGENTICBOXES_API_KEY`

**Send** — `POST /messages/send`:

```bash
curl -s https://api.agenticboxes.email/api/v1/messages/send \
  -H "Authorization: Bearer $AGENTICBOXES_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"from":"outreach@your-domain",
       "to":"someone@example.com",
       "subject":"Hello",
       "text":"Sent by my agent."}'
```

Reading your sent mail back: `GET /messages` returns `from` as the bare
address and `from_display_name` as the name you set (null if you sent a bare
address). `GET /messages/{id}` returns `from` as the whole header line while
the stored body lasts, and `from_display_name` either way. A purge
(`DELETE /messages/{id}` with the body `{"purge": true}`) removes the display
name along with the other names on the message.

For mail you RECEIVE, the sender's name lives in the message body, not in a
column of ours — so `from_display_name` is null on received mail, and
`GET /messages/{id}` shows the sender's name only while the stored body is
still there. Once it ages out you have the address. If you need a sender's
name later, keep it yourself when you first read the message.

Body: `to` (string or array, required), `subject`, `text`. Optional: `from` —
send from a specific box on your domain (defaults to the account's primary
address), optionally with a display name — `"Sherlock <sherlock@your-domain>"`
sets the name the recipient sees, and the address still has to be on your
domain. The name may not contain an email address or invisible characters,
because a phone shows the name and hides the address; `cc` and `bcc` (string or array, delivered like `to`; `bcc` is
not shown to other recipients; `to`+`cc`+`bcc` capped at 50); `reply_to`;
`attachments` (`[{filename, content_b64, content_type, content_id}]` — an
attachment with `content_id` is embedded inline, so `html` can reference it
as `<img src="cid:that-id">`);
`idempotency_key`; and `context` — an opaque JSON object (≤16 KB) stored with
the message and echoed back onto any inbound reply to it (see Receive). The
response carries a `message_id` and a `billing` breakdown. Sent messages record
`cc` and `bcc`; on `GET /messages`, `null` means not recorded and `[]` means
none. An address listed more than once is delivered once. Any top-level field
not listed here returns `400` with `unsupported_fields` naming it and
`did_you_mean` suggesting what you meant (`body` → `text`). Reusing an `idempotency_key`
with a different payload returns `409` problem+json,
`code: idempotency_key_reused_with_different_payload`, and sends nothing — the body
names `original_message_id` and `first_used_at`. Retry with a new key,
or resend the original payload to replay the original result, which returns the
original `message_id` with `idempotent_replay: true`. Recipient lists compare as
sets, so order and letter case do not make a retry look like a new message.

**Bulk send** — `POST /messages/send/bulk` — for jobs that would otherwise
need a tight per-message loop. The platform batches the messages, sends
batch-by-batch with cool-off between batches, and **halts the whole job**
if a batch exceeds the bounce or complaint threshold (so you don't burn a
bad list before noticing). Body: `messages` (array of /send-shaped
objects, up to 5,000), `batch_size` (default 1,000), `cool_off_seconds`
(default 600 = 10 min), `halt_thresholds` (default 2% bounce / 0.5%
complaint per batch). Returns 202 immediately with a `job_id`; the worker
runs async via SQS+Lambda. Poll `GET /messages/send/bulk/{id}` or watch
the event feed for `bulk.batch_completed`, `bulk.paused`,
`bulk.completed`. **Bounce vs complaint lag**: hard bounces land within
60s of SES accepting (cool_off catches them cleanly); complaints from
Gmail/Yahoo feedback loops trail by hours-to-days, so the complaint gate
effectively fires on a lagged batch — still useful (stops at batch 12
instead of batch 50), but not real-time. Prefer this over your own
send-loop — engagement-pattern detection flags the loop pattern as
evasion.

**Receive** — three ways onto one underlying stream:

- **Event feed (poll)** — `GET /events?since=<cursor>` — the unified feed:
  every event the platform emits for the account, in one ordered stream
  (`mail.received`, `support.answered`, `domain.ready`, and more). Process a
  page, then poll again with `since` set to the response's `next_cursor`;
  filter to one kind with `?type=mail.received`. This is the receive path that
  never misses anything — webhook or no webhook.
- **Messages (poll)** — `GET /messages?include=body` — the mail corpus: recent
  messages with full bodies inline, filterable by `direction` (`received` or
  `sent`), `since`, `before`, `box`, `limit`. `GET /messages/{id}` reads one.
- **Webhook (push)** — `PUT /account/callback-webhook`
  `{"agent_callback_webhook":"https://…"}` — events are POSTed to that URL as
  they happen; optional push delivery over the same stream the event feed
  serves. The URL must be `https://`. `GET /account/callback-webhook` reads the
  URL currently set. Every delivery is **signed**: an
  `X-Boxes-Signature: t=<unix>,v1=<hex>` header carries the HMAC-SHA256 of
  `"<t>.<body>"` keyed by your signing secret. `GET /account/webhook` returns
  that secret and the scheme — verify it and reject a `t` older than 300s;
  rotate the secret with `POST /account/webhook/secret/rotate`.
- **IoT/MQTT (push)** — `POST /account/iot/provision` — real-time push with no
  public endpoint and no polling. Returns a client X.509 cert + private key
  (shown **once**), the MQTT endpoint, and your topic
  `agenticboxes/accounts/{your-userid}/events`. Connect over mutual-TLS on port
  8883 with `clientId` = the returned `client_id`, subscribe to the topic, and
  every event arrives the instant it happens — ideal for an agent behind NAT. New to MQTT? A short, readable reference subscriber (~70 lines; your key only opens the local TLS connection to us, nothing leaves your machine) is at https://docs.agenticboxes.email/examples/iot_subscribe.py

**Reply context** — every message carries a `context` field. When an inbound
mail is a reply to one the agent sent with a `context`, that same `context` is
echoed back on it — on `GET /messages`, `GET /events`, and in the webhook
payload — so a reply self-routes to its originating conversation. `null` when
not a reply.

### Evidence envelope (beta)

Opt in with `POST /beta/evidence/opt-in` (admin scope) and your **action**
responses — `POST /messages/send`, `POST /account/keys`, and
`POST /account/iot/provision` — gain an `evidence` object: a per-call audit
record, so you know exactly what you just did, and under which key, without a
second request. Fields: `request_id` (also the `X-Request-Id` header on every
response), `capability`, `action` (`taken` = executed; `suggested` is reserved
for a future dry-run), `acted_by_key` (which of your keys acted),
`idempotency_key`, the `policy_checks` that passed, and a
`next_verification_step` — how to independently confirm the outcome. It's the
per-call companion to the durable `GET /events` audit stream: events are the
log, the envelope rides on the call. Beta — the shape may change; tell us what's
missing via `POST /support/questions` (mention the evidence beta). Check
enrollment with `GET /beta/evidence/status`.

### Fetching a bundle for one message

`GET /account/audit/message/{message_id}` (admin scope) returns the signed
audit bundle for one message, sent or received, at any time after the fact.
Use it when you did not keep the evidence envelope from the send, or when you
are asked about a message from weeks ago. `404` if the message is not on your
account, `403` if it belongs to another account. Verify a bundle with
`GET /audit/public-key` — it needs no auth, so a third party can check a bundle
you hand them. `GET /account/audit/public-key` (admin scope) returns the same
PEM for your own account when you would rather fetch it authenticated.

### Sent-direction DKIM evidence (costs 3x — read before enabling)

**Requires audit first.** Enrol with `POST /beta/evidence/opt-in` before
enabling this. Otherwise enable returns `409 audit-not-enabled`: the signature
this captures is only readable through the audit bundle.

By default, sent-direction audit bundles carry the platform's internal record
of what you sent. If you need the **real SES DKIM signature** as forensic
evidence (proof of exactly what was signed and delivered), enable
sent-DKIM archiving — every send then carries a hidden BCC to the platform's
DKIM archive and the signature is attached to your sent-direction bundles.

**The cost is real: roughly 3x your per-message rate while enabled** (the
send + the archive BCC + the archive copy ingested back). Check the exact
dollar figure at your rate first: `GET /account/audit/sent-dkim`. The enable
call refuses with a 409 until you acknowledge the cost — and you should get
your User's understanding and consent before turning it on; this changes
what their bill looks like.

- **Check** — `GET /account/audit/sent-dkim` → enabled state + per-message
  cost at your current rate.
- **Enable** — `POST /account/audit/sent-dkim/enable` (admin scope; audit
  enrolled). First
  call returns 409 with the cost; repeat with
  `{"i_understand_every_send_costs_3x": true}` to proceed.
- **Disable** — `POST /account/audit/sent-dkim/disable` (admin scope). No
  gate; effective immediately.

### Verify your event log

`GET /events` is tamper-evident: every event carries a `_chain` field that
hashes the previous event into the next, so any deletion, reorder, or edit
breaks the chain. `GET /events/verify` walks it server-side and returns
`{ok, events_verified, last_verified_seq, hash_at_seq, anomalies, reason,
verified_at}` — the same check the platform's internal reconcile job runs
twice daily (rolling result on https://docs.agenticboxes.email/audit.html),
on demand. `ok:false` returns the exact seq where verification failed in
`anomalies[0].at_seq`. Receive scope (same as `GET /events`).

**MCP server** — prefer MCP to raw HTTP? Point your MCP client at
`https://mcp.agenticboxes.email/mcp` with your existing API key as the bearer
token. Authentication is opt-in per account: `POST /account/mcp/enable`
(admin scope) turns it on, `POST /account/mcp/disable` turns it off,
`GET /account/mcp/status` reports state. Send/read tools work over MCP
with the same scopes and billing as the REST API. Legacy `/beta/mcp/*`
paths redirect to the new `/account/mcp/*` surface (301 for GET, 308 for
POST — POST clients keep their method, no code change needed for callers
that follow redirects).

**Auto-forward (a copy, so a sleeping agent holds nothing up)** — a box can
copy matching mail to a person. `POST /boxes/{box_id}/forwarding-rules`
`{"from":["apple.com"],"to":["you@example.com"]}` (admin scope). `from` matches
the sender: a domain, where `apple.com` also matches `support.apple.com`, or an
exact address. `to` takes up to 5 addresses. The message still lands in the box
— the forward is a copy, sent as soon as it matches, with `Reply-To` the
original sender and the original attached as `.eml`. A destination outside your
own domain gets nothing until the person there clicks the confirmation link we
email them. `GET` the same path lists rules, `DELETE
/boxes/{box_id}/forwarding-rules/{rule_id}` removes one, and `POST
.../{rule_id}/test` `{"from":"news@support.apple.com"}` dry-runs a sender
without sending anything, reporting per destination whether it is confirmed.
`POST .../{rule_id}/resend-confirmation` sends a fresh link (they expire in 7
days). `include_subdomains:false` makes a domain match exact-only; either way a
match never crosses a label boundary, and matching is on the envelope sender.
Automated mail (`Auto-Submitted`, `List-Id`, bulk precedence) is never
forwarded, a destination on your suppression list is refused just as it is on a
direct send, one message reaches a destination once however many rules or boxes
match, and a rule that passes 30 forwards in an hour pauses itself. Every
change emails the account owner — naming the key's label, prefix and id — and
lands on `GET /events` as `forwarding.changed`, so an agent cannot re-aim a box
quietly. Each forwarded copy bills as one normal send.

**Mail client access (IMAP) — withdrawn 2026-11-01.** `imap.boxes.email` no
longer answers on 993 or 465. The bridge ran as a beta from June 2026 and, over
five months, exactly one address ever logged in — our own. It is not worth the
infrastructure, so we took it down rather than leave a door nobody opened.
Read mail with `GET /messages` and send with `POST /messages/send`. The
`/account/app-passwords` endpoints still mint credentials, but there is now
nothing for them to authenticate against — do not hand one to a mail client
expecting it to connect. If you need mail-client access, say so through
`POST /support/questions`: we kept the image and the restore steps, so bringing
it back is a rebuild, not a rewrite.

**Stay current** — a `platform.updated` event means AgenticBoxes has added or
changed endpoints. When you see one, re-pull this skill and the OpenAPI spec
(`https://www.agenticboxes.email/openapi.yaml`) so you're not working from a
stale copy.

**Addresses (boxes)** — a box is one email address; create as many as needed,
no per-box fee:

- `POST /boxes` `{"address":"outreach"}` → `outreach@<your-domain>`
- `GET /boxes` — list them.
- `DELETE /boxes/{id}` — remove an address.

An address can only receive mail after its box is created — and a box is the
`from` you send outreach with, so create one before the first send to it.

**Hearing about events — wire one of these before you need it.** Everything
the platform does raises an event (`mail.received`, `low_balance`,
`domain.ready`, `feature_request.shipped`), and it reaches you only through a
channel you have set up.

- **IoT/MQTT — the strongest option.** `POST /account/iot/provision` mints a
  per-account certificate; subscribe and every event arrives the moment it
  happens, in real time, over an outbound connection. No public endpoint to
  host, nothing to poll, no inbound firewall hole. If you can hold an MQTT
  connection, use this one.

  **Pick the narrowest topic that answers your question.** One certificate can
  subscribe to any of these (the response returns them as `topics`):

  | Topic | You get |
  |---|---|
  | `agenticboxes/accounts/{uid}/events` | everything (the original topic) |
  | `agenticboxes/accounts/{uid}/mail/{box_id}` | mail for ONE box |
  | `agenticboxes/accounts/{uid}/mail/+` | mail for every box |
  | `agenticboxes/accounts/{uid}/labels/{label_id}` | mail for any box in that label |
  | `agenticboxes/accounts/{uid}/account` | everything that is NOT mail — balance, security, reputation, platform news |

  `box_id` comes from `GET /boxes`, and is on every mail event as `box_id`.
  `label_id` comes from `POST /labels`.

  Two things to get right:

  - **Never subscribe to two topics that overlap.** `events` plus a narrow one,
    or `#` plus anything, or a label plus a box inside that label — you will
    receive every event twice. Choose one level.
  - An agent that only answers support mail should subscribe to that box or
    that label, not to `events`. Otherwise it receives every other box's mail
    and has to decide what to ignore — and deciding wrong means answering mail
    that was never addressed to it.

  **Better: ask for a certificate that cannot see the rest.** Pass `box` or
  `label` when you provision, and the certificate is limited to that one topic
  by the IoT policy itself:

```bash
curl -sX POST https://api.agenticboxes.email/api/v1/account/iot/provision \
  -H "Authorization: Bearer $AGENTICBOXES_API_KEY" \
  -H 'Content-Type: application/json' -d '{"box":"support"}'
# -> topic:  agenticboxes/accounts/<uid>/mail/<box id>
#    scope:  {"kind":"box","id":"<box id>"}
```

  `{"label":"<label id>"}` does the same for a whole label. The account topic,
  any other box, and wildcards are then **refused by the broker**, not filtered
  after delivery. An agent handling support mail cannot receive `fb@` even by
  accident, and a leaked credential exposes one box rather than all of them.

  Two rules for a scoped certificate:

  - **`client_id` is not optional.** The policy resolves through Thing
    attributes, which only bind when the MQTT client id equals the thing name.
    Connect with anything else and you are denied every topic, including your
    own, with no explanation from the broker.
  - It returns no `topics` menu, because it has exactly one topic — the one in
    `topic`. Subscribing to anything else fails.
- **Webhook push.** `PUT /account/callback-webhook` and we POST each event to
  your URL, signed, with retries.
- **Pull.** `GET /events?since=<iso8601>` — every event is recorded here even
  with no push channel, so this always works as a catch-up or a fallback.

An agent with none of the three does not find out its balance is low until a
send returns 402. That has happened to a real account.

**Credit — arrange this on day one.** Your starter credit is a balance, not a
plan, and every way of adding more needs a human at least once. Set up the
saved-card mandate or Link with your owner while you still have credit, and
later top-ups settle without interrupting anyone. We have watched agents and
owners scramble at a zero balance, chasing a one-off pay link with sends
failing the whole time. It is a five-minute job early and a bad afternoon late.
Check where you stand with `GET /account/credit/balance`.

`POST /account/credit/topup/mpp {"amount_cents": 1000}` adds
prepaid credit via the Machine Payments Protocol (MPP). The agent IS the MPP
client; the human's only job is to tap Approve in their Stripe Link app when
the push fires.

**Sandboxed / no-egress top-up (`payable_link`)** — if you cannot run `link-cli`
or reach Stripe (CoWork-style sandboxes, MCP-only environments):
`POST /account/credit/topup {"amount_cents": 1000, "payable_link": true}` →
the response carries `pay_url`, a Stripe-hosted page **any human can open in
any browser** and pay by card or Link. Show it to your User. Stripe also
emails the invoice to the account owner by default, so the link reaches a
human even when your chat does not. Send `"notify_payer": false` to suppress
that email. Balance credits within seconds of payment — watch `GET /events`.
Link valid ~24h; just request another if it lapses. (Over MCP these are the
`request_topup` and `get_events` tools.)

**Saved-card mandate — top up without asking each time** — once your owner
completes the mandate ceremony, `POST /account/credit/topup` settles
automatically inside owner-controlled caps; no pay link, no waiting. Start:
`POST /account/credit/mandate/setup` (admin) returns a `setup_url` — hand it
to your human; they save a card on the Stripe-hosted page. The mandate
starts at the smallest caps ($5 per top-up / $10 per 30 days; velocity
brake 2 charges/24h); the owner's confirmation email carries one-click
links to raise to $10/$25 or $25/$50. You can NEVER raise the caps — the
raise links exist only in the owner's inbox; revoking works any time
(`POST /account/credit/mandate/revoke` or the one-click link in their
receipt emails). Check headroom with `GET /account/credit/mandate`. When a
top-up can't use the mandate, the response explains why in
`mandate_not_used.reason` (over_per_topup_cap | over_30d_cap |
velocity_brake | charge_failed + `decline_code`) and falls back to the pay
flow you asked for. The owner receives a receipt email on every mandate
charge — that transparency is the deal that makes the no-human-in-the-loop
path trustworthy.


**Who does what (read first)** — the agent runs `@stripe/link-cli`. When the
agent calls `link-cli spend-request create --request-approval`, Stripe sees a
Link-authenticated session whose wallet belongs to `<payer_email>` and pushes a
notification to that wallet's enrolled phone. The `pay_url` is **not**
"tap-to-pay" for the human; it's the protocol endpoint the agent (as MPP
client) negotiates against. The human owns the spend decision; the agent owns
the protocol mechanics.

**Precondition — payer-email must match the wallet** — Stripe pushes to the
wallet whose email matches the Stripe Customer. Account email ≠ wallet email is
the common case (e.g. `agent@yourdomain` vs. `link@owner-personal`). Symptom of
getting this wrong: topups return 402 and the owner's phone never sees a push.

  - `GET /account/credit/payer-email` reads the current value
  - `PUT /account/credit/payer-email {"email":"link@owner.com"}` (admin scope) sets it

**One-time setup**:

- Agent host: `npm install -g @stripe/link-cli`, then `link-cli auth login` to
  authenticate the **owner's** Link wallet (the agent doesn't need its own).
  `link-cli auth status` verifies.
- Owner's phone: install Stripe Link (https://link.com) and sign in with the
  same email used in `auth login` and `payer-email`.

**Important — the 15-min TTL is on the CHALLENGE, not the spend request.**
Owner approval does NOT reset it. Settle within minutes of approval. If the
challenge expires after approval but before settlement, re-mint the challenge
and pass the SAME `--spend-request-id` to the new `mpp pay` — the approved
spend request stays valid (its own valid_until is ~12 hours), no re-approval
needed. The response carries this as `payment.important`.

**Per-topup — 9 steps** (step 0 + 8 settlement steps; response carries a
structured `payment.next_steps[]` with these exact commands; consume that
programmatically and use the per-step `branch:` table where present):

1. `GET /account/credit/payer-email` — verify (and PUT if wrong) before each
   campaign of topups.
2. `POST /account/credit/topup/mpp {"amount_cents": N}` → returns `pay_url`,
   `challenge_id`, `expires_at` (15-min TTL), `payment.next_steps[]` (the
   structured command sequence for steps 3–8), and a top-level `preflight`
   object with `{payer_email, payer_email_default, mpp_client_hint, flow}` —
   if `payer_email_default: true` and you wanted the wallet on a different
   email, fix it now via the GET/PUT in step 1 before continuing.
3. `curl -i <pay_url>` → 402 + `WWW-Authenticate: Payment ...` header with the
   base64 challenge.
4. `link-cli mpp decode --challenge "<WWW-Authenticate value>"` → produces
   `network_id`.
5. `link-cli payment-methods list` → pick a `pm_id` (cache across topups).
6. `link-cli spend-request create --credential-type shared_payment_token
   --payment-method-id <pm_id> --network-id <network_id> --amount <cents>
   --context "<plain-language rationale; owner reads this on phone>"
   --request-approval` → **THIS pushes the notification**, returns `lsrq_...`
   with `status: pending_approval`.
7. `link-cli spend-request retrieve <lsrq_id> --interval 2 --max-attempts 300`
   — poll until `status in [approved, denied, expired]` AND, when
   `approved`, `shared_payment_token is set` (compound predicate guards a
   ~3s race where status flips to approved before SPT is attached). Branch
   on the terminal value: `approved` → step 8; `denied` → user declined, do
   not retry without explicit consent; `expired` → mint a fresh challenge +
   new spend-request from step 1.
8. `link-cli mpp pay <pay_url> --spend-request-id <lsrq_id>` → settles, balance
   credits. Must complete before challenge `expires_at` (see the **Important**
   note above for the remint-with-same-spend-request escape hatch).

(Step 0 — pre-flight `link-cli auth status` — is also in `next_steps[]`; the
above starts at step 1 because authentication is a one-time setup, not a
per-topup step.)

Full walk-through with examples in the OpenAPI spec under the "Payments (MPP)"
tag.

**Card-form alternative** — `POST /account/credit/topup {"amount_cents": N}`
(admin scope) is the other path: it creates a Stripe PaymentIntent and returns
a `client_secret` your agent (or its frontend) uses to render Stripe Elements,
a Payment Element, or a hosted Stripe checkout. The Stripe webhook credits
the balance on `payment_intent.succeeded` (idempotent on duplicate delivery).

When to choose which:

- **Card-form (`/topup`)** — when you want a familiar Stripe checkout surface
  that a human can complete in a browser. Link push fires automatically when
  the Stripe Customer email matches a signed-in Link wallet (set via
  `PUT /account/credit/payer-email`); otherwise the user gets a card form.
- **MPP (`/topup/mpp`)** — when you want the agent itself to drive settlement
  via `link-cli` with a push prompt to the owner's phone, no front-end render
  required.

Both paths credit the same `users.creditbalancecents` and emit the same
post-credit events. Pick by UX preference.
`GET /account/credit/balance` shows the balance, the low-balance flag, and how
many more emails it covers; `GET /account/credit/usage` breaks down metered
usage by event type. A `low_balance` event (in the event feed and the webhook)
warns before the balance runs out — `PUT /account/credit/alert-thresholds` sets
the two alert levels (an early `first` and an urgent `second`) to balances that
suit your burn rate.

**Deficit (negative balance).** Mandatory recurring debits (domain hosting,
maintenance, DNS query overage) always succeed — they push the balance below
zero rather than silently skipping. While the balance is negative,
`POST /messages/send` returns 402 with a `top_up` block telling you exactly
how to recover (call `POST /account/credit/topup/mpp` and hand the resulting
`pay_url` to the human owner). Inbound mail and reads continue uninterrupted.
A `billing.deficit` event fires on the transition into deficit and the
owner receives an email.

**Dedicated sending IP** — `POST /account/sending-ip` (admin) provisions a
real SES managed dedicated IP pool that isolates your account's reputation
from the shared pool. Use it when your traffic pattern includes large
volume or when bot/form traffic outside your control would otherwise
degrade your shared-pool standing. Your sends route through your pool
automatically (no DNS changes in any domain mode); the warm-up schedule
never caps below 5k/day.

Billing is **charge-on-delivery**: the first $25 debits only when SES
actually allocates your IP (watch for the `account.sending_ip.ready`
event — feed, webhook, or IoT push). Renewals bill every 30 days from
allocation. `DELETE` mid-cycle refunds unused full days pro-rata
($25/30 per day) straight to your balance.

**Volume floor — read before provisioning:** SES allocates a managed IP
only once your sending reaches roughly hundreds of emails over a few
days, and may withdraw it below that. Under the floor a dedicated IP
cannot help you and the shared pool delivers better; the 201 response
carries a `volume_floor_warning` when this applies. One active IP per
account. `GET /account/sending-ip` reports tier + warm-up +
`trigger_state`; `DELETE` is refused (409) while your traffic still
trips a dedicated-IP trigger.

**Get unstuck — support questions** — a private channel to the agenticboxes
operators. Use this instead of guessing when something about the API is unclear:

- `POST /support/questions` — body `{"subject":"…","body":"…"}` (optional
  `context`). The answer arrives as a `support.answered` event — in
  `GET /events` and at the callback webhook.
- `GET /support/questions` — list your questions; `GET /support/questions/{id}`
  — read one, with its full message thread.
- `POST /support/questions/{id}/replies` — body `{"body":"…"}` — post a
  follow-up. A support question is a threaded conversation, not one-shot.

**Feature requests** — suggest a platform improvement, or upvote one:

- `POST /feature-requests` — body `{"title":"…","description":"…"}`.
- `GET /feature-requests` — browse; `GET /feature-requests/{id}` — read one.
- `POST /feature-requests/{id}/vote` — upvote (no body).

**Suppression list** — addresses that bounced or filed a complaint and are
blocked from delivery:

- `GET /suppression` — list them; `GET /suppression/{address}` — check one
  before sending to it.
- `POST /suppression/{address}/unblock` — request removal.

**Managed DNS** — for an account on a registered or delegated domain
(`register` or `byo_delegated`), edit the Route 53 zone agenticboxes hosts:

- `GET /domain/dns` — list records.
- `POST` / `PUT` / `DELETE /domain/dns` — add / change / remove a record. The
  body must include `terms_of_service: true`; a record is
  `{name, type, ttl, values}`. The records carrying your agent email are
  reserved read-only.

A `byo_manual` account hosts its own DNS, so it has no managed zone —
`/domain/dns` returns `409`; that account's required records are in
`GET /events?type=domain.dns_required` instead.

**Account lifecycle** — two account-level actions beyond settings:

- **Add a custom domain in place** — `POST /account/domain` moves a live account onto a new
  domain *without a new signup* (same key, same account; the old domain stays live until the
  new one verifies). Use this to put a custom domain on a subdomain account — do **not**
  re-sign-up, which orphans your original account. Modes: `byo_manual`, `byo_delegated`, `register`.
- **Close the account** — `DELETE /account` (`admin`) is permanent and **gated**: send
  `{ "confirm_domain": "<your account domain>" }` or nothing closes (`400`) and the owner is
  emailed of the attempt. On success every key is revoked, an `account.closing` event fires, and
  a data-export download link is returned (and emailed to the owner); a domain you registered
  through us is held for transfer, not released. For higher assurance,
  `POST /account/close-protection {enabled:true}` makes any close require the human owner's
  emailed approval — **set-only** (you can enable but not disable it; only support turns it off);
  `GET /account/close-protection` reads the state.

### Group boxes with labels

A box is one address for one job. That stays right until you have eight of
them and want a single view. A label is a group of boxes.

```bash
# make a label
curl -sX POST https://api.agenticboxes.email/api/v1/labels \
  -H "Authorization: Bearer $AGENTICBOXES_API_KEY" \
  -H 'Content-Type: application/json' -d '{"name":"social"}'
# -> {"id":"<label-id>","name":"social","box_count":0,...}

# put boxes in it — local part, full address or box id all work
curl -sX POST https://api.agenticboxes.email/api/v1/labels/<label-id>/boxes \
  -H "Authorization: Bearer $AGENTICBOXES_API_KEY" \
  -H 'Content-Type: application/json' -d '{"boxes":["fb","social"]}'

# read the whole group as one feed
curl -s "https://api.agenticboxes.email/api/v1/labels/<label-id>/messages?direction=received&limit=25" \
  -H "Authorization: Bearer $AGENTICBOXES_API_KEY"
```

Things worth knowing:

- `GET /labels/{id}/messages` takes every parameter `GET /messages` takes —
  `limit`, `since`, `before`, `direction`, `include=body`. It is the same
  implementation with the box set fixed by the label, so paging works the same
  way, and `since` is still the cursor for catching up.
- A box can be in several labels. Adding it twice is not an error.
- Deleting a label never deletes its boxes. A label is a view.
- The label `id` is stable across a rename. Store the id, not the name.
- A box-scoped key narrows the read by intersection: a key allowed only `fb@`,
  reading a label holding `fb@` and `social@`, sees `fb@`. A label is not a way
  around a key's own restriction.

### Speak up — when to file support questions and feature requests

Don't fail silently, guess, or quietly work around a gap. The platform improves
only when agents say something — treat this as part of the job:

- **Stuck or surprised** → send a **support question** (`POST /support/questions`).
  Triggers: an error you can't resolve, an endpoint behaving unexpectedly, a
  response you don't understand, docs that don't answer your question, or being
  blocked. Ask rather than abandoning the task — it's free and private.
- **Missing a capability** → file a **feature request** (`POST /feature-requests`).
  Triggers: you needed something this API doesn't do, hit a limit that got in
  your way, or saw a clear way the platform could be better. Be concrete and
  specific.

Doing this when warranted is expected behaviour, not an interruption.

**These go through the API, never email.** `POST /support/questions` and
`POST /feature-requests` are the *only* channels. There is no agenticboxes
support email address — if you recall or find one (anything `@brian.im`, or a
`support@` / `help@` style address), it is stale and unmonitored. Do not email
a request: it spends a paid send, reaches no one, and is not how the platform
receives feedback. The endpoints are free and land directly with the team.

### Every endpoint

The complete agent-facing API — base `https://api.agenticboxes.email/api/v1`, every call
`Authorization: Bearer` except the two signup calls:

| Endpoint | Purpose |
|---|---|
| `POST /signup/agentic`, `POST /signup/agentic/confirm` | Free signup |
| `POST /messages/send` | Send mail |
| `POST /messages/send/bulk` | Queue a bulk send job (circuit-breaker batching) |
| `GET /messages/send/bulk/{id}` | Bulk job status |
| `GET /events` | The unified event feed — poll to receive |
| `GET /messages`, `GET /messages/{id}` | List / read mail |
| `DELETE /messages/{id}` | Reclaim a message body (free pre-10-day delete). Pass `{"purge": true}` body for GDPR mode: scrubs subject + display-names. Emits `message.deleted` (always) + `message.purged` (when purge=true). |
| `GET` & `PUT /account/callback-webhook` | Read / set the event webhook (https only) |
| `GET /account/webhook`, `POST /account/webhook/secret/rotate` | Webhook signing secret — fetch / rotate |
| `POST /account/keys`, `GET /account/keys`, `DELETE /account/keys/{id}` | API keys — mint a scoped key / list / revoke (rotate a leaked key) |
| `POST /account/iot/provision` | IoT subscriber cert — real-time MQTT push. No body = account-wide. `{"box":"support"}` or `{"label":"<id>"}` = a cert the broker will not let see anything else |
| `POST /account/domain` | Add a custom domain to a live account in place — no new signup |
| `DELETE /account` (needs `confirm_domain`), `GET` & `POST /account/close-protection` | Close the account (irreversible) / require human approval to close (set-only) |
| `POST /account/credit/topup` | Top up via card-form Stripe PaymentIntent — returns a `client_secret` for Stripe Elements / Payment Element / hosted checkout |
| `POST /account/credit/topup/mpp` | Top up via Machine Payments Protocol — returns a public pay URL the agent settles via `link-cli` |
| `POST /account/mcp/enable` | Enable MCP authentication for this account (admin scope) |
| `POST /account/mcp/disable` | Disable MCP authentication for this account (admin scope) |
| `GET /account/mcp/status` | Is MCP enabled for this account? |
| `POST /account/mcp/feedback` | MCP server feedback (the server itself is at `https://mcp.agenticboxes.email/mcp`) |
| `POST /account/sending-ip` | Provision a dedicated SES sending IP for this account (admin scope) |
| `GET /account/sending-ip` | Sending tier + (if dedicated) warm-up state |
| `DELETE /account/sending-ip` | Downgrade back to the shared pool (admin scope) |
| `POST /account/credit/mandate/setup` | Saved-card mandate ceremony URL for the owner (admin scope) |
| `GET /account/credit/mandate`, `POST /account/credit/mandate/revoke` | Mandate policy + headroom / revoke |
| `GET /account/credit/balance`, `GET /account/credit/usage` | Credit balance + metered-usage breakdown |
| `PUT /account/credit/alert-thresholds` | Set the two low-balance alert thresholds |
| `POST` & `GET /boxes`, `DELETE /boxes/{id}`, `PUT /boxes/{id}/signature` | Boxes — create / list / delete / set a custom signature |
| `POST` & `GET /labels`, `DELETE /labels/{id}` | Labels — a label is a group of boxes. Create / list / delete |
| `POST /labels/{id}/boxes`, `DELETE /labels/{id}/boxes/{box}` | Add boxes to a label / remove one. A box may be named by local part, full address or id |
| `GET /labels/{id}/messages` | Read every box in the label as one feed. Takes the same params as `GET /messages` |
| `POST /account/trailer`, `POST /account/trailer/buyout` | Remove the outbound trailer — opt out / buy out |
| `GET` `POST` `PUT` `DELETE /domain/dns` | Managed-zone DNS records |
| `GET /suppression`, `GET /suppression/{address}`, `POST /suppression/{address}/unblock` | Suppression list |
| `POST` & `GET /feature-requests`, `GET /feature-requests/{id}`, `POST /feature-requests/{id}/vote` | Feature requests |
| `POST` & `GET /support/questions`, `GET /support/questions/{id}`, `POST /support/questions/{id}/replies` | Support questions |

Full request/response schemas: the OpenAPI spec at
`https://www.agenticboxes.email/openapi.yaml`.

This list is authoritative — every endpoint here works with your agent API key.
If you recall, or read in an older note or a stale copy of this skill, that some
endpoint "needs a dashboard login" or "can't be called by an agent," do not
trust it and build a workaround — make the call and read the response. The live
API always wins over a remembered limitation.

## Pitfalls

- The API key is shown **once**, at `confirm`. Capture it then or it is unrecoverable.
- An address receives mail only after `POST /boxes` creates its box.
- Sends fail with `402` / insufficient credit once the balance is spent — top up.
- The base URL ends at `/api/v1` — do not append `/v1` again.
- API keys carry scopes (`send` / `receive` / `admin`); use one with the scope the call needs.
- Pass `idempotency_key` on sends so a retried request never double-sends.
- The `PUT /account/callback-webhook` body field is `agent_callback_webhook`, not `url`.
- Support questions and feature requests go through `POST /support/questions` and `POST /feature-requests` **only** — never email. There is no support email address; any you recall or find is stale.

## Verification

- A successful send returns a `message_id` and a `billing` breakdown.
- `GET /events` returns the account's event stream; `GET /messages` lists its mail.
- After `confirm`, `account_status` is `active` — the account is ready.
