API Documentation

API Reference v1

Programmatic access to temporary email creation, message retrieval, and domain management.

https://temp-mail.plus/api/v1

Authentication

All API v1 endpoints authenticate using your API key passed directly in the URL path as the {apiKey} segment.

You can find your API key in the Dashboard → API page. Keep it secret — anyone with your key can act on your behalf.

Example:

curl https://temp-mail.plus/api/v1/history/{your-api-key}

Quick Start

Here's a typical workflow showing how to create a temporary email, wait for messages, read them, and clean up.

  1. Create a temporary email
    Generate a random disposable address with a single POST request.
    curl -X POST https://temp-mail.plus/api/v1/email/create/{your-api-key}
  2. Use the email address
    Sign up on a website, trigger a verification email, or use the address wherever you need a temporary inbox. Save the email_token from the response.
  3. Check for new messages
    Poll the messages endpoint to see incoming mail.
    curl https://temp-mail.plus/api/v1/messages/{email_token}/{your-api-key}
  4. Read a specific message
    Fetch the full message content using its id from the messages list.
    curl https://temp-mail.plus/api/v1/message/{message_id}/{your-api-key}
  5. Download attachments (optional)
    If the message has attachments, download them using the attachment URL returned in the message response.
    curl -O https://temp-mail.plus/api/v1/d/{hash_id}/file.pdf/{your-api-key}
  6. Clean up
    Delete individual messages or the entire email when you're done.
    # Delete a message
    curl -X POST https://temp-mail.plus/api/v1/message/delete/{message_id}/{your-api-key}
    
    # Delete the email
    curl -X POST https://temp-mail.plus/api/v1/email/delete/{email_token}/{your-api-key}

Rate Limits

API requests are rate-limited per plan. Exceeding the limit returns a 429 status.

PlanRequests / minAPI Calls / month
Free1050
Basic301,000
Pro6010,000

Every API response includes rate-limit headers so you can track your usage:

Response Headers
  • X-RateLimit-Limit — Maximum requests allowed per window
  • X-RateLimit-Remaining — Requests remaining in current window
  • X-RateLimit-Reset — Unix timestamp when the current window resets
  • Retry-After — Seconds until you can retry (only on 429 responses)

You can also check your rate limit status programmatically via the Rate Limit endpoint without consuming any API usage.

When you exceed the limit, you'll receive a 429 response with Retry-After header:

{
  "message": "Too Many Attempts.",
  "retry_after": 42
}

Error Handling

All errors return a consistent JSON envelope:

{
  "status": "error",
  "message": "Human-readable error description."
}
CodeMeaningCommon Cause
400Bad RequestInvalid email format or parameters
401UnauthorizedInvalid or missing API key
404Not FoundResource doesn't exist or domain not allowed
429Too Many RequestsRate limit or monthly quota exceeded
POST /email/create/{apiKey}

Create a new temporary email address. By default a random address is generated, but you can customize the email, domain, or domain type via the JSON request body.

ParameterTypeDescription
apiKey requiredstringYour API key (URL path)

Request Body (JSON, optional)

FieldTypeDescription
email optionalstringDesired username (before the @). Must be used with domain.
domain optionalstringDomain to use (must be an allowed domain for your plan). If only domain is provided, a random username is generated.
domain_type optionalstringFilter domain by type: free, premium, or custom. Ignored if domain is provided.
# Random email (no body needed)
curl -X POST https://temp-mail.plus/api/v1/email/create/{your-api-key}

# Custom email + domain
curl -X POST https://temp-mail.plus/api/v1/email/create/{your-api-key} \
  -H "Content-Type: application/json" \
  -d '{"email": "myname", "domain": "domain.com"}'

# Random email on a specific domain
curl -X POST https://temp-mail.plus/api/v1/email/create/{your-api-key} \
  -H "Content-Type: application/json" \
  -d '{"domain": "domain.com"}'

# Random email on free domains only
curl -X POST https://temp-mail.plus/api/v1/email/create/{your-api-key} \
  -H "Content-Type: application/json" \
  -d '{"domain_type": "free"}'
Response 200
{
  "status": "success",
  "data": {
    "id": 1,
    "email": "[email protected]",
    "domain": "domain.com",
    "ip": "203.0.113.1",
    "fingerprint": "a1b2c3d4...",
    "expire_at": "2025-01-15T12:00:00.000000Z",
    "email_token": "eyJpdiI6...",
    "ttl": 600
  }
}
Response Headers
  • X-RateLimit-Limit — e.g. 60
  • X-RateLimit-Remaining — e.g. 59
  • X-RateLimit-Reset — e.g. 1705312800
400 {"status":"error","message":"This username is not allowed"}
400 {"status":"error","message":"This domain is not allowed"}
400 {"status":"error","message":"Invalid domain_type. Use: free, premium, or custom."}
401 {"status":"error","message":"Unauthorized access. Invalid API key."}
429 {"status":"error","message":"API usage limit reached."}
POST /email/delete/{email_token}/{apiKey}

