Temp Mail Logo
Temp-Mail.im
Securing your temporary inbox ...
Enterprise REST API Gateway • 99.99% SLA • Sub-Second Global Ingestion

Enterprise Disposable Email REST Gateway

Commercial, high-throughput email verification infrastructure for QA engineers, SaaS platforms, and enterprise automated testing suites. Provision inboxes, extract OTP codes, and simulate millions of user signups with zero maintenance.

API GATEWAY
https://api.temp-mail.im/v1
🔒 Bearer Token Authentication
⚡ Sub-Second Inbound Delivery
🛡️ Zero-Log Ephemeral Storage
FLEXIBLE COMMERCIAL PLANS

API Access Tiers & Pricing

Choose a subscription tier engineered to scale with your automated testing and verification load.

Developer Starter

Free / Evaluation

Ideal for individual developers, open-source testing, and staging prototypes.

$ 0 / month
  • ✓ 100 API Calls / minute
  • ✓ Standard Receiving Domains
  • ✓ Automatic 20-min Expiration
  • ✓ JSON REST Endpoints
  • ✓ Community Support
Test in Sandbox
Enterprise Custom

Dedicated Cloud

For enterprise platforms requiring dedicated IP pools, custom domains, and strict compliance.

Custom Contact Sales
  • ✓ Unlimited Throughput & Calls
  • ✓ Bring Your Own Custom Domains
  • ✓ Dedicated Private IP Inbound Nodes
  • ✓ 24/7 Dedicated Support & Slack Channel
  • ✓ Custom SLA (99.99%) & BAA Agreement
  • ✓ Multi-Region Redundancy
Contact Enterprise Sales

Interactive API Gateway Simulator

Simulate REST requests and verify JSON schemas before writing production code.

Gateway Simulator
Ready 0ms
// Live JSON Gateway response will appear here...
{
  "status": "ready",
  "message": "Click 'POST /v1/mailboxes/new' to simulate gateway provisioning"
}
API GATEWAY SPECIFICATIONS

Standard REST Endpoints

All requests must include standard Bearer Token authentication via the HTTP Authorization header.

POST /v1/mailboxes/new
Mailbox Provisioning

Creates an ephemeral disposable mailbox on the global gateway. Returns email address and expiration metadata.

Request Headers

Header Type Required Description
Authorization string Required Bearer token in the format Bearer YOUR_API_KEY
Content-Type string Required Must be application/json
Request Body (JSON) application/json
{
  "domain": "getmail.site",
  "prefix": "qa-runner" // Optional custom alias
}
Response Example 200 OK
{
  "status": "success",
  "data": {
    "email": "qa-runner892k@getmail.site",
    "mailbox_id": "mbx_live_9a8f2b7c4d1e",
    "created_at": "2026-09-23T01:00:00.000Z",
    "expires_at": "2026-09-23T01:20:00.000Z",
    "retention_seconds": 1200
  }
}
GET /v1/mailboxes/:email/messages
Inbox Polling

Retrieves all received messages for an active temporary inbox, with pre-parsed plaintext, sanitized HTML, and automated OTP detection.

Path Parameters

Parameter Type Required Description
email string Required The mailbox address (e.g. qa-runner892k@getmail.site)
Response Array Example 200 OK
{
  "status": "success",
  "mailbox": "qa-runner892k@getmail.site",
  "count": 1,
  "messages": [
    {
      "id": "msg_9f82a1c0d4e5",
      "from": "Acme Auth <noreply@example.com>",
      "subject": "Your Verification Code is: 582910",
      "otp_code": "582910",
      "text_body": "Your single-use login code is 582910. Expires in 10 minutes.",
      "html_body": "<p>Your single-use login code is <strong>582910</strong>.</p>",
      "received_at": "2026-09-23T01:02:15.000Z"
    }
  ]
}
DELETE /v1/mailboxes/:email
Instant Purge

Immediately purges all stored emails and removes the mailbox session before standard 20-minute expiration.

Response Example 200 OK
{
  "status": "success",
  "message": "Mailbox and all ephemeral messages purged successfully."
}
INTEGRATION SDKS

Multi-Language Code Integration

Drop-in code snippets ready for copy-pasting into your automated tests and CI/CD pipelines.

quickstart.sh
# 1. Provision a new mailbox via API Gateway
curl -X POST "https://api.temp-mail.im/v1/mailboxes/new" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"domain": "getmail.site"}'

