mailbox.bot API API

The physical postal mail API for AI agents and software workflows. Send letters, certified postal mail, postcards, notices, and documents from code. Forward scans, photos, PDFs, virtual mailbox notices, and notes from addresses you already use to a private mailbox.bot alias; mailbox.bot stores the e

GitHub OpenAPI

Operations 109

GET /v1/webhooks/endpoints List webhooks and selectable agents #
POST /v1/webhooks/endpoints Create a webhook (active on save) #
GET /v1/webhooks/endpoints/{id} Read a webhook #
PATCH /v1/webhooks/endpoints/{id} Update or pause a webhook #
POST /v1/webhooks/endpoints/{id}/test Queue a synthetic test event #
POST /v1/webhooks/endpoints/{id}/sample-test Run the Sample test #
POST /v1/webhooks/endpoints/{id}/sample-test/status Refresh a Sample test verdict #
POST /v1/webhooks/endpoints/{id}/rotate Rotate a signing secret #
GET /v1/webhooks/endpoints/{id}/deliveries Read recent delivery outcomes #
POST /v1/webhooks/endpoints/{id}/deliveries/{deliveryId}/replay Replay a failed delivery #
GET /v1/agent-inbox Find assigned mail; retrieve matching page evidence through /sources #
GET /v1/agent-inbox/{id}/sources Read an item's exterior and requested-content OCR pages #
GET /v1/agent-inbox/{id}/context Read one assigned item's versioned context #
POST /v1/agent-inbox/{id}/acknowledgments Report an external worker outcome #
GET /v1/agent-inbox/activity Read this agent's inbox activity #
POST /v1/agent-inbox/sandbox/seed Create one isolated synthetic inbox fixture #
GET /v1/agent-inbox/{id}/scans List or search completed sample captures #
GET /v1/agent-inbox/{id}/scans/{operationId} Read captured pages and saved OCR for one completed request #
GET /v1/agent-inbox/{id}/actions Read sample handling capabilities and history #
POST /v1/agent-inbox/{id}/actions Propose a sample simulation for member approval #
GET /v1/agent-inbox/{id}/handling Read private-mail or sample facility handling capabilities #
POST /v1/agent-inbox/{id}/handling Propose an owner-approved facility or TEST training request #
GET /v1/facility/internal-inbound/handling Read one facility handling lane or an exact request #
POST /v1/facility/internal-inbound/handling/{id}/decision Accept, reject or complete an authorized handling request #
GET /v1/inbound-items/{id}/scans List completed scans for an inbound item #
GET /v1/inbound-items/{id}/sources Read saved exterior and authorized inside-page evidence for managed mail #
GET /v1/facility/mailboxes List receipt-enabled PMBs at the facility #
POST /v1/facility/inbound-mailbox-suggestions Suggest a PMB from a sealed-exterior photo #
POST /v1/facility/inbound-intake-drafts Create a mailbox-tethered inbound intake draft #
GET /v1/facility/inbound-intake-drafts/unmatched List quarantined unmatched intake drafts #
POST /v1/facility/inbound-intake-drafts/unmatched Create an unmatched inbound intake draft #
POST /v1/facility/inbound-intake-drafts/{id}/assets Attach a sealed-exterior photo to an intake draft #
POST /v1/facility/inbound-intake-drafts/{id}/match Match a quarantined intake draft to one PMB #
POST /v1/facility/inbound-intake-drafts/{id}/commit Commit a tethered inbound receipt #
GET /v1/facility/inbound-operations List the facility inbound operations queue #
GET /v1/facility/scan-requests List active facility scan requests #
POST /v1/facility/scan-requests/{id}/complete Complete a facility scan request #
GET /v1/inbound-items List and search inbound mail #
GET /v1/inbound-items/{id} Read one item with pages, actions and current quotes #
POST /v1/inbound-items/{id}/actions Open & scan, forward or discard an item #
POST /v1/inbound-items/{id}/actions/{actionId}/decision Approve or reject an agent's proposal (member keys only) #
DELETE /v1/inbound-items/{id}/actions/{actionId}/decision Cancel a proposal or an approved action before staff start it #
POST /v1/inbound-items/{id}/reset-sample Reset the sample letter so it can be tested again #
GET /v1/inbound-items/{id}/pages Read the scanned pages and their OCR text #
GET /v1/inbound-items/{id}/forward-quote Price every forwarding class to a ZIP #
GET /v1/inbound-activity Read the inbound event timeline #
GET /v1/inbound-plan Read the mailbox plan, period and allowances #
GET /v1/inbound-charges Read the inbound charge ledger #
POST /v1/batch-mail/estimate Price a batch before uploading anything #
POST /v1/batch-mail Create a batch draft (nothing charged yet) #
GET /v1/batch-mail List batches #
GET /v1/batch-mail/{id} Get a batch with its first 50 pieces #
DELETE /v1/batch-mail/{id} Cancel before the facility starts (full credit refund) #
GET /v1/batch-mail/{id}/pieces List every piece of a batch, paginated #
GET /v1/batch-mail/{id}/proof A proof PDF: the template, then the address label for one recipient #
POST /v1/batch-mail/{id}/confirm Charge credits and queue the batch #
POST /v1/batch-mail/verify Check an address verification code your user typed #
POST /v1/batch-mail/{id}/advance Sandbox: simulate the facility one step #
POST /v1/signup Create an account (agent-initiated signup) #
POST /v1/mailing-address-requests Request a mailing address # #
POST /v1/waitlist Request a mailing address # (older path) #
GET /v1/leads/{leadId} Get lead funnel status #
GET /v1/api-keys List member API keys #
POST /v1/api-keys Create member API key #
GET /v1/api-keys/{id} Get member API key details #
DELETE /v1/api-keys/{id} Revoke member API key #
POST /v1/api-keys/{id}/rotate Rotate member API key #
GET /v1/agents List agents #
POST /v1/agents Create an agent #
GET /v1/agents/{agentId} Get agent details #
PATCH /v1/agents/{agentId} Update agent settings #
DELETE /v1/agents/{agentId} Deactivate an agent #
GET /v1/mailboxes List logical outbound references #
POST /v1/mailboxes Provision a logical outbound reference #
GET /v1/agents/{agentId}/instructions Get agent standing instructions (MAILBOX.md) #
POST /v1/agents/{agentId}/credentials Create agent credential (sk_agent_ or sk_agent_test_ key) #
GET /v1/agents/{agentId}/credentials List agent credentials #
GET /v1/agents/{agentId}/credentials/{credentialId} Get agent credential details #
DELETE /v1/agents/{agentId}/credentials/{credentialId} Revoke agent credential #
GET /v1/messages List support conversations #
POST /v1/messages Send a support message #
GET /v1/messages/{id} Get support conversation thread #
POST /v1/messages/{id} Reply to a support conversation thread #
POST /v1/messages/{id}/attachments Upload an attachment to a support conversation #
GET /v1/messages/{id}/attachments/{attachmentId} Download a support attachment #
GET /v1/webhooks/settings Get webhook configuration #
PUT /v1/webhooks/settings Update webhook settings #
POST /v1/webhooks/signing-keys/rotate Rotate webhook signing key #
GET /v1/webhooks/events List webhook delivery events #
GET /v1/webhooks/events/{eventId} Get webhook event with delivery attempts #
GET /v1/usage Get usage and billing summary #
GET /v1/credits Get prepaid credit balance #
POST /v1/mail-runs Open a Business agent mail run #
GET /v1/mail-runs/{id} Poll a Business agent mail run #
DELETE /v1/mail-runs/{id} Cancel an unfunded Business agent mail run #
POST /v1/mail-runs/{id}/commit Close and fund a Business agent mail run #
POST /v1/mail Submit outbound mail #
GET /v1/mail List outbound mail #
GET /v1/inbound List forwarded inbound mail context #
GET /v1/inbound-forwarding-addresses List inbound forwarding aliases #
GET /v1/inbound/{id} Get forwarded inbound mail context #
GET /v1/postal-threads List physical-mail threads #
GET /v1/postal-threads/{id} Get physical-mail thread #
GET /v1/mail/{id} Get outbound mail details #
DELETE /v1/mail/{id} Cancel outbound mail #
GET /v1/mail/{id}/document Download outbound mail document #
POST /v1/test/webhook Fire a test webhook event #
POST /v1/test/mail Create a test outbound mail record #
POST /v1/test/mail/{id}/advance Advance test outbound mail status #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/mailbox-bot:mailbox-bot-api-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