Delete a temporary email address. The email is expired and soft-deleted immediately along with all its messages.

ParameterTypeDescription
email_token requiredstringEncrypted token from create response
apiKey requiredstringYour API key
curl -X POST https://temp-mail.plus/api/v1/email/delete/{email_token}/{your-api-key}
Response 200
{
  "status": "success",
  "message": "Email has been successfully deleted."
}
Response Headers
  • X-RateLimit-Limit — e.g. 60
  • X-RateLimit-Remaining — e.g. 58
  • X-RateLimit-Reset — e.g. 1705312800
400 {"status":"error","message":"Invalid email format"}
401 {"status":"error","message":"Unauthorized access. Invalid API key."}
404 {"status":"error","message":"Email not found."}
429 {"status":"error","message":"API usage limit reached."}
GET /api/go-to-email/{email_token}/{apiKey}

Reopen a previously used email by its token. Creates a new inbox entry for the same address, allowing you to receive messages again.

ParameterTypeDescription
email_token requiredstringEncrypted token of the email to reopen
apiKey requiredstringYour API key
curl https://temp-mail.plus/api/v1/api/go-to-email/{email_token}/{your-api-key}
Response 200
{
  "status": "success",
  "data": {
    "id": 3,
    "email": "[email protected]",
    "domain": "domain.com",
    "ip": "203.0.113.1",
    "fingerprint": "a1b2c3d4...",
    "expire_at": "2025-01-15T12:00:00.000000Z",
    "email_token": "eyJpdiI6...",
    "ttl": 600
  }
}
Response Headers
  • X-RateLimit-Limit — e.g. 60
  • X-RateLimit-Remaining — e.g. 57
  • X-RateLimit-Reset — e.g. 1705312800
400 {"status":"error","message":"Invalid email format"}
401 {"status":"error","message":"Unauthorized access. Invalid API key."}
404 {"status":"error","message":"This domain is not allowed"}
429 {"status":"error","message":"API usage limit reached."}
GET /messages/{email_token}/{apiKey}

Retrieve all messages for a temporary email inbox. Returns message metadata including sender, subject, and read status.

ParameterTypeDescription
email_token requiredstringEncrypted token of the email inbox
apiKey requiredstringYour API key
curl https://temp-mail.plus/api/v1/messages/{email_token}/{your-api-key}
Response 200
{
  "status": "success",
  "mailbox": "[email protected]",
  "email_token": "eyJpdiI6...",
  "messages": [
    {
      "id": "abc123",
      "to": "[email protected]",
      "subject": "Welcome!",
      "from": "Sender Name",
      "from_email": "[email protected]",
      "receivedAt": "2025-01-15T10:30:00Z",
      "is_seen": 0,
      "attachments": []
    }
  ]
}
Response Headers
  • X-RateLimit-Limit — e.g. 60
  • X-RateLimit-Remaining — e.g. 56
  • X-RateLimit-Reset — e.g. 1705312800
400 {"status":"error","message":"Invalid email format"}
401 {"status":"error","message":"Unauthorized access. Invalid API key."}
429 {"status":"error","message":"API usage limit reached."}
GET /message/{message_id}/{apiKey}

Retrieve a single message by its ID (hash_id). Returns full message content including HTML body and attachments.

ParameterTypeDescription
message_id requiredstringMessage hash ID from the messages list
apiKey requiredstringYour API key
curl https://temp-mail.plus/api/v1/message/{message_id}/{your-api-key}
Response 200
{
  "status": "success",
  "data": {
    "uuid": "abc123-def456",
    "to": "[email protected]",
    "subject": "Welcome!",
    "from": "Sender Name",
    "from_email": "[email protected]",
    "receivedAt": "2025-01-15T10:30:00Z",
    "id": "abc123",
    "attachments": [],
    "content": "<html>...</html>"
  }
}
Response Headers
  • X-RateLimit-Limit — e.g. 60
  • X-RateLimit-Remaining — e.g. 54
  • X-RateLimit-Reset — e.g. 1705312800
401 {"status":"error","message":"Unauthorized access. Invalid API key."}
429 {"status":"error","message":"API usage limit reached."}
GET /message/{message_id}/source/{apiKey}

Retrieve the raw EML source of a message. The EML file contains the complete original email including all headers, MIME parts, and encoded attachments. Useful for debugging, archiving, or advanced email parsing.

ParameterTypeDescription
message_id requiredstringMessage hash ID from the messages list
apiKey requiredstringYour API key
curl https://temp-mail.plus/api/v1/message/{message_id}/source/{your-api-key}
Response 200
{
  "status": "success",
  "data": {
    "id": "abc123",
    "source": "From: [email protected]\r\nTo: [email protected]\r\nSubject: Hello\r\nMIME-Version: 1.0\r\n..."
  }
}
Response Headers
  • X-RateLimit-Limit — e.g. 60
  • X-RateLimit-Remaining — e.g. 54
  • X-RateLimit-Reset — e.g. 1705312800
