Skip to content

API

Base URL: https://api.agentinbox.pro

Authentication: workspace API key on all routes except workspace bootstrap.

Authorization: Bearer ak_live_...
POST /api/workspaces
Content-Type: application/json
{ "name": "my-agent" }

201 — returns workspace_id, api_key (once), webhook_signing_secret.

Production bootstrap is rate-limited (3 workspaces per IP per day).

Platform subdomain without BYOD DNS. Requires wildcard MX on *.inbox.agentinbox.pro in production.

POST /api/instant-inbox
Authorization: Bearer <api_key>

201{ address, domain_id, domain, existing: false }
200 — returns existing platform inbox if workspace already has one.

Example address: inbox@abc12345.inbox.agentinbox.pro (catch-all on {slug}.inbox.agentinbox.pro).

POST /api/demo/inbox

No auth. Rate-limited by IP (same as bootstrap). Sets httpOnly cookie; returns { address, domain_id, domain }.

GET /api/demo/events

Returns { events: [...] } for the demo session cookie.

POST /api/domains
Authorization: Bearer <api_key>
Content-Type: application/json
{ "domain": "acme-agent.com" }

201 — domain row with txt_name, txt_value, mx_target, status pending_verification.

GET /api/domains/search?q=myagent&tlds=com,io
Authorization: Bearer <api_key>

Returns one result per candidate domain with the lowest available price across configured registrars. Each result includes the selected registrar.

POST /api/domains/purchase
Authorization: Bearer <api_key>
Content-Type: application/json
{ "domain": "myagent.com", "years": 1 }

201 (mock wallet) — order with order_id, domain_id, status, next_steps. Wallet debited before registrar call.

202 (Stripe Checkout) — order with order_id, status: pending_payment, checkout_url, next_steps. Poll order status after payment.

Re-quotes registrars and picks the cheapest available option. Optional registrar overrides that selection.

GET /api/domains/orders/{orderId}
Authorization: Bearer <api_key>
GET /api/domains/wallet
Authorization: Bearer <api_key>

Available when BILLING_PROVIDER=mock (local dev).

POST /api/webhooks/stripe
Stripe-Signature: ...

Called by Stripe after Checkout payment. Not for agent use.

POST /api/domains/{id}/verify
Authorization: Bearer <api_key>

200 — status mx_pending on success.
409 — TXT not found or mismatch.

GET /api/domains/{id}
Authorization: Bearer <api_key>
GET /api/domains/{id}/mx
Authorization: Bearer <api_key>

Returns MX record set pointing at mx.agentinbox.pro.

PATCH /api/domains/{id}/delivery
Authorization: Bearer <api_key>
Content-Type: application/json
{ "webhookUrl": "https://your-agent.example.com/webhooks/inbound-email" }

Requires verified domain. Production webhooks must be HTTPS.

GET /api/domains/{id}/events
Authorization: Bearer <api_key>

Inspection endpoint — webhooks are the primary delivery path.

GET /api/domains/{id}/delivery-attempts
Authorization: Bearer <api_key>
POST /api/domains/{id}/events/{eventId}/replay
Authorization: Bearer <api_key>
StatusMeaning
pending_verificationRegistered; TXT not yet verified
mx_pendingTXT verified; awaiting MX / first mail
verifiedOwnership proven
liveAt least one mail received and webhook delivered
disabledAdministratively disabled
LimitValue
Domains per workspace1
Inbound emails per day100
Max message size1 MB
Retention14 days
{ "error": "Human-readable message" }

Common codes: 400 validation, 401 missing/invalid API key, 404 not found, 409 state conflict, 429 rate limit.

Import the production collection from the repo: docs/Agent Mail Production.postman_collection.json.

Set base_url to https://api.agentinbox.pro and agentmail_domain to a domain you control.