---
title: "Quickstart"
description: "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."
url: https://doorman.fyi/docs/quickstart
markdown: https://doorman.fyi/docs/quickstart.md
area: "Guides"
section: "Get started"
---

# 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.

Source: https://doorman.fyi/docs/quickstart

## 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](https://doorman.fyi/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](https://doorman.fyi/docs/connect.md) 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](https://doorman.fyi/sign-up), then open [the console's keys page](https://doorman.fyi/console/keys) 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`](https://doorman.fyi/docs/reference/account.md#me), which answers with the account, its plan and usage, and the caller.

curl:
```sh
export DOORMAN_API_KEY=dm_...

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

> Note: The Free plan includes 3 inboxes and 3000 sends a month, which is enough to follow this page. Receiving is never capped.

## 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:
```sh
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:
```json
{
  "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](https://doorman.fyi/docs/inboxes.md) 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:
```sh
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](https://doorman.fyi/docs/webhooks.md), by [polling](https://doorman.fyi/docs/events.md) with the last `seq` it saw, or over [the stream](https://doorman.fyi/docs/stream.md).

## 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.

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

A thread's messages:
```sh
curl -s "https://api.doorman.fyi/v1/threads/thr_01jc5a1b2c3d4e5f6g7h8j9k0m/messages" \
  -H "authorization: Bearer $DOORMAN_API_KEY"
```

[Receiving mail](https://doorman.fyi/docs/receiving.md) 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:
```sh
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](https://doorman.fyi/docs/sending.md) 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](https://doorman.fyi/docs/webhooks.md), or pass `webhookUrl` and `key` when you [issue the inbox](https://doorman.fyi/docs/inboxes.md#one-call).
- Give each agent you build a key of its own that reaches only its inbox: [Authentication and keys](https://doorman.fyi/docs/authentication.md).
- Use the TypeScript client library and event-driven agent handlers instead of raw requests: [The SDK](https://doorman.fyi/docs/sdk.md).
- Connect an agent host over the Model Context Protocol without a key, or run commands from a terminal: [Connect your agent](https://doorman.fyi/docs/connect.md), [MCP server](https://doorman.fyi/docs/mcp.md) and [The CLI](https://doorman.fyi/docs/cli.md).
- Read a complete integration with its source, from provisioning to a restart: [Sample integration](https://doorman.fyi/docs/sample.md).
- Look every call up, with TypeScript and Python samples beside the curl: [the reference](https://doorman.fyi/docs/reference.md).
