Quickstart

Two ways to a first message: connect the agent you already use with one address and no key, or call the API yourself with a key, in five steps with curl.

On this page
  1. The short way: connect the agent you already use
  2. 1. Get a key from the console
  3. 2. Issue an inbox
  4. 3. Receive a message
  5. 4. Read the thread
  6. 5. Reply in the thread
  7. What to do next

The short way: connect the agent you already use

An agent that speaks the Model Context Protocol needs one address and nothing else: https://api.doorman.fyi/mcp. There is nothing to install and no key to create. The agent signs in through your browser and you approve it there.

  1. Create an account at /sign-up and create an inbox in the console. Its address receives mail at once.
  2. Give your agent the address above. Connect your agent has the exact steps for each agent.
  3. Approve the agent in the browser window it opens, then ask it to read the inbox or to send a reply.

The rest of this page is for code you write yourself: the same first message over the REST API, with a key.

1. Get a key from the console

Create an account at /sign-up, then open the console's keys page and create an account key. The token is shown once; store it where your agent runs. The samples below read it from DOORMAN_API_KEY.

Check that it works with GET /v1/me, which answers with the account, its plan and usage, and the caller.

curl

export DOORMAN_API_KEY=dm_...

curl -s "https://api.doorman.fyi/v1/me" \
  -H "authorization: Bearer $DOORMAN_API_KEY"

2. Issue an inbox

One call issues an address on doorman.example that receives mail as soon as the answer arrives. Pick a mailbox name, or leave it out for a random one.

curl

curl -s -X POST "https://api.doorman.fyi/v1/inboxes" \
  -H "authorization: Bearer $DOORMAN_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "mailboxName": "concierge",
    "displayName": "Acme concierge"
  }'

The answer is the inbox. Keep its id and address:

201 Created

{
  "id": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
  "address": "concierge@doorman.example",
  "mailboxName": "concierge",
  "domain": "doorman.example",
  "displayName": "Acme concierge",
  "externalId": null,
  "metadata": {},
  "webhookUrl": null,
  "status": "active",
  "createdAt": "2026-11-05T10:05:00.000Z",
  "updatedAt": "2026-11-05T10:05:00.000Z",
  "webhook": null,
  "key": null
}

Issuing inboxes covers names, reserved names, display names, your own externalId, and the one-call issue that sets a webhook and mints an inbox-scoped key at the same time.

3. Receive a message

Send an email to the new address from any mail client, as a person would. Within a few seconds the inbox has a thread and a message, and the account's event log has a message.received event. The quickest way to see it is to poll the log from the beginning:

curl

curl -s "https://api.doorman.fyi/v1/events?after=0" \
  -H "authorization: Bearer $DOORMAN_API_KEY"

In production an agent is told rather than asking: by a signed webhook, by polling with the last seq it saw, or over the stream.

4. Read the thread

List the inbox's unread threads, then read one thread's messages, oldest first. Each message carries its text, who sent it, a category and a verdict, and its attachments with their extracted text.

curl -s "https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z/threads?isRead=false" \
  -H "authorization: Bearer $DOORMAN_API_KEY"

Receiving mail explains threads, messages, attachments, the raw and HTML bodies, and what category, verdict and autoReplyable mean.

5. Reply in the thread

A reply is a send with a threadId. The subject, the threading headers, the recipient and the quoted previous message all come from the thread; you supply the text. An Idempotency-Key makes a retried request safe: the same key with the same body replays the first answer instead of sending twice.

curl

curl -s -X POST "https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z/send" \
  -H "authorization: Bearer $DOORMAN_API_KEY" \
  -H "idempotency-key: reply-to-invoice-2847" \
  -H "content-type: application/json" \
  -d '{
    "threadId": "thr_01jc5a1b2c3d4e5f6g7h8j9k0m",
    "text": "Thanks, confirming for Thursday."
  }'

The answer is the stored outbound message, sent from concierge@doorman.example. Sending and replying covers new messages, recipients, attachments, limits and the errors a send can answer.

What to do next

  • Set a webhook so your agent is called the moment mail lands: Webhooks, or pass webhookUrl and key when you issue the inbox.
  • Give each agent you build a key of its own that reaches only its inbox: Authentication and keys.
  • Use the TypeScript client library and event-driven agent handlers instead of raw requests: The SDK.
  • Connect an agent host over the Model Context Protocol without a key, or run commands from a terminal: Connect your agent, MCP server and The CLI.
  • Read a complete integration with its source, from provisioning to a restart: Sample integration.
  • Look every call up, with TypeScript and Python samples beside the curl: the reference.

Up Down to move, Enter to open, Esc to close