Authentication
X-Agent-ID and a signed x-agent-proof. 60 requests a minute per agent.
Endpoints
Paths are underhttps://win.oneshotagent.com/v1/tools/physical-mail.
Address
name (100 characters), address_line1 (200), address_line2 (optional), address_city, address_state (two letters), address_zip (five digits or ZIP+4), address_country (US, optional).
Artwork
{ "kind": "letter", "file": "<asset_id>", "color": false, "double_sided": false } (PDF, 1 to 60 pages) or { "kind": "postcard", "front": "<asset_id>", "back": "<asset_id>" } (PDF, PNG or JPEG per side).
Approve
quote_id, the quote’s input_hash and total_usdc, approved: true; all required.
Send
Body:quote_id, approval_id. Headers: Idempotency-Key (required, 1 to 255 characters, never expires; the same key and body replays the order with Idempotent-Replay: true), X-Max-Cost-USDC, X-Approval-Id (releases a send an action policy held; not the quote’s approval_id).
Response
Quote:quote_id, status (rendering, ready), input_hash, preview (url, null while rendering; thumbnails), total_usdc (null until ready), service_fee_usdc, expires_at.
Order: order_id, order_status (pending, submitting, accepted, canceled, failed, or needs_reconciliation: acceptance unconfirmed), fulfillment_status, payment_status, total_usdc, signed_receipt (null until final), events (each event_id, event_type, occurred_at), cancel_before, refunded_at, delivery_proves_readership (always false).
SDK usage
TypeScript
client.physical_mail, snake case; async methods start with a.
Delivery states
fulfillment_status: accepted, mailed, in_transit, in_local_area, processed_for_delivery (not yet delivered), delivered; or returned_to_sender, canceled, render_failed. Postal events never add a charge.
Refunds
A confirmed cancellation or a failure before production refunds the full amount, service fee included, as credits, once. Returned mail is not refunded. Cancel works only before production;cancel_before is an estimate.