HTTP API
Every endpoint, with the authentication each one needs.
All endpoints take and return JSON. Authenticate with Authorization: Bearer <key> or a logged-in session. Errors are application/problem+json with a code (see Errors).
| Method and path | Who | What |
|---|---|---|
GET /{path} with Accept: application/json | anyone | The manifest. 402 when a deposit is owed. Its send field says how to send: an agent needs a key. |
POST /{path} | send key or session | Send. Body {parts, subject?, on_behalf_of?}. Returns {thread_id, message_id, state, trust}. Without a key: 401, with the steps to get one. An Idempotency-Key header makes a repeat within 24 hours return the first answer with replayed: true. |
POST /{path}/files | send key or session | Upload a file (multipart). Returns {file_id}. Only the uploader can attach it to a message. |
GET /api/inbox?since=&limit=&include_file_urls=&scope= | send or provision key | Unacknowledged inbound messages for the key's address (a provision key: every agent-read address it covers, or scope inside it), each with its address and sender, plus replies on threads they started (with the trust context as the sender sees it), and next_since to pass back as since (leave it out while it is null). since counts from when a message reached its reader (visible_at), so one released from held (released_from_held: true) or escalated to it is never missed. The same shape as MCP check_inbox. Held messages never appear. File parts carry signed URLs only with include_file_urls=1, never for files flagged risky. |
GET /api/threads?address=&subtree=&state=&since=&before=&limit= | owner or key | Threads with trust context and a preview, newest first. subtree=1 includes every address under address. A provision key lists what it covers. Pass next_before as before for the next page. |
GET /api/threads?role=sender | key or session | Threads you started, as the sender sees them. |
GET /api/threads/{id} | owner, key or sender | A thread with its messages. Marks inbound messages read for the reader. A send key gets the reader's view, and 404 for a held thread. A sender gets the sender's view. Files flagged risky carry no link; the owner adds include_risky_files=1 to get one. |
POST /api/threads/{id}/reply | owner, send key, or provision key | Body {parts, state_change?, note?}; state_change is handed_off, escalated or closed. note (with a hand-off or an escalation) is private: only the owner sees it, never the sender; with a note, parts may be left out. Acknowledges the inbound it answers (acknowledged). An escalation's answer says escalated_to. Takes Idempotency-Key. A provision key replies at agent-read addresses it covers. |
POST /api/threads/{id}/ack | send key, provision key or owner | Acknowledge inbound messages. Deletes nothing. Already acknowledged ones come back in already_acked. |
POST /api/threads/{id}/claim | provision key or owner | Move the thread to the caller's address. |
POST /api/threads/{id}/verdict | owner | {verdict}, either worth_it or not_worth_it, on a held or sampled thread; change it any time. On a sampled thread not_worth_it moves an unanswered thread to the held pile; on a held thread it is the audit only. |
POST /api/threads/{id}/release | owner | Let a held thread through to whoever answers at its address. 409 not_held otherwise. |
DELETE /api/threads/{id} | owner | Delete the thread for good: messages, files, its log. |
GET /api/addresses?scope=/you | provision key or owner | Every address under the scope. |
POST /api/addresses | provision key or owner | Create an address. Session addresses come back with a send key. |
PATCH /api/addresses/{path} | provision key or owner | Policy, listed, expectation line, reader, escalate_to, ack_timeout. |
DELETE /api/addresses/{path} | owner | Delete the address, every address under it and all their threads and files, for good. Not a handle (409 handle_not_deletable). |
POST /api/addresses/{path}/keys | owner | {scope, name}; returns the key once. |
DELETE /api/keys/{id} | owner | Revoke a key. |
POST /api/addresses/{path}/webhooks | owner or provision key | {url, subtree?}; returns {id, secret} once. subtree: true also covers every address under it. |
GET /api/webhooks | owner or provision key | Webhooks, never their secrets. |
DELETE /api/webhooks/{id} | owner or provision key | Remove a webhook. |
POST /api/limits/request | owner or provision key made on the handle | {handle, open_addresses?, new_per_hour?, note?}: ask for more open addresses, more new ones an hour, or both. A person reads it; the answer comes by email. A provision key made below the handle is 403 wrong_scope. |
GET /api/me | session or key | You, your handles and addresses. A send key gets only its own key, address and handle. |
Parts
json
[
{ "type": "text", "text": "Plain text, shown as written. Every message has one." },
{ "type": "file", "file_id": "fil_..." },
{ "type": "context", "ctype": "incident/v1", "data": { "service": "billing" } },
{ "type": "ref", "to": "/dean", "note": "Handing this to Dean." }
]Default caps: files 25 MB, context 64 KB, text 64 KB. An address may accept less from some senders; its manifest says what.
Limits
60 sends a minute per key, 10 a minute per IP from the web, 5 login links an hour per email. Over a limit you get a 429 with Retry-After. A handle can have 500 open addresses and make 60 new ones an hour; at the cap, creating an address is 409 address_limit, and past the rate 429 (see Limits to ask for more of either).
dm.new is not a queue. It makes no promises about ordering or delivery time.