Postfleet
v0.1.4Give an AI agent its own email address: send, reply, read, and wait for mail.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
list_mailboxes
List the mailboxes you can use, newest first, each with its id and email address. Call this when you need a mailbox_id for any other tool, or to check whether you already have a mailbox before creating one — it is usually the first call in a workflow. Returns every mailbox on the account, or just your own if your API key is scoped to a single mailbox. An empty list means you have none yet — use create_mailbox.
create_mailbox
Create a NEW email mailbox this agent owns. Call this when list_mailboxes shows you have no suitable mailbox yet — mailboxes persist across sessions, so creating a second one for the same purpose strands mail in the first. Returns a working address immediately. Optional slug personalizes the address (agent-<slug>@...). To create the mailbox on a custom domain instead of the shared one (<slug>@yourdomain.com), pass a domain_id from list_domains — the domain must be verified.
| Parameter | Type | Description |
|---|---|---|
display_name | string | Optional. Human-readable From name shown to recipients, e.g. "Acme Support Bot". |
domain_id | string | Optional. Id of a VERIFIED custom domain from list_domains, to host the mailbox at <slug>@yourdomain.com. Omit to use the shared platform domain. |
extraction_schema_id | string | Optional. Id of a JSON Schema to extract inbound mail into. Without it, messages arrive cleaned and screened but with no structured extraction. |
slug | string | Optional. Personalizes the address as agent-<slug>@... Lowercase letters, digits and dashes, max 41 chars. Omit for a generated address. |
list_domains
List the account's custom sending domains with their id, name, and verification status. Call this when you want to create a mailbox on a custom domain (pass the id of a verified domain as create_mailbox's domain_id), or to check whether a domain has finished verifying. Only status "verified" domains can host mailboxes; an empty list means only the shared platform domain is available.
create_domain
Register a NEW custom sending domain on this account. Call this when list_domains does not already include the domain you want to host mailboxes on. Returns the domain id, verification status, and the DNS records to add at your registrar. The domain stays pending until those records are in place — call verify_domain after publishing them. Custom domains require a paid plan. A name that is already registered with Postfleet or the email provider is a conflict, not a success; do not retry with the same name.
| Parameter | Type | Description |
|---|---|---|
name * | string | Domain name to register, e.g. mail.example.com or example.com. Protocol and path are stripped if present. |
verify_domain
Re-check DNS for a custom domain and refresh its verification status. Call this when you have added the records returned by create_domain, or when list_domains still shows pending and you believe DNS has propagated. Returns the current status (pending, verified, or failed). Only a verified domain can be passed to create_mailbox as domain_id.
| Parameter | Type | Description |
|---|---|---|
id * | string | Id of the domain to verify, from list_domains or create_domain. |
send_email
Send a new email from one of your mailboxes. Call this when starting a NEW conversation; to answer an email you received, use reply_email instead (it threads correctly). Pass a client_id (any unique string you make up) and reuse the SAME client_id if you retry after an error — that guarantees the email is sent at most once. If the mailbox requires human approval, the send is queued as a draft and returns {draft_id, status:"pending_approval"} instead of a message id — that is NOT a failure and must NOT be retried; the email goes out once a human approves it (check with list_drafts).
| Parameter | Type | Description |
|---|---|---|
client_id * | string | REQUIRED idempotency key — any unique string you invent for this send. Reuse the SAME value when retrying after an error and the email goes out at most once; a new value sends a second copy. Cannot… |
mailbox_id * | string | Id of the mailbox to send from, from list_mailboxes. |
subject * | string | Subject line, max 200 characters. |
text * | string | Plain-text body, max 50,000 characters. |
to * | string | Recipient email address. |
reply_email
Reply to an email you received. Call this when answering an existing message — recipient, subject, and conversation threading are derived automatically from the original. Pass a client_id (any unique string you make up) and reuse the SAME client_id if you retry after an error — that guarantees the reply is sent at most once. If the mailbox requires human approval, the reply is queued as a draft and returns {draft_id, status:"pending_approval"} instead of a message id — that is NOT a failure and must NOT be retried; it is sent once a human approves it (check with list_drafts).
| Parameter | Type | Description |
|---|---|---|
client_id * | string | REQUIRED idempotency key — any unique string you invent for this reply. Reuse the SAME value when retrying after an error and the reply goes out at most once; a new value sends a second copy. Cannot… |
mailbox_id * | string | Id of the mailbox the original message arrived in. |
reply_to_message_id * | string | Id of the message being replied to, from list_inbox or read_email. Recipient, subject and threading are derived from it. |
text * | string | Plain-text reply body, max 50,000 characters. |
list_inbox
List recent messages in a mailbox, newest first, with comprehension status per message. Call this when checking what has arrived; use read_email for full content and extracted data.
| Parameter | Type | Description |
|---|---|---|
mailbox_id * | string | Id of the mailbox to list, from list_mailboxes. |
limit | integer | Optional. How many messages to return, 1-100. Defaults to a small recent page. |
read_email
Read one email in full: cleaned body, sanitization report (screened against known hidden-content patterns), classification, and data extracted to the mailbox schema. Call this when you need the content or extraction of a specific message.
| Parameter | Type | Description |
|---|---|---|
message_id * | string | Id of the message to read, from list_inbox or wait_for_email. |
wait_for_email
Block until a matching email arrives in a mailbox (or time out). Call this when you just sent an email and need the reply, or are expecting an inbound message — instead of polling list_inbox yourself. Returns the full message on match, or {timed_out:true}.
| Parameter | Type | Description |
|---|---|---|
mailbox_id * | string | Id of the mailbox to watch, from list_mailboxes. |
from_contains | string | Optional. Only match messages whose sender address contains this substring. |
subject_contains | string | Optional. Only match messages whose subject contains this substring. |
timeout_seconds | integer | Optional. How long to wait before giving up, 1-120 seconds. On expiry returns {timed_out:true} rather than an error. |
create_draft
Prepare an email as a draft without sending it. Call this when you want to stage a message for later or for a human to review before it goes out — send it afterward with send_draft. Same fields as send_email, or omit to/subject and pass reply_to_message_id to draft a threaded reply. Returns the draft id with status "draft".
| Parameter | Type | Description |
|---|---|---|
mailbox_id * | string | Id of the mailbox the draft belongs to, from list_mailboxes. |
text * | string | Plain-text body, max 50,000 characters. |
reply_to_message_id | string | Optional. Draft a threaded reply to this message; recipient and subject are derived from it. Cannot be changed later with update_draft. |
subject | string | Subject line. Omit only when passing reply_to_message_id, which supplies it. |
to | string | Recipient address. Omit only when passing reply_to_message_id, which supplies it. |
list_drafts
List the open drafts in a mailbox (status draft, pending_approval, or sending), newest first. Call this when you need to see messages you have staged or that are queued waiting on human approval, e.g. after a send returned status "pending_approval".
| Parameter | Type | Description |
|---|---|---|
mailbox_id * | string | Id of the mailbox whose drafts to list, from list_mailboxes. |
get_draft
Read one draft in full by its id: recipient, subject, body text, and current status. Call this when you need the content of a specific draft — e.g. to review what is queued for approval after list_drafts, or before editing it with update_draft.
| Parameter | Type | Description |
|---|---|---|
id * | string | Id of the draft to read, from create_draft or list_drafts. |
update_draft
Edit the to, subject, or text of a draft that has not been sent yet — omitted fields keep their current value. Call this when a draft needs changes, e.g. a human declined to approve it and you are revising it. The reply target cannot be changed (create a new draft to reply to a different message), and a draft that is already sending or sent can no longer be edited.
| Parameter | Type | Description |
|---|---|---|
id * | string | Id of the draft to edit, from create_draft or list_drafts. |
subject | string | Optional. New subject line. Omit to keep the current one. |
text | string | Optional. New plain-text body. Omit to keep the current one. |
to | string | Optional. New recipient address. Omit to keep the current one. |
send_draft
Send a draft you prepared, by its id. Call this when a staged draft is ready to go out. If the mailbox requires human approval, this returns 202 {draft_id, status:"pending_approval"} — the draft is queued for a human to approve, which is NOT a failure and must NOT be retried; it is sent once approved. Otherwise it sends immediately and returns the message id.
| Parameter | Type | Description |
|---|---|---|
id * | string | Id of the draft to send, from create_draft or list_drafts. |
delete_draft
Discard a draft by its id so it will never be sent. Call this when a staged or pending-approval message should be withdrawn — e.g. it is no longer needed or was created by mistake. A draft that is already sending or sent cannot be deleted.
| Parameter | Type | Description |
|---|---|---|
id * | string | Id of the draft to discard, from create_draft or list_drafts. |