API Documentation

Integrate Temp Mail into your applications

Get Your API Key

Premium users get full API access. Generate your API key to start integrating.

Not a premium user? Upgrade now

Try the API

These requests use the real service and your own account.

—

Authentication

All API requests require authentication using your API key. Include your key in the X-API-Key header:

X-API-Key: YOUR_API_KEY

Create Email Address

POST /api/v1/email/create

Create a new temporary email address.

Request Body
Parameter Type Required Description
username string No Custom username (random if not provided)
domain string No Domain from available list
duration integer No Duration in minutes (default: 10)
Example Request
curl -X POST https://api.tempmail.com/v1/email/create \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"username": "mytemp", "domain": "tempmail.org"}'
Response
{
  "success": true,
  "email": "mytemp@tempmail.org",
  "expires_at": "2024-12-20T10:30:00Z",
  "session_id": "abc123xyz"
}

Get Messages

GET /api/v1/messages/{email}

Retrieve all messages for an email address.

Parameters
Parameter Type Required Description
email string Yes The email address
limit integer No Max messages to return (default: 50)
Example Request
curl -X GET https://api.tempmail.com/v1/messages/mytemp@tempmail.org \
  -H "X-API-Key: YOUR_API_KEY"

Get Single Message

GET /api/v1/message/{id}

Retrieve a specific message by ID.

Example Response
{
  "id": 123,
  "from_address": "sender@example.com",
  "subject": "Welcome to our service",
  "body": "Email content here...",
  "html_body": "<p>Email content here...</p>",
  "received_at": "2024-12-20T10:15:00Z",
  "attachments": []
}

Delete Email

DELETE /api/v1/email/{email}

Delete an email address and all its messages.

Get Available Domains

GET /api/v1/domains

Get list of available domains for creating emails.

Example Response
{
  "domains": [
    "tempmail.org",
    "netlink.com",
    "tmpmail.net"
  ],
  "premium_domains": [
    "business.mail",
    "secure.email"
  ]
}

Rate Limits

Reference plan limits; policy enforcement will be connected in the subscription phase.

Plan Requests/Day Requests/Minute
Free 100 10
Premium 10,000 100
Business Unlimited 1000

Error Codes

Code Description
400 Bad Request - Invalid parameters
401 Unauthorized - Invalid API key
404 Not Found - Resource doesn't exist
429 Too Many Requests - Rate limit exceeded
500 Internal Server Error

Ready to Build?

Start integrating Temp Mail into your applications today

Get API Access