EZMinBOX
API v1.0 Docs
System Stable

EZMinBOX Developers

Integrate temporary email services into your application with just a few lines of code. A powerful tool for automation, testing, and privacy.

Giới thiệu

Chào mừng bạn đến với tài liệu hướng dẫn tích hợp **EZMinBOX API**. Hệ thống của chúng tôi cung cấp giải pháp email tạm thời (disposable email) tốc độ cao, bảo mật và dễ sử dụng thông qua giao thức REST API chuẩn.

Tốc độ cực nhanh

Tin nhắn được nhận và hiển thị trong chưa đầy 1 giây qua Webhooks và Polling.

Bảo mật & Riêng tư

Toàn bộ dữ liệu được xóa tự động sau 24h. Hỗ trợ xác thực Bearer mạnh mẽ.

Xác thực

Tất cả các yêu cầu API phải bao gốm API Key của bạn trong Header Authorization. Bạn có thể tìm thấy mã này trong phần cài đặt của Dashboard.

http
Authorization: Bearer ez_live_xxxxxxxxxxxxxxxxxxxxxxxx
Lưu ý quan trọng: Không bao giờ chia sẻ API Key của bạn công khai. Sử dụng các biến môi trường (Environment Variables) để lưu trữ khóa này trong mã nguồn của bạn.
auth API
GET/api/auth/me

Get Account Information

Returns details of the current user authenticated via session or API Key.

Code Sample

curl
curl -X GET "https://ezminbox.com/api/auth/me" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response Example

json
{
  "userId": "user_12345",
  "email": "user@example.com",
  "username": "john_doe",
  "role": "user",
  "isPremium": true,
  "webhookUrl": "https://your-domain.com/webhook"
}
account API
POST/api/accounts

Create New Mailbox

Create a new temporary email address. You need to provide the desired address (including domain) and a password.

Parameters

NameTypeRequiredDescription
addressstringYesFull email address (e.g., hello@ezminbox.com)
passwordstringYesSecure password for the email account

Code Sample

curl
curl -X POST "https://ezminbox.com/api/accounts" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "address": "test_account@ezminbox.com",
  "password": "secure_pass_99"
}'

Response Example

json
{
  "id": "acc_556677",
  "address": "test_account@ezminbox.com",
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "createdAt": "2024-03-11T..."
}
GET/api/accounts/me

Current Mailbox Info

Get info of the mailbox currently being used in the session.

Code Sample

curl
curl -X GET "https://ezminbox.com/api/accounts/me" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response Example

json
{
  "id": "acc_556677",
  "address": "test_account@ezminbox.com",
  "expiresAt": "2024-03-12T..."
}
message API
GET/api/messages

Email List

Retrieve all emails currently in the logged-in inbox.

Code Sample

curl
curl -X GET "https://ezminbox.com/api/messages" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response Example

json
[
  {
    "id": "msg_xyz789",
    "from_name": "Facebook",
    "from_address": "security@facebookmail.com",
    "subject": "Your login code: 678902",
    "intro": "Hi user, your login code is 678902...",
    "otpCode": "678902",
    "createdAt": "2024-03-11T..."
  }
]
GET/api/messages/[id]

Email Details

Get detailed content of a specific email (including HTML and Plain text).

Code Sample

curl
curl -X GET "https://ezminbox.com/api/messages/[id]" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response Example

json
{
  "id": "msg_xyz789",
  "subject": "Your login code: 678902",
  "bodyHtml": "<html>...</html>",
  "bodyText": "Hi user, your login code is 678902...",
  "otpCode": "678902"
}
DELETE/api/messages/[id]

Delete Email

Remove an email from the list.

Code Sample

curl
curl -X DELETE "https://ezminbox.com/api/messages/[id]" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response Example

json
{
  "success": true
}
domain API
GET/api/domains

System Domain List

Get a list of available domains to create emails.

Code Sample

curl
curl -X GET "https://ezminbox.com/api/domains" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response Example

json
[
  {
    "id": "dom_1",
    "domain": "ezminbox.com"
  },
  {
    "id": "dom_2",
    "domain": "tempmail.io"
  }
]
GET/api/domains/user

Custom Domains (PRO)

List the custom domains you have added to the system.

Code Sample

curl
curl -X GET "https://ezminbox.com/api/domains/user" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response Example

json
[
  {
    "id": "udom_1",
    "domain": "my-custom-work.com",
    "status": "ACTIVE"
  }
]
POST/api/domains/user

Add Custom Domain

Add a new domain to start the DNS verification process.

Parameters

NameTypeRequiredDescription
domainstringYesDomain you own

Code Sample

curl
curl -X POST "https://ezminbox.com/api/domains/user" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "domain": "company.com"
}'

Response Example

json
{
  "id": "udom_2",
  "verificationToken": "token_123...",
  "status": "PENDING"
}
setting API
POST/api/user/apiKey

Refresh API Key

Generate a new API Key (the old key will be immediately invalidated).

Code Sample

curl
curl -X POST "https://ezminbox.com/api/user/apiKey" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response Example

json
{
  "apiKey": "ez_new_key_..."
}
POST/api/user/webhook

Update Webhook