401 {"status":"error","message":"Unauthorized access. Invalid API key."}
404 {"status":"error","message":"Message source not available."}
429 {"status":"error","message":"API usage limit reached."}
POST /message/delete/{message_id}/{apiKey}

Delete a single message by its ID. This action is permanent and cannot be undone.

ParameterTypeDescription
message_id requiredstringMessage hash ID to delete
apiKey requiredstringYour API key
curl -X POST https://temp-mail.plus/api/v1/message/delete/{message_id}/{your-api-key}
Response 200
{
  "status": "success",
  "message": "Message was deleted successfully."
}
Response Headers
  • X-RateLimit-Limit — e.g. 60
  • X-RateLimit-Remaining — e.g. 53
  • X-RateLimit-Reset — e.g. 1705312800
401 {"status":"error","message":"Unauthorized access. Invalid API key."}
404 {"status":"error","message":"Message not found."}
429 {"status":"error","message":"API usage limit reached."}
GET /d/{hash_id}/{file}/{apiKey}

Download an attachment file from a message. Returns the file binary directly on success. Requires the attachments feature to be enabled on your plan.

ParameterTypeDescription
hash_id requiredstringMessage hash ID containing the attachment
file optionalstringAttachment filename
apiKey requiredstringYour API key
curl -O https://temp-mail.plus/api/v1/d/{hash_id}/document.pdf/{your-api-key}
Response 200
# Binary file download (Content-Disposition: attachment)
Response Headers
  • X-RateLimit-Limit — e.g. 60
  • X-RateLimit-Remaining — e.g. 52
  • X-RateLimit-Reset — e.g. 1705312800
401 {"status":"error","message":"Unauthorized access. Invalid API key."}
404 {"status":"error","message":"Not found."}
429 {"status":"error","message":"you can't download the attachments"}
GET /history/{apiKey}

List all previously created temporary email addresses for your account, ordered by most recent first.

ParameterTypeDescription
apiKey requiredstringYour API key
curl https://temp-mail.plus/api/v1/history/{your-api-key}
Response 200
{
  "status": "success",
  "message": "history fetched successfully",
  "data": [
    {
      "id": 1,
      "email": "[email protected]",
      "created_at": "2025-01-15T08:00:00.000000Z"
    },
    {
      "id": 2,
      "email": "[email protected]",
      "created_at": "2025-01-14T15:30:00.000000Z"
    }
  ]
}
Response Headers
  • X-RateLimit-Limit — e.g. 60
  • X-RateLimit-Remaining — e.g. 51
  • X-RateLimit-Reset — e.g. 1705312800
401 {"status":"error","message":"Unauthorized access. Invalid API key."}
429 {"status":"error","message":"API usage limit reached."}
GET /domains/{apiKey}/{type?}

List available domains for creating temporary emails. Filter by type to see only free, premium, or custom domains.

ParameterTypeDescription
apiKey requiredstringYour API key
type optionalstringFilter: free, premium, custom, or all (default)
# All domains
curl https://temp-mail.plus/api/v1/domains/{your-api-key}/all

# Only free domains
curl https://temp-mail.plus/api/v1/domains/{your-api-key}/free
Response 200
{
  "status": "success",
  "data": {
    "domains": [
      { "domain": "temp-mail.plus", "type": "Free" },
      { "domain": "premium-mail.com", "type": "Premium" },
      { "domain": "my-domain.com", "type": "Custom" }
    ]
  }
}
Response Headers
  • X-RateLimit-Limit — e.g. 60
  • X-RateLimit-Remaining — e.g. 50
  • X-RateLimit-Reset — e.g. 1705312800
400 {"status":"error","message":"Invalid domain type. Use: free, premium, custom, or all."}
401 {"status":"error","message":"Unauthorized access. Invalid API key."}
429 {"status":"error","message":"API usage limit reached."}
GET /rate-limit/{apiKey}

Check your current rate limit status without consuming any API usage. This endpoint is excluded from rate limiting and does not count toward your monthly API call quota.

ParameterTypeDescription
apiKey requiredstringYour API key
curl https://temp-mail.plus/api/v1/rate-limit/{your-api-key}
Response 200
{
  "status": "success",
  "data": {
    "limit": 60,
    "remaining": 45,
    "reset": 32,
    "plan": "pro-plan"
  }
}
FieldTypeDescription
limitintegerMaximum requests allowed per minute for your plan
remainingintegerRequests remaining in the current window
resetintegerSeconds until the rate limit window resets
planstringYour current plan tag (e.g. free, pro, pro-plan)
401 {"status":"error","message":"Unauthorized access. Invalid API key."}