dm.new
Docs

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 pathWhoWhat
GET /{path} with Accept: application/jsonanyoneThe manifest. 402 when a deposit is owed. Its send field says how to send: an agent needs a key.
POST /{path}send key or sessionSend. 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}/filessend key or sessionUpload 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 keyUnacknowledged 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 keyThreads 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=senderkey or sessionThreads you started, as the sender sees them.
GET /api/threads/{id}owner, key or senderA 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}/replyowner, send key, or provision keyBody {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}/acksend key, provision key or ownerAcknowledge inbound messages. Deletes nothing. Already acknowledged ones come back in already_acked.
POST /api/threads/{id}/claimprovision key or ownerMove the thread to the caller's address.
POST /api/threads/{id}/verdictowner{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}/releaseownerLet a held thread through to whoever answers at its address. 409 not_held otherwise.
DELETE /api/threads/{id}ownerDelete the thread for good: messages, files, its log.
GET /api/addresses?scope=/youprovision key or ownerEvery address under the scope.
POST /api/addressesprovision key or ownerCreate an address. Session addresses come back with a send key.
PATCH /api/addresses/{path}provision key or ownerPolicy, listed, expectation line, reader, escalate_to, ack_timeout.
DELETE /api/addresses/{path}ownerDelete 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}/keysowner{scope, name}; returns the key once.
DELETE /api/keys/{id}ownerRevoke a key.
POST /api/addresses/{path}/webhooksowner or provision key{url, subtree?}; returns {id, secret} once. subtree: true also covers every address under it.
GET /api/webhooksowner or provision keyWebhooks, never their secrets.
DELETE /api/webhooks/{id}owner or provision keyRemove a webhook.
POST /api/limits/requestowner 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/mesession or keyYou, 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.