mailbox-bot-api-openapi.json Raw ↑
{"openapi":"3.1.0","info":{"title":"mailbox.bot API","version":"1.0.0","description":"The physical postal mail API for AI agents and software workflows. Send letters, certified postal mail, postcards, notices, and documents from code. Forward scans, photos, PDFs, virtual mailbox notices, and notes from addresses you already use to a private mailbox.bot alias; mailbox.bot stores the evidence, runs OCR/extraction, and links it to outbound replies. Get a mailing address # for your agent: Live now. A real street address + PMB at the staffed, USPS-compliant Manhattan Beach, CA facility, $15/mo. The PMB number is assigned after USPS Form 1583 verification. Managed physical custody at an assigned PMB is a separate account-enabled, live-only REST service. MCP-compatible agent harnesses, OpenClaw-compatible discovery, REST, and webhooks are supported. Webhook auth modes: hmac (HMAC-SHA256, default), bearer (Authorization header), header (custom header name).","contact":{"url":"https://mailbox.bot/contact"},"termsOfService":"https://mailbox.bot/terms"},"servers":[{"url":"https://mailbox.bot/api","description":"Production"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"API key from your mailbox.bot dashboard. Four key types:\n\n- **sk_live_** (Member keys) — Full account access with all scopes. Queries span all agents unless filtered with ?agent_id=.\n- **sk_agent_** (Agent keys) — Scoped to a single agent's resources. Queries auto-filter to that agent; the agent_id parameter is ignored.\n- **sk_agent_test_** (Test keys) — Same agent scope on sandbox-capable endpoints: full PDF validation, real cost calculation, HMAC-signed webhooks — but no credit debit and no facility fulfillment. Physical inbound: a test key works on the account's own sample letter through the canonical /v1/inbound-items routes (quotes return cost_cents 0 with billing_mode sample); the legacy open_and_scan body, /scans, /sources and facility routes are live-only and return 403 `sandbox_not_supported`. Sandbox responses include `X-Test-Mode: true` and `test_mode: true`. Create via POST /v1/agents/:id/credentials with environment: 'test'.\n- **sk_facility_** (Facility keys) — Scoped to a facility's resources for external scanner apps.\n\nMember keys require ?agent_id= on agent-specific instruction endpoints to specify which agent to target. Agent keys resolve this automatically.\n\n**Sandbox mode:** Use a test key (sk_agent_test_) on sandbox-capable production endpoints. Responses include test_mode: true, cost_cents: 0, estimated_live_cost_cents (what production would spend), and a cost_breakdown object. Physical inbound: canonical /v1/inbound-items routes work on the sample letter with a test key; legacy and facility inbound routes return 403 `sandbox_not_supported`."}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Human-readable error message"},"fields":{"type":"array","description":"Structured validation issues. Present on 400 validation failures.","items":{"type":"object","required":["path","message"],"properties":{"path":{"type":"string","description":"Dot-path to the invalid field"},"message":{"type":"string","description":"Validation message for that field"}}}},"reason":{"type":"string","description":"Machine-readable reason code (present on 401/403 responses). 401 codes: token_missing, token_malformed, token_prefix_unknown, key_not_found, key_revoked, key_expired, member_suspended, facility_inactive. 403 codes: insufficient_scope."},"retryable":{"type":"boolean","description":"Whether the request can be retried. false for validation/payment errors, true for transient failures (5xx) and idempotency conflicts (409). Present on outbound mail errors."},"suggested_action":{"type":"string","description":"Plain-language guidance for recovering from the error. Designed for AI agents to read and act on. Present on outbound mail errors."},"code":{"type":"string","description":"Machine-readable error code. For credit failures this can be INSUFFICIENT_CREDITS."},"billing_url":{"type":"string","description":"Dashboard URL where the signed-in human operator can buy credits, typically /dashboard/billing#credits on the same origin."},"credits_required_cents":{"type":"integer","description":"Credits required for the attempted live mail send, in cents. Present on insufficient-credit responses."},"credit_balance_cents":{"type":"integer","description":"Current prepaid credit balance in cents when available."},"credit_shortfall_cents":{"type":"integer","description":"Additional credits needed to fund the attempted send, in cents."}}},"SignupRequest":{"type":"object","required":["email","password","full_name"],"properties":{"email":{"type":"string","format":"email"},"password":{"type":"string","minLength":8},"full_name":{"type":"string","minLength":2,"maxLength":100},"needs":{"type":"string","description":"Optional description of what you need"},"lead_id":{"type":"string","pattern":"^wl_[a-f0-9]{16}$","description":"Optional. If your agent previously called POST /v1/mailing-address-requests and received a lead_id, pass it here. The new account will be stitched to that lead row, and the response will include a status_url you can poll without auth (via GET /v1/leads/{leadId}) to track funnel progress."}}},"LeadStatus":{"type":"object","required":["lead_id","stage","has_account","created_at"],"properties":{"lead_id":{"type":"string"},"source":{"type":"string","description":"How the lead arrived (web, api, agent)"},"stage":{"type":"string","enum":["waitlisted","account_created","email_verified","active","unknown"],"description":"Funnel stage. Progresses left-to-right."},"has_account":{"type":"boolean","description":"True once the lead has been stitched to a member account via /v1/signup, or, for a lead from POST /agent/auth whose operator confirmed the 6-digit code, once an account with that email exists."},"created_at":{"type":"string","format":"date-time"},"age_days":{"type":"integer"},"next_step":{"type":"object","nullable":true,"properties":{"action":{"type":"string"},"url":{"type":"string","format":"uri"},"hint":{"type":"string"}}},"agent_resources":{"type":"object","description":"Directory of agent-discoverable URLs such as OpenAPI, MCP, and agent discovery."},"contact":{"type":"object","properties":{"owner_email":{"type":"string","format":"email"},"instruction_for_agent":{"type":"string"}}}}},"WaitlistRequest":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email"},"needs":{"type":"string","description":"Live now. A real street address + PMB at the staffed, USPS-compliant Manhattan Beach, CA facility, $15/mo. The PMB number is assigned after USPS Form 1583 verification. Free-text description of what you (or your operator) need. Agents are encouraged to write a one-sentence summary of intent. Use this to get a mailing address #: a mailbox.bot-issued physical receiving, street, and package address with street address + mailbox number, scan/photo intake, package receiving, package forwarding, or agent-managed physical mail decisions."},"preferred_location":{"type":"string","description":"Live now. A real street address + PMB at the staffed, USPS-compliant Manhattan Beach, CA facility, $15/mo. The PMB number is assigned after USPS Form 1583 verification. Optional desired region for a mailbox.bot-issued physical receiving, street, or package address, for example Southern California, Nevada, Southern Utah, or another requested market."},"callback_url":{"type":"string","format":"uri","description":"Optional. An https webhook the agent will accept callbacks on. If supplied, mailbox.bot can reach the agent later (product updates, partnership inquiries, lead follow-up)."},"agent_id":{"type":"string","description":"Optional. A self-identifier for the agent platform/instance making the request. Helps mailbox.bot recognize repeat visits and route follow-ups."},"operator_contact":{"type":"string","description":"Optional. A human-readable contact (email, handle, name) that the agent's operator authorized for follow-up. Only supply this if you have explicit operator consent."}}},"CreateAgentRequest":{"type":"object","required":["name"],"properties":{"name":{"type":"string","minLength":2,"maxLength":50},"display_name":{"type":"string"},"description":{"type":"string"},"webhook_url":{"type":"string","format":"uri"}}},"AgentCredentialRequest":{"type":"object","required":["scopes"],"properties":{"scopes":{"type":"array","items":{"type":"string","enum":["mailbox.read","mailbox.write","inbound.item.read","inbound.item.scan.read","inbound.item.action","mail.send","document.read","inbound.read","billing.read","webhook.manage","webhook.read","agent.read","agent.write","message.send","agent.inbox.read","agent.inbox.report","agent.inbox.propose"]},"minItems":1,"description":"Scopes to grant the agent key. At least one required."},"expires_in_days":{"type":"integer","minimum":1,"description":"Optional key lifetime in days. Omit for no expiration."},"environment":{"default":"live","type":"string","enum":["live","test"],"description":"Key environment. Omitted defaults to 'live'; an explicitly invalid value, including null or different casing, returns 400. 'test' creates an sk_agent_test_ key for sandbox-capable endpoints: full validation, real cost calculation, HMAC-signed webhooks — but no credit debit and no facility fulfillment. Physical inbound custody is live-only and rejects test keys with sandbox_not_supported."},"force_approval":{"type":"boolean","default":false,"description":"When true, all outbound mail submitted with this key is routed to pending_approval regardless of the requires_approval parameter. Use for agent governance — ensures a human reviews every mailpiece before it's sent."},"max_daily_pieces":{"type":"integer","minimum":1,"nullable":true,"description":"Maximum outbound mail pieces this agent can submit per 24-hour window. Null or omitted means no limit. Protects against runaway agent loops."}}},"AgentCredential":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"key":{"type":"string","description":"Full raw key — returned only on creation, never shown again"},"key_prefix":{"type":"string","description":"First 18 characters of the key (always visible)"},"credential_type":{"type":"string","enum":["api_key"]},"scopes":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","revoked"]},"environment":{"type":"string","enum":["live","test"],"description":"Key environment — 'test' keys activate sandbox mode"},"expires_at":{"type":"string","format":"date-time","nullable":true},"created_at":{"type":"string","format":"date-time"},"force_approval":{"type":"boolean","description":"When true, all mail submitted with this key requires human approval"},"max_daily_pieces":{"type":"integer","nullable":true,"description":"Maximum mail pieces per 24h window (null = unlimited)"}}},"MemberApiKeyRequest":{"type":"object","required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":64,"description":"Human-readable key name shown in the dashboard."},"environment":{"type":"string","enum":["prod","test"],"default":"prod","description":"Member key environment. Production keys are still prefixed sk_live_."},"expires_in_days":{"type":"integer","minimum":1,"description":"Optional key lifetime in days. Omit for no expiration."}}},"MemberApiKey":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"key":{"type":"string","description":"Full raw key — returned only on creation or rotation, never shown again"},"key_prefix":{"type":"string"},"name":{"type":"string"},"environment":{"type":"string","enum":["prod","test"]},"status":{"type":"string","enum":["active","revoked","rotated"]},"expires_at":{"type":"string","format":"date-time","nullable":true},"created_at":{"type":"string","format":"date-time"}}},"InboundMailFile":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["raw_email","attachment"]},"filename":{"type":"string"},"content_type":{"type":"string"},"size_bytes":{"type":"integer"},"sha256":{"type":"string","nullable":true},"extraction_status":{"type":"string","enum":["pending","extracted","pending_ocr","unsupported","failed"]},"download_url":{"type":"string","description":"Present when include=files or signed_urls"},"signed_url":{"type":"string","description":"Present only when signed_urls=true or include=signed_urls"},"created_at":{"type":"string","format":"date-time"}}},"InboundExtraction":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"inbound_mail_file_id":{"type":"string","format":"uuid","nullable":true},"source":{"type":"string","description":"email_subject, email_body, pdf_metadata, ocr_placeholder, heuristic_classifier, address_parser, thread_matcher, etc."},"field":{"type":"string"},"value":{"type":"string"},"confidence":{"type":"number","minimum":0,"maximum":1},"metadata":{"type":"object"},"created_at":{"type":"string","format":"date-time"}}},"InboundReplyContact":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"line1":{"type":"string"},"line2":{"type":"string","nullable":true},"city":{"type":"string"},"state":{"type":"string"},"postal_code":{"type":"string"},"country":{"type":"string"},"source_type":{"type":"string"},"verification_status":{"type":"string","nullable":true},"confidence":{"type":"number","nullable":true},"formatted_address":{"type":"string"}}},"InboundDraftContext":{"type":"object","description":"Compact drafting context for LLMs and external agents. Present when include=drafting.","properties":{"summary":{"type":"string","nullable":true},"category":{"type":"string"},"suggested_action":{"type":"string"},"inbound_capture_id":{"type":"string","format":"uuid"},"postal_mail_thread_id":{"type":"string","format":"uuid","nullable":true},"sender":{"type":"object"},"recipient":{"type":"object"},"reply_contact":{"oneOf":[{"$ref":"#/components/schemas/InboundReplyContact"},{"type":"null"}]},"reply_contact_confidence":{"type":"number","nullable":true},"deadlines":{"type":"array","items":{"type":"string"}},"key_facts":{"type":"array","items":{"type":"object"}},"source_files":{"type":"array","items":{"type":"object"}},"linked_outbound_mail":{"type":"array","items":{"type":"object"},"description":"Recent outbound mail records already linked to this inbound capture or thread."}}},"InboundForwardingAddress":{"type":"object","description":"Private forwarding alias used to send scans, PDFs, photos, provider notices, notes, and other context-aware documents into mailbox.bot inbound context. This is a member-scoped intake email alias, not a new physical mailing address.","properties":{"id":{"type":"string","format":"uuid"},"member_id":{"type":"string","format":"uuid"},"agent_id":{"type":"string","format":"uuid","nullable":true},"label":{"type":"string"},"alias_local_part":{"type":"string"},"domain":{"type":"string"},"email":{"type":"string"},"alias_type":{"type":"string","enum":["random","vanity"]},"requested_alias_local_part":{"type":"string","nullable":true},"source_type":{"type":"string"},"provider":{"type":"string","nullable":true},"handled_by":{"type":"string"},"capture_method":{"type":"string"},"automation_level":{"type":"string","enum":["high","medium","low"]},"approval_mode":{"type":"string","enum":["always_require","require_for_sensitive","allow_rules"]},"status":{"type":"string","enum":["active","paused","archived"]},"last_received_at":{"type":"string","format":"date-time","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"InboundMailItem":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"object":{"type":"string","enum":["inbound_mail_item"]},"status":{"type":"string"},"received_at":{"type":"string","format":"date-time"},"from":{"type":"string","nullable":true},"subject":{"type":"string"},"note_preview":{"type":"string","nullable":true},"attachment_count":{"type":"integer"},"category":{"type":"string"},"suggested_action":{"type":"string"},"parsed":{"type":"object"},"thread":{"type":"object","nullable":true},"files":{"type":"array","items":{"$ref":"#/components/schemas/InboundMailFile"}},"context":{"type":"object","description":"Compact agent-safe context. Full OCR/lineage requires include=ocr,lineage."},"draft_context":{"$ref":"#/components/schemas/InboundDraftContext","description":"Present only when include=drafting."},"extractions":{"type":"array","items":{"$ref":"#/components/schemas/InboundExtraction"},"description":"Present only when include=lineage."}}},"PostalThread":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"object":{"type":"string","enum":["postal_mail_thread"]},"title":{"type":"string"},"category":{"type":"string"},"status":{"type":"string","enum":["open","waiting","closed","archived"]},"summary":{"type":"string","nullable":true},"last_event_at":{"type":"string","format":"date-time"},"events":{"type":"array","description":"Present when include=events.","items":{"type":"object"}}}},"AgentMailRun":{"type":"object","required":["id","mail_run_id","status","closes_at","total_cents","total_display","item_count","created_at","updated_at"],"description":"Durable status for one explicit Business agent mail run. The caller-selected mail_run_id is stable across retries. The five-minute closes_at deadline is fixed when the run is first opened and is never extended by later attachments.","properties":{"id":{"type":"string","format":"uuid","description":"Internal immutable run identifier."},"mail_run_id":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,119}$","description":"Caller-selected stable run identifier used in all run URLs and child POST /v1/mail submissions."},"status":{"type":"string","enum":["open","awaiting_approval","funding","funded","failed","cancelled"],"description":"open accepts child mailpieces; awaiting_approval means the human must add credits or adjust Auto-Fill settings before the agent retries the same commit (there is no direct run-approval endpoint); funding has an unresolved idempotent payment result; funded means every child was atomically debited and released to fulfillment; failed and cancelled are terminal."},"closes_at":{"type":"string","format":"date-time","description":"Fixed non-sliding automatic close time, five minutes after first creation."},"closed_at":{"type":["string","null"],"format":"date-time"},"total_cents":{"type":"integer","minimum":0,"description":"Exact locked total of attached children."},"total_display":{"type":"string"},"item_count":{"type":"integer","minimum":0},"failure_message":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"AgentMailRunResponse":{"type":"object","required":["mail_run"],"properties":{"mail_run":{"$ref":"#/components/schemas/AgentMailRun"},"idempotent_replay":{"type":"boolean","description":"Present on create. true when the same member, agent, and mail_run_id reused the existing run."},"funding":{"type":"object","description":"Present when a commit or expedited attachment attempted run-level funding.","properties":{"status":{"type":"string","enum":["funded","awaiting_approval","funding","retrying"]},"balance_cents":{"type":["integer","null"]},"auto_reloaded":{"type":"boolean"},"reload_amount_cents":{"type":["integer","null"]},"attempt_id":{"type":["string","null"],"format":"uuid"},"error":{"type":"string"},"code":{"type":"string"},"retryable":{"type":"boolean"},"suggested_action":{"type":"string"}}}}},"OutboundMailWebhookPayload":{"type":"object","description":"Webhook payload for outbound mail lifecycle events. The canonical event name field is event_type (not 'event'). tracking_number and carrier are null until mail.mailed, and tracking_number may remain null for USPS first_class. tracking_number is required for priority, certified, certified_return_receipt, FedEx, and UPS mail classes. USPS first_class does not include carrier tracking by default; tracking_number may be null. error_message is only present on mail.failed. For mail.failed, carrier_delivery_failed/failure_stage distinguish carrier delivery failures from submission or fulfillment failures. metadata echoes back whatever you passed at submission — not wrapped or renamed. Use webhooks for push updates, or poll GET /v1/mail/{id} for canonical status and fresh signed photo URLs. Webhook payloads include callback_url for the same lookup.","properties":{"event_type":{"type":"string","enum":["mail.pending_approval","mail.submitted","mail.ready","mail.mailed","mail.delivered","mail.failed","mail.cancelled"]},"outbound_mail_id":{"type":"string","format":"uuid"},"agent_id":{"type":"string","format":"uuid"},"mailbox_id":{"type":"string"},"package_id":{"type":"string","format":"uuid","nullable":true,"description":"Set if this mail is a reply to an inbound package"},"recipient_name":{"type":"string","nullable":true,"description":"Recipient person name, or null when addressed to a company only"},"recipient_company":{"type":"string","nullable":true,"description":"Company or organization line for the recipient address"},"recipient_city":{"type":"string"},"recipient_state":{"type":"string"},"recipient_zip":{"type":"string"},"return_name":{"type":"string","nullable":true,"description":"Return address name (defaults to member profile if not overridden)"},"return_company":{"type":"string","nullable":true,"description":"Optional return address company or organization line"},"return_line1":{"type":"string","nullable":true,"description":"Return address line 1"},"return_line2":{"type":"string","nullable":true,"description":"Return address line 2"},"return_city":{"type":"string","nullable":true,"description":"Return address city"},"return_state":{"type":"string","nullable":true,"description":"Return address state (2-letter)"},"return_zip":{"type":"string","nullable":true,"description":"Return address ZIP"},"mail_class":{"type":"string"},"status":{"type":"string"},"tracking_number":{"type":"string","nullable":true,"description":"Present from mail.mailed onwards when the selected service provides tracking. tracking_number is required for priority, certified, certified_return_receipt, FedEx, and UPS mail classes. USPS first_class does not include carrier tracking by default; tracking_number may be null."},"carrier":{"type":"string","nullable":true,"description":"Present from mail.mailed onwards when a carrier is assigned (e.g. USPS, FedEx, UPS)"},"cost_cents":{"type":"integer","nullable":true},"created_at":{"type":"string","format":"date-time"},"mailed_at":{"type":"string","format":"date-time","nullable":true},"error_message":{"type":"string","nullable":true,"description":"Failure detail — present only on mail.failed events"},"carrier_delivery_failed":{"type":"boolean","description":"True only when status=failed because a mailed/tracked carrier item later failed delivery."},"failure_stage":{"type":"string","enum":["carrier_delivery"],"nullable":true,"description":"carrier_delivery for mailed items that failed during carrier delivery; null for submission/fulfillment failures or non-failed events."},"failure_source":{"type":"string","enum":["fedex_tracking"],"nullable":true,"description":"fedex_tracking when FedEx Track reported the carrier delivery failure; null otherwise."},"agent_notes":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true,"description":"Developer-supplied key-value pairs echoed from submission"},"pdf_url":{"type":"string","format":"uri","nullable":true,"description":"Signed URL to the uploaded PDF for legacy plaintext PDF rows only (1-hour expiry). Null for non-PDF formats and encrypted rows; use GET /v1/mail/{id}/document with document.read for encrypted source bytes."},"fulfillment_photos":{"type":"array","description":"Proof photos taken by the facility. Empty on mail.submitted, populated on mail.ready/mailed, and may include delivery proof on mail.delivered. URLs are signed (1-hour expiry); use callback_url for fresh signed URLs.","items":{"type":"object","properties":{"category":{"type":"string","enum":["pages","envelope","receipt","delivery"],"description":"Photo type: pages (printed doc), envelope (sealed mail), receipt (postage/hand-off), delivery (postal delivery confirmation)"},"url":{"type":"string","format":"uri","description":"Signed URL (1-hour expiry)"},"uploaded_at":{"type":"string","format":"date-time"}}}},"callback_url":{"type":"string","format":"uri","description":"GET this URL to fetch the full mail record with fresh signed URLs"},"test_mode":{"type":"boolean","description":"Always present. false for live requests, true for sandbox/test requests."},"estimated_live_cost_cents":{"type":"integer","description":"What this would cost in production. Present only when test_mode is true."},"mailbox_md":{"type":"string","nullable":true,"description":"Agent's current MAILBOX.md instructions (injected by platform)"},"mailbox_md_version":{"type":"integer","description":"MAILBOX.md version at delivery time"},"mailbox_md_hash":{"type":"string","nullable":true,"description":"SHA-256 hex digest of MAILBOX.md content"}}},"LogicalOutboundMailboxReference":{"type":"object","properties":{"id":{"type":"string"},"mailbox_id":{"type":"string"},"suite_number":{"type":"string"},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Historical compatibility field for outbound routing. It is not a deliverable receiving address or PMB."},"address_kind":{"type":"string","const":"outbound_reference","description":"Machine-readable classification for a compatibility-only outbound routing reference."},"physical_receiving_enabled":{"type":"boolean","const":false,"description":"Always false for logical outbound references. Physical custody requires a separately assigned PMB."},"do_not_send_physical_mail":{"type":"string","const":"Do not send physical mail or packages to this address; it is an outbound-only reference, not an assigned receiving PMB.","description":"Explicit warning that the compatibility address is not a physical mail or package destination."},"agent_id":{"type":"string"},"agent":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"}},"required":["id","name"],"additionalProperties":{}},{"type":"null"}]},"status":{"type":"string"},"facility":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"street":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"zip":{"type":"string"}},"required":["id","street","city","state","zip"],"additionalProperties":{}},{"type":"null"}]},"created_at":{"type":"string"}},"required":["id","mailbox_id","suite_number","address","address_kind","physical_receiving_enabled","do_not_send_physical_mail"],"additionalProperties":{}},"LogicalOutboundMailboxListResponse":{"type":"object","properties":{"mailboxes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"mailbox_id":{"type":"string"},"suite_number":{"type":"string"},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Historical compatibility field for outbound routing. It is not a deliverable receiving address or PMB."},"address_kind":{"type":"string","const":"outbound_reference","description":"Machine-readable classification for a compatibility-only outbound routing reference."},"physical_receiving_enabled":{"type":"boolean","const":false,"description":"Always false for logical outbound references. Physical custody requires a separately assigned PMB."},"do_not_send_physical_mail":{"type":"string","const":"Do not send physical mail or packages to this address; it is an outbound-only reference, not an assigned receiving PMB.","description":"Explicit warning that the compatibility address is not a physical mail or package destination."},"agent_id":{"type":"string"},"agent":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"}},"required":["id","name"],"additionalProperties":{}},{"type":"null"}]},"status":{"type":"string"},"facility":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"street":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"zip":{"type":"string"}},"required":["id","street","city","state","zip"],"additionalProperties":{}},{"type":"null"}]},"created_at":{"type":"string"}},"required":["id","mailbox_id","suite_number","address","address_kind","physical_receiving_enabled","do_not_send_physical_mail"],"additionalProperties":{}}},"pagination":{"type":"object","properties":{"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"limit":{"type":"integer","exclusiveMinimum":0,"maximum":100},"offset":{"type":"integer","minimum":0,"maximum":9007199254740991},"has_more":{"type":"boolean"}},"required":["total","limit","offset","has_more"],"additionalProperties":false}},"required":["mailboxes","pagination"],"additionalProperties":{}},"LogicalOutboundMailboxCreateResponse":{"type":"object","properties":{"mailbox":{"type":"object","properties":{"id":{"type":"string"},"mailbox_id":{"type":"string"},"suite_number":{"type":"string"},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Historical compatibility field for outbound routing. It is not a deliverable receiving address or PMB."},"address_kind":{"type":"string","const":"outbound_reference","description":"Machine-readable classification for a compatibility-only outbound routing reference."},"physical_receiving_enabled":{"type":"boolean","const":false,"description":"Always false for logical outbound references. Physical custody requires a separately assigned PMB."},"do_not_send_physical_mail":{"type":"string","const":"Do not send physical mail or packages to this address; it is an outbound-only reference, not an assigned receiving PMB.","description":"Explicit warning that the compatibility address is not a physical mail or package destination."},"agent_id":{"type":"string"},"agent":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"}},"required":["id","name"],"additionalProperties":{}},{"type":"null"}]},"status":{"type":"string"},"facility":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"street":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"zip":{"type":"string"}},"required":["id","street","city","state","zip"],"additionalProperties":{}},{"type":"null"}]},"created_at":{"type":"string"}},"required":["id","mailbox_id","suite_number","address","address_kind","physical_receiving_enabled","do_not_send_physical_mail"],"additionalProperties":{}}},"required":["mailbox"],"additionalProperties":{}},"AgentCreateLogicalOutboundResponse":{"type":"object","properties":{"agent":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"slug":{"type":"string"},"endpoint":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","slug","endpoint","description","webhook_url","status","created_at"],"additionalProperties":{}},"mailbox":{"type":"object","properties":{"id":{"type":"string"},"mailbox_id":{"type":"string"},"suite_number":{"type":"string"},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Historical compatibility field for outbound routing. It is not a deliverable receiving address or PMB."},"address_kind":{"type":"string","const":"outbound_reference","description":"Machine-readable classification for a compatibility-only outbound routing reference."},"physical_receiving_enabled":{"type":"boolean","const":false,"description":"Always false for logical outbound references. Physical custody requires a separately assigned PMB."},"do_not_send_physical_mail":{"type":"string","const":"Do not send physical mail or packages to this address; it is an outbound-only reference, not an assigned receiving PMB.","description":"Explicit warning that the compatibility address is not a physical mail or package destination."},"agent_id":{"type":"string"},"agent":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"}},"

# --- truncated at 32 KB (590 KB total) ---
# Full source: https://artifacts.apis.io/mailbox-bot/openapi/_original/mailbox-bot-api-openapi.json