Temporary Email API

Build robust email testing solutions with our powerful temporary email API. Perfect for automated testing, development, and quality assurance.

Why Use Our Temporary Email API?

Our API provides a reliable and scalable solution for managing temporary email addresses in your applications. Ideal for developers, testers, and automation engineers.

Fast & Scalable

Handle thousands of emails per second.

Secure & Private

End-to-end encryption and data protection.

Easy to Integrate

Simple REST API with detailed documentation.

API Documentation

Generate Email


POST /api/v1/temp-emails
Authorization: Bearer YOUR_API_KEY

Response:
{
    "email": "temp123@omypost.com",
    "expires_at": "2025-03-20T12:00:00Z",
    "token": "eyJhbGciOiJIUzI1NiIs..."
}
                

Fetch Messages


GET /api/v1/temp-emails/{email}/messages
Authorization: Bearer YOUR_API_KEY

Response:
{
    "messages": [
        {
            "id": "msg_456",
            "from": "test@example.com",
            "subject": "Test Message",
            "body": "Hello World",
            "received_at": "2025-03-20T10:00:00Z"
        }
    ]
}
                

Key Features

Webhook Support

Real-time notifications for new messages.

Message History

Access complete message history.

Advanced Search

Search through messages and attachments.

Attachment Handling

Download and process attachments.

Usage Metrics

Track API usage and performance.

Global CDN

Fast access from anywhere.

Integration Examples

Python Integration


import requests
import time

API_KEY = 'your_api_key'
BASE_URL = 'https://api.omypost.com/v1'

def create_temp_email():
    response = requests.post(
        f'{BASE_URL}/temp-emails',
        headers={'Authorization': f'Bearer {API_KEY}'}
    )
    return response.json()

def wait_for_message(email, timeout=60):
    start_time = time.time()
    while time.time() - start_time < timeout:
        response = requests.get(
            f'{BASE_URL}/temp-emails/{email}/messages',
            headers={'Authorization': f'Bearer {API_KEY}'}
        )
        messages = response.json()['messages']
        if messages:
            return messages[0]
        time.sleep(1)
    return None
                

JavaScript Integration


const axios = require('axios');

const API_KEY = 'your_api_key';
const BASE_URL = 'https://api.omypost.com/v1';

async function createTempEmail() {
    const response = await axios.post(
        `${BASE_URL}/temp-emails`,
        {},
        { headers: { Authorization: `Bearer ${API_KEY}` } }
    );
    return response.data;
}

async function waitForMessage(email, timeout = 60000) {
    const startTime = Date.now();
    while (Date.now() - startTime < timeout) {
        const response = await axios.get(
            `${BASE_URL}/temp-emails/${email}/messages`,
            { headers: { Authorization: `Bearer ${API_KEY}` } }
        );
        const messages = response.data.messages;
        if (messages.length > 0) {
            return messages[0];
        }
        await new Promise(resolve => setTimeout(resolve, 1000));
    }
    return null;
}
                

Frequently Asked Questions

What are the API limits?

Free tier: 1000 requests/day. Paid plans offer higher limits.

How long are messages stored?

Messages are stored for 24 hours by default.

Is the API suitable for production use?

Yes, our API is production-ready with 99.9% uptime.

Do you offer SDKs?

Yes, we provide SDKs for Python, Node.js, and other languages.

Start Building with Our API

Join developers worldwide using OmyPost's temporary email API.

Get API Key