# 2. Poll for incoming messages & OTP verification codes
curl -X GET "https://api.temp-mail.im/v1/mailboxes/qa-bot721@getmail.site/messages" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
test-flow.js
// Production Node.js / Playwright / Cypress Integration
import axios from 'axios';

const API_KEY = process.env.TEMPMAIL_API_KEY || 'YOUR_API_KEY';
const client = axios.create({
  baseURL: 'https://api.temp-mail.im/v1',
  headers: { 'Authorization': `Bearer ${API_KEY}` }
});

// 1. Create Disposable Inbox
export async function createInbox() {
  const res = await client.post('/mailboxes/new');
  return res.data; // { email: "...", expires_at: "..." }
}

// 2. Poll for OTP Verification Code
export async function waitForOtp(email, timeoutMs = 30000) {
  const start = Date.now();
  while (Date.now() - start < timeoutMs) {
    const res = await client.get(`/mailboxes/${encodeURIComponent(email)}/messages`);
    if (res.data.messages && res.data.messages.length > 0) {
      const latest = res.data.messages[0];
      const match = latest.text_body.match(/\b\d{4,6}\b/);
      if (match) return match[0];
    }
    await new Promise(r => setTimeout(r, 2000));
  }
  throw new Error('Verification OTP timeout');
}
verify_otp.py
import time
import re
import requests

API_KEY = "YOUR_API_KEY"
HEADERS = {"Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json"}
BASE_URL = "https://api.temp-mail.im/v1"

# 1. Provision an ephemeral mailbox
def create_mailbox():
    response = requests.post(f"{BASE_URL}/mailboxes/new", headers=HEADERS)
    response.raise_for_status()
    return response.json()

# 2. Extract verification OTP code
def get_verification_otp(email_address, timeout=30):
    start = time.time()
    while time.time() - start < timeout:
        res = requests.get(f"{BASE_URL}/mailboxes/{email_address}/messages", headers=HEADERS)
        if res.status_code == 200:
            data = res.json()
            messages = data.get("messages", [])
            if messages:
                body = messages[0].get("text_body", "")
                otp = re.search(r'\b\d{4,6}\b', body)
                if otp:
                    return otp.group(0)
        time.sleep(2)
    raise TimeoutError("OTP email did not arrive in time.")
main.go
package main

import (
	"encoding/json"
	"fmt"
	"net/http"
	"time"
)

type MailboxResponse struct {
	Email     string    `json:"email"`
	ExpiresAt time.Time `json:"expires_at"`
}

func CreateMailbox(apiKey string) (*MailboxResponse, error) {
	req, _ := http.NewRequest("POST", "https://api.temp-mail.im/v1/mailboxes/new", nil)
	req.Header.Set("Authorization", "Bearer "+apiKey)
	
	client := &http.Client{Timeout: 10 * time.Second}
	resp, err := client.Do(req)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()

	var mb MailboxResponse
	if err := json.NewDecoder(resp.Body).Decode(&mb); err != nil {
		return nil, err
	}
	return &mb, nil
}
gateway.php
<?php
class TempMailGateway {
    private $apiKey;
    private $baseUrl = "https://api.temp-mail.im/v1";

    public function __construct($apiKey) {
        $this->apiKey = $apiKey;
    }

    public function getMessages($email) {
        $url = $this->baseUrl . "/mailboxes/" . urlencode($email) . "/messages";
        $ch = curl_init($url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_HTTPHEADER, [
            "Authorization: Bearer " . $this->apiKey,
            "Accept: application/json"
        ]);
        $res = curl_exec($ch);
        curl_close($ch);
        return json_decode($res, true);
    }
}
?>
TempMailGateway.cs
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text.Json;
using System.Threading.Tasks;

public class TempMailGateway
{
    private readonly HttpClient _client;

    public TempMailGateway(string apiKey)
    {
        _client = new HttpClient { BaseAddress = new Uri("https://api.temp-mail.im/v1/") };
        _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", apiKey);
    }

    public async Task<JsonElement> FetchInboxAsync(string email)
    {
        var response = await _client.GetAsync($"mailboxes/{Uri.EscapeDataString(email)}/messages");
        response.EnsureSuccessStatusCode();
        var json = await response.Content.ReadAsStringAsync();
        return JsonDocument.Parse(json).RootElement;
    }
}
Temp Mail Logo

Ready to Integrate Enterprise Temporary Email?

Get your production API key and automate high-throughput verification pipelines today.

We use essential cookies & local storage to keep your temp inbox active and save preferences. Read our Privacy Policy.