# Get a mailbox in one request
$ curl -X POST https://email.prim.sh/v1/mailboxes \
-H "X-402-Payment: $PAYMENT_TOKEN" \
-d '{"domain": "email.sh"}'
# → 402 → pay → 201
{
"id": "mbx_r8k2n4",
"address": "[email protected]",
"created_at": "2026-02-23T06:30:00Z",
"webhook": null,
"ttl": 86400
}
# Send email
$ curl -X POST https://email.prim.sh/v1/send \
-H "X-402-Payment: $PAYMENT_TOKEN" \
-d '{"from": "[email protected]", "to": "[email protected]",
"subject": "Task complete", "body": "Your report is ready."}'
Mailboxes are ephemeral by default (24h TTL). Extend or make permanent with a single API call.
Agent needs a GitHub account? Provision a mailbox, sign up, receive verification email, extract code, verify. All programmatic.
Send task completion emails, error alerts, daily reports. Agents communicating with humans where humans expect it — their inbox.
Give a mailbox to a data source. Inbound emails hit your webhook as structured JSON. The agent processes, never checks an inbox.
Spin up 50 mailboxes for 50 tasks. Each has its own address. No shared inbox, no routing rules, no filters. Isolation by default.
Need an email for a one-time verification? Create a mailbox, poll for the email, extract the link, destroy the mailbox. 30 seconds.
Agents on different platforms communicating via email. The universal protocol. No API integration needed — just SMTP.
# Mailbox management
POST /v1/mailboxes # Create mailbox
GET /v1/mailboxes # List your mailboxes
GET /v1/mailboxes/:id # Mailbox details
PUT /v1/mailboxes/:id # Update TTL, webhook, forwarding
DELETE /v1/mailboxes/:id # Destroy mailbox
# Sending
POST /v1/send # Send email (text or HTML)
POST /v1/send/raw # Send raw MIME
# Receiving
GET /v1/mailboxes/:id/messages # Poll for messages
GET /v1/messages/:id # Get message (headers, body, attachments)
DELETE /v1/messages/:id # Delete message
# Webhooks (push instead of poll)
PUT /v1/mailboxes/:id # Set webhook_url for inbound
# Inbound email → POST to your webhook as JSON:
# { "from", "to", "subject", "body_text", "body_html", "attachments": [...] }
# Custom domains (optional)
POST /v1/domains # Add custom domain
GET /v1/domains/:id/verify # Check DNS verification
# Your agent gets these tools
tools:
create_mailbox:
domain: "email.sh"
ttl: 3600 # 1 hour
webhook: "https://my-agent.example/inbound"
send_email:
from: "[email protected]"
to: "[email protected]"
subject: "Build complete"
body: "Deployed to production. All tests passing."
read_messages:
mailbox: "mbx_r8k2n4"
unread_only: true
destroy_mailbox:
mailbox: "mbx_r8k2n4"
| Action | Cost | Notes |
|---|---|---|
| Create mailbox | $0.001 | 24h TTL included |
| Extend mailbox (per day) | $0.001 | Or set permanent |
| Send email | $0.0005 | Up to 10MB |
| Receive email | Free | Included with mailbox |
| Webhook delivery | Free | 3 retries |
| Custom domain | $0.01/day | DNS verification required |
| Attachment storage | $0.01/GB/day | Auto-purge with mailbox |
Sub-cent pricing. An agent can run a full email workflow for under a penny.
Agents don't check inboxes. They poll endpoints and parse JSON.
Read the docs →or just: curl https://email.prim.sh/v1/mailboxes