All production API calls should target https://api.mailagents.net.
This guide is the production operating contract for agents. Use the live endpoints, assume strict wallet authentication, request short-lived HMAC payment proofs when you are over free limits, and always release mailboxes when the workflow is complete.
export API_BASE="https://api.mailagents.net"
curl -s "$API_BASE/v2/auth/siwe/challenge" \
-H 'content-type: application/json' \
-d '{"wallet_address":"0xYOUR_WALLET"}'
Sign the returned message using the live wallet on the configured chain.
curl -s "$API_BASE/v2/auth/siwe/verify" \
-H 'content-type: application/json' \
-d '{"message":"<challenge_message>","signature":"<wallet_signature>"}'
Persist access_token, agent_id, tenant_id, and did.
curl -s "$API_BASE/v2/mailboxes/leases" \
-H 'content-type: application/json' \
-H 'authorization: Bearer <access_token>' \
-H 'x-payment-proof: <x_payment_proof>' \
-d '{"agent_id":"<agent_id>","purpose":"signup","ttl_hours":1}'
Persist lease_id, mailbox_id, account_id, address, expires_at, and any issued login details.
curl -s "$API_BASE/v2/payments/proof" \
-H 'content-type: application/json' \
-H 'authorization: Bearer <access_token>' \
-d '{"method":"POST","path":"/v2/mailboxes/leases"}'
Use the returned x_payment_proof value exactly as the x-payment-proof header.
For browser-based operation, open https://api.mailagents.net/app. It already handles runtime detection, wallet connect, mailbox selection, webhook setup, usage lookup, and send-mail flow.
Production is currently running with strict SIWE and HMAC billing proofs. Local shortcuts such as mock-proof or fake signatures are not valid on the live deployment.
access_tokenagent_idtenant_idmailbox_idaddresswebmail_passwordPOST /v2/mailboxes/leasesGET /v2/messagesPOST /v2/messages/sendPOST /v2/webhookscurl -s "$API_BASE/v2/payments/proof" \
-H 'content-type: application/json' \
-H 'authorization: Bearer <access_token>' \
-d '{"method":"GET","path":"/v2/messages"}'
curl -s "$API_BASE/v2/messages?mailbox_id=<mailbox_id>&limit=10" \ -H 'authorization: Bearer <access_token>' \ -H 'x-payment-proof: <latest_messages_proof>'
If the allocate response already returned webmail_password, agents can send mail with that password directly. Use reset only for explicit rotation or password recovery.
curl -s "$API_BASE/v2/mailboxes/accounts/<account_id>/credentials/reset" \ -H 'content-type: application/json' \ -H 'authorization: Bearer <access_token>'
curl -s "$API_BASE/v2/payments/proof" \
-H 'content-type: application/json' \
-H 'authorization: Bearer <access_token>' \
-d '{"method":"POST","path":"/v2/messages/send"}'
curl -s "$API_BASE/v2/messages/send" \
-H 'content-type: application/json' \
-H 'authorization: Bearer <access_token>' \
-H 'x-payment-proof: <send_proof>' \
-d '{"mailbox_id":"<mailbox_id>","to":"[email protected]","subject":"agent send api","text":"hello from production agent","mailbox_password":"<webmail_password>"}'
curl -s "$API_BASE/v2/mailboxes/leases/<lease_id>/release" \ -H 'content-type: application/json' \ -H 'authorization: Bearer <access_token>'
/v2/meta/runtime or the live UI to confirm current chain and auth mode./v2/messages for parsed OTP and verification-link workflows.POST /v2/webhooks when downstream automation needs push delivery./admin when you need operator visibility into tenants, webhooks, invoices, risk events, or audit logs.https://api.mailagents.net/apphttps://api.mailagents.net/adminhttps://api.mailagents.net/v2/meta/runtimehttps://inbox.mailagents.net/webmail/This page is the production instruction surface for agents. If an agent follows the steps on this page, it should be able to authenticate, allocate a mailbox, read OTP mail, send mail, and close the lease against the live deployment.