Overview
All endpoints are under https://minutemail.xyz/api. Responses are JSON. Authentication is via the Authorization: Bearer <sessionToken> header.
Base URL
https://minutemail.xyz/api
Note
The session token is returned when you create a mailbox. Include it in the Authorization header for all subsequent requests to that mailbox.
Create Mailbox
/api/mailboxCreate a new temporary mailbox with a specified duration.
Request Body
| Field | Type | Description |
|---|---|---|
| duration | number | Minutes: 2, 5, 10, 15, 30, 45, or 60. Default: 10 |
curl -X POST https://minutemail.xyz/api/mailbox \
-H "Content-Type: application/json" \
-d '{"duration": 10}'Response 201
{
"id": "abc123def456",
"address": "[email protected]",
"createdAt": 1711738800000,
"expiresAt": 1711739400000,
"duration": 10,
"sessionToken": "tok_abc123..."
}Get Mailbox
/api/mailbox/:idRetrieve mailbox metadata and all emails. Requires session token.
curl https://minutemail.xyz/api/mailbox/abc123def456 \
-H "Authorization: Bearer tok_abc123..."Response 200
{
"id": "abc123def456",
"address": "[email protected]",
"createdAt": 1711738800000,
"expiresAt": 1711739400000,
"emails": [
{
"id": "email_001",
"from": "[email protected]",
"subject": "Verify your email",
"preview": "Click the link below to verify...",
"receivedAt": 1711738900000,
"read": false
}
]
}Get Email
/api/mailbox/:id/email/:emailIdRetrieve a specific email with full body content and attachments.
curl https://minutemail.xyz/api/mailbox/abc123def456/email/email_001 \
-H "Authorization: Bearer tok_abc123..."Response 200
{
"id": "email_001",
"from": "[email protected]",
"fromName": "Example App",
"to": "[email protected]",
"subject": "Verify your email",
"textBody": "Click: https://example.com/verify?t=...",
"htmlBody": "<html>...</html>",
"receivedAt": 1711738900000,
"read": true,
"attachments": []
}Extend Mailbox
/api/mailbox/:id/extendExtend the mailbox expiration time. Default adds 10 minutes.
| Field | Type | Description |
|---|---|---|
| minutes | number | Minutes to add. Default: 10. Max total: 60 from now. |
curl -X POST https://minutemail.xyz/api/mailbox/abc123def456/extend \
-H "Content-Type: application/json" \
-H "Authorization: Bearer tok_abc123..." \
-d '{"minutes": 15}'Delete Mailbox
/api/mailbox/:idPermanently destroy a mailbox and all its data immediately.
curl -X DELETE https://minutemail.xyz/api/mailbox/abc123def456 \
-H "Authorization: Bearer tok_abc123..."Warning
This action is irreversible. All emails, attachments, and metadata are permanently deleted.
Attachments
/api/mailbox/:id/email/:emailId/attachment/:filenameDownload a specific attachment from an email. Returns the raw file with appropriate Content-Type headers.
curl -O https://minutemail.xyz/api/mailbox/abc123/email/email_001/attachment/report.pdf \
-H "Authorization: Bearer tok_abc123..."Error Codes
All error responses follow the same format:
{ "error": "Human-readable error message" }| Status | Meaning |
|---|---|
| 400 | Bad request — invalid parameters |
| 401 | Unauthorized — missing or invalid session token |
| 404 | Not found — mailbox or email doesn't exist (or expired) |
| 429 | Rate limited — too many requests from this IP |
| 500 | Server error — unexpected failure |