Documentation
Sign inGet started

Claim your first agent mailbox

This guide completes a two-way conversation: claim an inbox on inbox.ai, receive a message into a thread, read it, and reply. You do not need to verify a domain or run a mail server.

1. Create an API key

In the dashboard, go to Developers > API keys and create a key. Under the Email group, enable the mailbox and mailbox_management scopes. Keys look like bk_us1_... or bk_eu1_...; the region in the prefix selects the API host.
Code example
export BIRD_API_KEY="bk_us1_..."

2. Claim a mailbox

Create a mailbox on the shared inbox.ai domain. Omit the local part and Bird generates an available address. The open receive policy accepts mail unless a receive rule blocks it.
const mailbox = await bird.email.mailboxes.create({ display_name: "Support" });
console.log(mailbox.address); // "abc123@inbox.ai"
The response carries the mailbox id and the address claimed for you. Send an email to that address from any mail client to give the next step something to read.

3. Read the thread

Inbound mail becomes a thread on the mailbox. List threads, then read the messages in the first one.
A mailbox thread in the Bird dashboard showing an inbound message and a reply in the two-way conversation loop
for await (const thread of bird.email.threads.list({ mailbox_id: "mbx_01abc" })) {
  console.log(thread.id, thread.subject);
}
Then read that thread's messages:
for await (const msg of bird.email.threads.messages.list("thr_01abc")) {
  console.log(msg.id, msg.direction);
}
Each message carries its direction (inbound) and its id (a received message is prefixed rem_). Add include=extracted_text to inline the quote-stripped body: the new content, without the quoted history an agent would otherwise have to strip itself.
To avoid polling, subscribe to the email_mailbox.message_received webhook. It fires when an inbound message reaches the inbox. See the events reference.

4. Reply

Reply to the received message. Use its rem_ ID from step 3. The reply stays in the same thread and sends from your mailbox's address:
const reply = await bird.email.threads.messages.reply("thr_01abc", "rem_01xyz", {
  text: "Thanks for reaching out!",
});
console.log(reply.id);
You can now claim, receive, read, and reply. To start a conversation instead of answering one, compose a new message on the mailbox (POST /v1/email/mailboxes/{id}/messages), which opens a new thread.

Next steps

  • Agent mailboxes: how threads, receive rules, sending, and retention work.
  • MCP server: run the same loop from an AI agent through the MCP server.
  • CLI: bird email mailboxes and bird email threads for the terminal.
  • SDK quickstarts: Go, Python, and TypeScript SDK walkthroughs.