Postyard docs
How to set up Postyard, connect an assistant or an agent, what each tool may change, and what to do when something doesn't work.
On this page
What Postyard is
Postyard is email hosting on domains you own, for people and AI agents. Each mailbox is a normal mailbox. People read it in the web inbox or any mail app over IMAP and SMTP. Agents use the same mailbox over a hosted MCP server, a REST API and signed webhooks.
An agent starts with the least access that is useful. It reads mail and writes drafts, in the mailboxes you choose. A person reviews a draft and sends it. Sending by the agent itself is a separate permission.
Postyard hosts mail only. It has no calendars or contacts, and it doesn't connect to an existing Gmail or Outlook account.
Set up
- Sign up at app.postyard.dev and create an organization.
- Add a domain. Postyard lists the DNS records to publish and checks each one. The domain stays at its registrar.
- Once the domain is verified, create a mailbox, such as
support@harborlight.example. - Add the server to your app: connect Claude, ChatGPT, Cursor, VS Code, Vercel Connect or n8n. The URL is the same everywhere:
https://api.postyard.dev/mcp- Sign in when the app asks, then open Agents & API > Connections in Postyard, find the app and click Choose mailboxes. Until you do, the app reaches no mail.
- Ask the app: “List my Postyard mailboxes and tell me which have unread mail.”
You need an active subscription for real mail. Before that, an app that signs in works on the demo mailbox.
The demo mailbox
If your organization has never subscribed, has no mailboxes and never had an API key or
connection, an app that signs in gets one demo mailbox,
hello@harborlight.example, with five sample conversations. Listing, reading,
searching and drafting work. Nothing is sent or received, and no real mail is in it.
-
list_mailboxesmarks it with"demo": trueand says what to do next. - Drafts the app writes appear at app.postyard.dev/setup, labeled with the app that wrote them. Each app sees only its own drafts.
- The send tools answer
demo_mailbox. - Limits: 20 drafts per person, 20 KB of text and 50 recipients per draft. A draft is deleted 30 days after its last edit. You can also delete the demo data yourself on the set-up page.
To move to real mail, subscribe and create a mailbox. You don't reconnect the app. Its next call returns an empty list and a hint. Choose its mailboxes, and the call after that sees real mail.
Some clients don't get the demo mailbox. Their tools answer
setup_required until the organization is set
up. API keys don't get it either.
Signing in
| OAuth sign-in | API key | |
|---|---|---|
| Best for | Assistants people use | Scripts, servers, workflow tools |
| Set up | Paste the URL, sign in with your Postyard account | Create a key under Agents & API > API keys, send it as Authorization: Bearer py_live_... |
| Works on | The MCP server only | The MCP server and the REST API |
| Starts with | Read and draft, no mailboxes | The permission set and access you pick |
| Stop it | Revoke under Connections | Revoke under API keys |
There are three permission sets. Each can be limited to chosen domains or mailboxes; anything outside answers 404.
- Read and draft: read mail and write drafts. It can't send anything.
- Read, draft and send: the same, plus sending mail.
- Admin: everything, including domains, API keys and webhooks.
To let a connection send, an admin opens Agents & API > Connections, clicks Edit and picks Read, draft and send. Add a daily cap for it on the Quotas and limits page.
The OAuth server supports automatic client registration: client ID metadata documents
and dynamic client registration, both with PKCE. You don't create a client ID or
secret. Clients should request the scopes profile email user:org:read.
The 13 tools
Reading never marks mail as read. Drafts appear in the Drafts folder of any mail app, and in the web inbox with the name of the agent that wrote them.
| Tool | What it may change | Permission |
|---|---|---|
list_mailboxesLists the mailboxes this connection can reach | Nothing | Read |
list_conversationsLists conversations, newest first, with filters and search | Nothing | Read |
get_conversationReads one conversation and its messages | Nothing | Read |
get_messageReads one message with its body | Nothing | Read |
get_attachmentDownloads one attachment, up to 10 MB | Nothing | Read |
create_draftWrites a new draft | Adds a draft. Nothing is sent | Draft |
create_reply_draftWrites a reply draft in the same thread | Adds a draft. Nothing is sent | Draft |
update_draftReplaces a draft's recipients, subject and body | Overwrites that draft's content. With replace: true it also drops its attachments and HTML | Draft |
delete_draftDeletes a draft that wasn't sent | Removes that draft | Draft |
mark_handledMarks a message as handled, or clears the mark | That mark only. Never the unread state | Draft |
send_draftSends an existing draft | Sends email to its recipients. It can't be undone | Send |
reply_to_messageWrites a reply and sends it at once | Sends email. It can't be undone | Send |
send_messageWrites a new message and sends it at once | Sends email. It can't be undone | Send |
No tool changes domains, mailboxes, keys or billing. The send tools take an optional
idempotency_key: a retry with the same key never sends twice.
Email is untrusted input. A message can contain text that tries to steer your assistant. Keep agents on read and draft unless they must send, limit each one to its own mailboxes, and tell it to ignore instructions inside email.
Limits
| What | Limit |
|---|---|
| Requests | 20 a second per organization, with bursts of 100 |
| Conversations per page | 1 to 100, 25 by default |
| Search | 200 characters and 8 words, matched in subjects, senders, recipients and previews. Not in bodies |
Message body in get_message | 100 KB, then cut and marked truncated |
Attachment in get_attachment | 10 MB |
| Attachments when sending | 17 MiB and 20 files per message. Upload them over the REST API; the MCP tools write text and simple HTML |
| Recipients | 50 per message |
| Subject | 998 bytes |
| HTML in a draft | 512 KB, simple formatting only |
| Sends | 30 a minute |
| External recipients in 24 hours | 200 until the first payment, 1,000 in the 30 days after it, then 10,000 |
| Request log | Kept 30 days, under Agents & API > Request log |
Troubleshooting
Every error has a code, a message and, over HTTP, a
request_id. Give us the request_id when you
write to support.
The app connects, but the mailbox list is empty
No mailbox was chosen for this connection. Open Agents & API > Connections, find the app, click Choose mailboxes and save. The person who connected the app can do this once. After that, an admin can change it. You don't need to reconnect.
setup_required
“Postyard is not set up for this account yet.” The account has no working organization behind it. Some clients get this before set-up, because they don't get the demo mailbox. Finish at app.postyard.dev/setup, then ask again in the same chat. You don't need to reconnect.
demo_mailbox
The app tried to send from the demo mailbox. Nothing can be sent from it. Ask for a draft instead; it appears at app.postyard.dev/setup. To send, set up a domain and a mailbox there, then choose the app's mailboxes and grant sending.
choose_organization
This connection is for an organization that isn't set up, and you belong to another one or were removed from one. Remove the connector in your app, add it again, and pick the other organization on the sign-in page. Or finish setting up the first one.
not_synced
Your organization or your membership is new, and Postyard hasn't seen it yet. Open app.postyard.dev once, or wait a minute and ask again.
The connection was revoked
Calls answer 403 forbidden. Signing in again doesn't help. An admin opens
Agents & API > Connections and clicks Restore.
An app you removed from the demo stays out, also after you subscribe. Click
Allow again at
app.postyard.dev/setup, then reconnect.
missing_scope
The connection lacks a permission, most often mail.send. An admin changes it
under Agents & API > Connections. If you only wanted a draft, ask
for a draft.
insufficient_scope
You belong to several organizations and the app didn't ask which one to use. Reconnect
and pick an organization. If you build the client, request the scope
user:org:read.
Other errors
| Error | What it means | What to do |
|---|---|---|
401 unauthenticated | The token or key is missing, wrong, expired or revoked | Sign in again, or check the key |
402 billing_required | The organization's subscription doesn't allow this | An admin checks the Plan page |
not_found | The item doesn't exist, or is outside this connection's mailboxes | List again, or change the connection's access |
draft_has_html | The draft was written in a mail app or the web inbox | Leave it to the person, or pass replace: true to overwrite it |
attachment_too_large | The file is over 10 MB | Download it over the REST API or in a mail app |
429 rate_limited | Too many requests | Wait for retry_after seconds |
429 limit_reached | A limit, or the organization's spending limit | An admin raises it |
REST API and webhooks
Everything the tools do is also in the REST API, plus domains, mailboxes, attachments, exports, scheduled sends and webhooks.
- llms.txt: the whole reference as one text file, for you or your agent.
- OpenAPI document: every endpoint and schema.
- Agent setup prompt: paste it into Claude to triage a mailbox.
Webhooks post JSON to your URL when something happens, such as
message.received. Each delivery is signed with the
Standard Webhooks scheme.
This guide verifies one in code.
Your data
- An app reaches only the mailboxes you chose for it.
- What an app reads goes to that app's provider, under that provider's terms.
- We don't use the content of your mail for advertising or to train AI models.
- Revoke an app at any time under Agents & API > Connections.
The privacy policy has what we keep and for how long.
All guides
- Connect an app: Claude, ChatGPT, Cursor, VS Code, Vercel Connect and n8n
- Automation tools: n8n, Zapier, Gumloop and Lindy
- App builders: Voiceflow, Lovable and Bolt
- Agent SDKs: OpenAI Agents SDK, Claude Agent SDK and Strands Agents
- AI SDK: our tools package, or over MCP
- Chat SDK: our email adapter, or over MCP
- Voice agents: LiveKit and Vapi
- Support: how to reach us and what to include