CyberMail — Email API
The Service API provides three email capabilities:
| Route | Capability | Use Case |
|---|---|---|
/email/* | Disposable email | Receive verification codes |
/agentmail/* | Professional email | Send and receive emails |
/resend/* | Custom domain sending | Branded emails |
Disposable Email
Get Available Domains
GET /email/domains
Create Email Account
POST /email/account
{ "username": "myagent" }username is optional; auto-generated if not provided.
Response
{
"address": "myagent@example.com",
"password": "auto-generated-password",
"token": "eyJhbGciOi...",
"id": "abc123"
}View Inbox
GET /email/messages
Requires x-email-token header or ?token= parameter.
curl -H "x-email-token: eyJhbGciOi..." https://service.cyberpay.org/email/messagesView Email Details
GET /email/messages/{id}
Also requires token.
Create Email and Wait for Code
POST /email/account-and-wait
One step: create email → poll and wait for the first email (120-second timeout) → automatically extract verification code.
Response — Success
{
"address": "agent-xxx@example.com",
"password": "auto-generated",
"token": "eyJhbGciOi...",
"message": { "subject": "Verify your email", "text": "Your code is 123456" },
"code": "123456"
}Response — Timeout
{
"address": "...",
"password": "...",
"token": "...",
"message": null,
"code": null,
"timeout": true
}Professional Email
Create Inbox
POST /agentmail/inboxes
{ "name": "support" }Send Email
POST /agentmail/send
{
"inbox_id": "inbox-uuid",
"to": "user@example.com",
"subject": "Hello",
"text": "Message body"
}Custom Domain Sending
Send Email
POST /resend/send
{
"to": "user@example.com",
"subject": "Welcome",
"text": "Plain text body",
"html": "<h1>Welcome</h1>",
"from": "noreply@cyberpay.org"
}from is optional; uses the configured domain by default.
Create Agent Email Address
POST /resend/agent-email
{ "agentId": "agent-001" }Response
{
"address": "agent-001@cyberpay.org",
"domain": "cyberpay.org"
}