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
  1. What Postyard is
  2. Set up
  3. The demo mailbox
  4. Signing in
  5. The 13 tools
  6. Limits
  7. Troubleshooting
  8. REST API and webhooks
  9. Your data
  10. All guides

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

  1. Sign up at app.postyard.dev and create an organization.
  2. Add a domain. Postyard lists the DNS records to publish and checks each one. The domain stays at its registrar.
  3. Once the domain is verified, create a mailbox, such as support@harborlight.example.
  4. Add the server to your app: connect Claude, ChatGPT, Cursor, VS Code, Vercel Connect or n8n. The URL is the same everywhere:
Text
https://api.postyard.dev/mcp
  1. 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.
  2. 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_mailboxes marks it with "demo": true and 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-inAPI key
Best forAssistants people useScripts, servers, workflow tools
Set upPaste the URL, sign in with your Postyard accountCreate a key under Agents & API > API keys, send it as Authorization: Bearer py_live_...
Works onThe MCP server onlyThe MCP server and the REST API
Starts withRead and draft, no mailboxesThe permission set and access you pick
Stop itRevoke under ConnectionsRevoke 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.

ToolWhat it may changePermission
list_mailboxesLists the mailboxes this connection can reachNothingRead
list_conversationsLists conversations, newest first, with filters and searchNothingRead
get_conversationReads one conversation and its messagesNothingRead
get_messageReads one message with its bodyNothingRead
get_attachmentDownloads one attachment, up to 10 MBNothingRead
create_draftWrites a new draftAdds a draft. Nothing is sentDraft
create_reply_draftWrites a reply draft in the same threadAdds a draft. Nothing is sentDraft
update_draftReplaces a draft's recipients, subject and bodyOverwrites that draft's content. With replace: true it also drops its attachments and HTMLDraft
delete_draftDeletes a draft that wasn't sentRemoves that draftDraft
mark_handledMarks a message as handled, or clears the markThat mark only. Never the unread stateDraft
send_draftSends an existing draftSends email to its recipients. It can't be undoneSend
reply_to_messageWrites a reply and sends it at onceSends email. It can't be undoneSend
send_messageWrites a new message and sends it at onceSends email. It can't be undoneSend

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

WhatLimit
Requests20 a second per organization, with bursts of 100
Conversations per page1 to 100, 25 by default
Search200 characters and 8 words, matched in subjects, senders, recipients and previews. Not in bodies
Message body in get_message100 KB, then cut and marked truncated
Attachment in get_attachment10 MB
Attachments when sending17 MiB and 20 files per message. Upload them over the REST API; the MCP tools write text and simple HTML
Recipients50 per message
Subject998 bytes
HTML in a draft512 KB, simple formatting only
Sends30 a minute
External recipients in 24 hours200 until the first payment, 1,000 in the 30 days after it, then 10,000
Request logKept 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

ErrorWhat it meansWhat to do
401 unauthenticatedThe token or key is missing, wrong, expired or revokedSign in again, or check the key
402 billing_requiredThe organization's subscription doesn't allow thisAn admin checks the Plan page
not_foundThe item doesn't exist, or is outside this connection's mailboxesList again, or change the connection's access
draft_has_htmlThe draft was written in a mail app or the web inboxLeave it to the person, or pass replace: true to overwrite it
attachment_too_largeThe file is over 10 MBDownload it over the REST API or in a mail app
429 rate_limitedToo many requestsWait for retry_after seconds
429 limit_reachedA limit, or the organization's spending limitAn 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.

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