API Documentation

REST API for programmatic access to your temporary inbox.

Authentication

Create an account and get a JWT token. Include the token in the Authorization header:

# Login to get a token
curl -X POST https://amail.my/api/token \
  -H "Content-Type: application/json" \
  -d '{"address":"[email protected]","password":"secret"}'

# Use the token for authenticated requests
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9...

Rate Limits

25 requests per second per account. Exceeded returns 429 Too Many Requests.

Response Format

// Success
{ "success": true, "data": { ... } }

// With pagination
{ "success": true, "data": [...], "pagination": { "page":1, "limit":50, "total":42, "totalPages":1 } }

// Error
{ "success": false, "error": "Error message" }

Endpoints

GET
/api/domains

List available domains

public
POST
/api/accounts

Create a new inbox (address + password)

public
POST
/api/token

Get JWT token (address + password)

public
GET
/api/messages

List messages (pagination: ?page=1&limit=50)

auth
GET
/api/messages/:id

Get single message with body + attachments

auth
DELETE
/api/messages/:id

Delete a message

auth

Example: Full flow

# 1. Get available domains
curl https://amail.my/api/domains

# 2. Create account
curl -X POST https://amail.my/api/accounts \
  -H "Content-Type: application/json" \
  -d '{"address":"[email protected]","password":"secret"}'

# 3. Get JWT token
curl -X POST https://amail.my/api/token \
  -H "Content-Type: application/json" \
  -d '{"address":"[email protected]","password":"secret"}'

# 4. List messages
curl https://amail.my/api/messages \
  -H "Authorization: Bearer <TOKEN>"

# 5. Get single message
curl https://amail.my/api/messages/<ID> \
  -H "Authorization: Bearer <TOKEN>"

# 6. Delete message
curl -X DELETE https://amail.my/api/messages/<ID> \
  -H "Authorization: Bearer <TOKEN>"