API Documentation

Integrate 10Mail temporary email service into your applications

Quick Start

1. Enable API Access

Go to your Profile page and click "Enable API Access" to generate your API credentials.

2. Authentication

All API requests must include your API Key and Secret in the headers:

X-API-Key: tmk_your_api_key_here
X-API-Secret: tms_your_api_secret_here
3. Base URL
https://10mail.app/api/v1
4. Example Request
curl -X POST https://10mail.app/api/v1/emails \
  -H "X-API-Key: tmk_your_api_key" \
  -H "X-API-Secret: tms_your_secret" \
  -H "Content-Type: application/json" \
  -d '{"prefix": "myemail"}'

Plan Features

Feature Free Basic Advanced
Create Emails
Delete Emails
List Emails
Read Messages

API Endpoints

POST /api/v1/emails

Create a new temporary email address

Permission: All Users
Request Body:
{
  "prefix": "myemail",      // Optional: custom prefix (default: random)
  "domain": "10mail.app",   // Optional: domain (default: 10mail.app)
  "duration": 60            // Optional: minutes (free users: fixed 10min)
}
Response (200 OK):
{
  "success": true,
  "message": "Email created successfully",
  "data": {
    "id": 123,
    "email": "myemail@10mail.app",
    "prefix": "myemail",
    "domain": "10mail.app",
    "expires_at": "2025-01-18 12:30:00",
    "duration_minutes": 60,
    "is_active": true
  }
}

GET /api/v1/emails

List all your temporary emails with message counts

Permission: Advanced Plan Only
Response (200 OK):
{
  "success": true,
  "data": {
    "emails": [
      {
        "id": 123,
        "email": "test",
        "domain": "10mail.app",
        "full_email": "test@10mail.app",
        "is_active": true,
        "expires_at": "2025-01-18 12:30:00",
        "message_count": 5,
        "created_at": "2025-01-18 11:30:00"
      }
    ],
    "total": 1
  }
}

DELETE /api/v1/emails/{id}

Delete a temporary email address

Permission: Basic & Advanced Plans
Example:
DELETE /api/v1/emails/123
Response (200 OK):
{
  "success": true,
  "message": "Email deleted successfully"
}

GET /api/v1/messages/{email_id}

List all messages for a specific email

Permission: Advanced Plan Only
Example:
GET /api/v1/messages/123
Response (200 OK):
{
  "success": true,
  "data": {
    "email": "test@10mail.app",
    "messages": [
      {
        "id": "1737189000.M12345P6789.mail",
        "subject": "Welcome to 10Mail",
        "from": "noreply@example.com",
        "date": "Mon, 18 Jan 2025 10:30:00 +0800",
        "size": 2048,
        "received_at": "2025-01-18 10:30:00"
      }
    ],
    "total": 1
  }
}

GET /api/v1/messages/{email_id}/{message_id}

Get full content of a specific message

Permission: Advanced Plan Only
Example:
GET /api/v1/messages/123/1737189000.M12345P6789.mail
Response (200 OK):
{
  "success": true,
  "data": {
    "id": "1737189000.M12345P6789.mail",
    "email": "test@10mail.app",
    "headers": {
      "From": "noreply@example.com",
      "To": "test@10mail.app",
      "Subject": "Welcome to 10Mail",
      "Date": "Mon, 18 Jan 2025 10:30:00 +0800"
    },
    "body": "Welcome to 10Mail! Your temporary email is ready.",
    "raw": "From: noreply@example.com\r\nTo: test@10mail.app...",
    "size": 2048,
    "received_at": "2025-01-18 10:30:00"
  }
}

Error Responses

All errors follow this format:

{
  "success": false,
  "error": {
    "code": 401,
    "message": "Invalid API key"
  }
}
Common Error Codes:
Code Description
400 Bad Request - Invalid parameters
401 Unauthorized - Invalid API credentials
403 Forbidden - Insufficient permissions or quota exceeded
404 Not Found - Resource doesn't exist
405 Method Not Allowed - Wrong HTTP method
500 Internal Server Error - Server-side error

Code Examples

PHP
<?php
$apiKey = 'tmk_your_api_key';
$apiSecret = 'tms_your_api_secret';

$ch = curl_init('https://10mail.app/api/v1/emails');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'X-API-Key: ' . $apiKey,
    'X-API-Secret: ' . $apiSecret,
    'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
    'prefix' => 'myemail',
    'duration' => 60
]));

$response = curl_exec($ch);
$result = json_decode($response, true);

if ($result['success']) {
    echo "Email created: " . $result['data']['email'];
}
?>
Python
import requests

api_key = 'tmk_your_api_key'
api_secret = 'tms_your_api_secret'

headers = {
    'X-API-Key': api_key,
    'X-API-Secret': api_secret,
    'Content-Type': 'application/json'
}

data = {
    'prefix': 'myemail',
    'duration': 60
}

response = requests.post(
    'https://10mail.app/api/v1/emails',
    headers=headers,
    json=data
)

result = response.json()
if result['success']:
    print(f"Email created: {result['data']['email']}")
JavaScript (Node.js)
const fetch = require('node-fetch');

const apiKey = 'tmk_your_api_key';
const apiSecret = 'tms_your_api_secret';

fetch('https://10mail.app/api/v1/emails', {
  method: 'POST',
  headers: {
    'X-API-Key': apiKey,
    'X-API-Secret': apiSecret,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    prefix: 'myemail',
    duration: 60
  })
})
.then(res => res.json())
.then(data => {
  if (data.success) {
    console.log('Email created:', data.data.email);
  }
});

Ready to Get Started?

Enable API access from your profile to start integrating 10Mail into your applications.

Go to Profile