Configure the URL to receive real-time email notifications.

Parameters

NameTypeRequiredDescription
webhookUrlstringYesURL starting with https://

Code Sample

curl
curl -X POST "https://ezminbox.com/api/user/webhook" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "webhookUrl": "https://my-app.com/api/webhook"
}'

Response Example

json
{
  "success": true,
  "webhookUrl": "https://my-app.com/api/webhook"
}

Webhooks (PRO)

Webhooks cho phép nhận thông báo theo thời gian thực mỗi khi có email mới gửi tới địa chỉ của bạn. Đây là cách tối ưu nhất để xây dựng automation mà không cần liên tục gửi request polling.

Payload Structure (POST JSON)

json
{
  "event": "message.received",
  "data": {
    "id": "msg_550e8400",
    "from": "security@google.com",
    "subject": "Your verification code: 998822",
    "otp": "998822",
    "bodyText": "Hello, your code is 998822...",
    "receivedAt": "2024-03-11T12:00:00Z"
  }
}

Extract OTP

Auto-Detect

EZMinBOX tự động nhận diện và trích xuất mã OTP từ email đến. Mã OTP được trả về trong trường otpCode của mọi API response — bạn không cần parse email thủ công.

Định dạng hỗ trợ

  • Mã 4-8 chữ số (vd: 1234, 667890)
  • Mã bao gồm chữ và số (Alpha-numeric)
  • Nhận diện từ Subject hoặc Body
  • Hỗ trợ đa ngôn ngữ (EN, VI, ...)

Lợi ích

  • Không cần parse HTML/text thủ công
  • Giảm tải xử lý cho Client
  • Tăng tốc độ automation workflow
  • Hiển thị trực tiếp trên Dashboard

Extract OTP Workflow

1

Create temporary mailbox

POST /api/accounts → Get email address + token

2

Use email for service registration

Use the created email to receive OTP verification codes from any service

3

Polling email list

GET /api/messages → Check for new emails, otpCode field will contain the OTP

4

Get OTP from response

Read otpCode directly — no regex or HTML parsing needed!

cURL — Get email details + OTP

bash
curl https://ezminbox.com/api/messages/msg_xyz789 \
  -H "Authorization: Bearer ez_live_aBcDeFgH..."

# Response:
# {
#   "id": "msg_xyz789",
#   "accountId": "acc_556677",
#   "from_name": "Facebook",
#   "from_address": "security@facebookmail.com",
#   "to_address": "user@checkmap.store",
#   "subject": "Your login code: 482910",
#   "bodyHtml": "<p>Your verification code is <b>482910</b></p>",
#   "bodyText": "Your verification code is 482910",
#   "otpCode": "482910",
#   "hasAttachments": false,
#   "createdAt": "2026-03-12T01:00:00.000Z"
# }

Node.js — Auto-polling OTP

javascript
const API_URL = "https://ezminbox.com";
const API_KEY = "ez_live_aBcDeFgH...";

async function waitForOTP(maxAttempts = 30, interval = 2000) {
  for (let i = 0; i < maxAttempts; i++) {
    const res = await fetch(`${API_URL}/api/messages`, {
      headers: { "Authorization": `Bearer ${API_KEY}` }
    });
    const messages = await res.json();
    
    // Tìm message có OTP
    const otpMessage = messages.find(msg => msg.otpCode);
    if (otpMessage) {
      console.log("✅ OTP found:", otpMessage.otpCode);
      return otpMessage.otpCode;
    }
    
    console.log(`⏳ Attempt ${i + 1}/${maxAttempts} - waiting...`);
    await new Promise(r => setTimeout(r, interval));
  }
  throw new Error("Timeout: No OTP received");
}

// Usage
const otp = await waitForOTP();
console.log("Mã OTP:", otp); // "482910"

Python — Extract OTP

python
import requests, time

API_URL = "https://ezminbox.com"
API_KEY = "ez_live_aBcDeFgH..."
headers = {"Authorization": f"Bearer {API_KEY}"}

def wait_for_otp(max_attempts=30, interval=2):
    for i in range(max_attempts):
        res = requests.get(f"{API_URL}/api/messages", headers=headers)
        messages = res.json()
        
        for msg in messages:
            if msg.get("otpCode"):
                print(f"✅ OTP found: {msg['otpCode']}")
                return msg["otpCode"]
        
        print(f"⏳ Attempt {i+1}/{max_attempts} - waiting...")
        time.sleep(interval)
    
    raise TimeoutError("No OTP received")

# Usage
otp = wait_for_otp()
print(f"Mã OTP: {otp}")  # "482910"
Pro tip: Combine with Webhooks instead of polling to receive OTP immediately upon new email arrival. The otp field is also sent in the Webhook payload.

Error Codes & Limits

HTTP Status Codes

200
OK
Request Successful
401
Unauthorized
Invalid or missing API Key
403
Forbidden
Account plan not authorized
404
Not Found
Resource does not exist
429
Rate Limit
Rate limit exceeded

Rate Limiting

The system applies a limit of 100 requests/minute per API Key. If exceeded, the system will return an HTTP 429 error.

PRO Member120 req/min
Free UserNo API Access