API Documentation

// REST API FOR DEVELOPERS & BOT INTEGRATION

BASE_URL = https://tmailku.com
GENERATOR API KEY PUBLIK // GRATIS & INSTAN

Dapatkan API Key gratis secara mandiri untuk integrasi bot Telegram, skrip automasi Python, cURL, maupun pengujian backend tanpa harus login ke dashboard admin.

Batas: 120 req/m Berlaku: 30 Hari Proteksi: Maks 5 Key / IP / 24 Jam
API KEY BERHASIL DIGENERATE Sisa kuota: 4 lagi hari ini
tm_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Bot OTP 120 req/menit Berlaku s/d -
CONTOH PENGGUNAAN CURL DENGAN KUNCI ANDA:
curl -H "X-API-Key: tm_live_..." "https://tmailku.com/api/emails/[email protected]/latest"
GET /api/random-username Generate random unique username

Generates a random unique username (adj+noun+number) suitable for temporary emails.

RESPONSE
{ "username": "braveatlas042" }
GET /api/domains List verified domains

Returns all verified domains available for creating email addresses.

RESPONSE
{ "success": true, "domains": [ { "domain": "tmailku.com", "status": "verified" } ] }
GET /api/domains/random Random verified domain list

Returns public verified domains for random email generation.

GET /api/domain/verify/:domain Verify domain MX record

Checks DNS MX record for a domain and auto-registers it if verified.

EXAMPLE
GET /api/domain/verify/example.com
RESPONSE
{ "success": true, "domain": "example.com", "verified": true, "mx": "mail.tmailku.com" }
GET /api/public/emails/:address Get inbox emails (public)

Returns all emails received at the specified address. No authentication required.

PARAMS
?limit=50 // Max 100
EXAMPLE
curl "https://tmailku.com/api/public/emails/[email protected]"
GET /api/sse/:address Real-time email notifications (SSE)

Server-Sent Events stream for real-time email notifications. Receives 'new-email' events when a new email arrives.

JAVASCRIPT EXAMPLE
const es = new EventSource('/api/sse/[email protected]'); es.onmessage = (e) => { const data = JSON.parse(e.data); if (data.type === 'new-email') { console.log('New email:', data.email.subject); } };
GET /api/emails/:address Get inbox (authenticated) API KEY

Authenticated version. Requires X-API-Key header.

HEADER
X-API-Key: your-api-key-here
GET /api/emails/:address/latest Get latest email API KEY

Returns only the most recent email for the given address. Useful for bots waiting for verification codes.

PYTHON EXAMPLE
import requests r = requests.get( "https://tmailku.com/api/emails/[email protected]/latest", headers={"X-API-Key": "your-key"} ) email = r.json()["email"] print(email["subject"], email["body_text"])
GET /api/emails/:address/:id Get single email API KEY

Get a specific email by ID, including attachments list. Marks the email as read.

DELETE /api/emails/:address/:id Delete an email API KEY

Permanently deletes an email and its attachments from the server.

CURL EXAMPLE
curl -X DELETE \ -H "X-API-Key: your-key" \ "https://tmailku.com/api/emails/[email protected]/abc123"
GET /api/public/emails/:address Get private domain inbox (with X-Domain-Key) TMAIL-KEY

If your domain is configured as a Private Domain via TXT record, provide the X-Domain-Key header or key parameter to access its inbox.

CURL EXAMPLE
curl -H "X-Domain-Key: your_secret_key" "https://tmailku.com/api/public/emails/[email protected]"
GET /api/sse/:address?key=:tmail_key Real-time SSE stream for private domain TMAIL-KEY

Open a Server-Sent Events stream for a private domain address by appending the key parameter.

JAVASCRIPT EXAMPLE
const es = new EventSource('/api/sse/[email protected]?key=your_secret_key'); es.onmessage = (e) => { const data = JSON.parse(e.data); if (data.type === 'new-email') console.log(data.email); };
GET /api/user-dashboard/sse?key=:tmail_key Multi-domain real-time stream (All domains under key) TMAIL-KEY

Receives instant push notifications for ALL emails sent to any custom domain sharing the same tmail-key.

JAVASCRIPT EXAMPLE
const es = new EventSource('/api/user-dashboard/sse?key=your_secret_key'); es.onmessage = (e) => { const data = JSON.parse(e.data); if (data.type === 'new-email') { console.log('New email on domain:', data.domain, data.email.subject); } };
POST /api/admin/emails/generate Generate email address on private domain SUPER ADMIN

Generates a new email address on any system domain, including domains set to private visibility. Supports custom or random username and domain.

AUTH HEADER
X-Admin-Password: YOUR_ADMIN_PASSWORD // Or: X-Admin-Token / Authorization: Bearer
REQUEST BODY (JSON)
{ "domain": "privatedomain.com", "username": "bot_otp", "prefix": "test" }
RESPONSE
{ "success": true, "address": "[email protected]", "username": "test_bot_otp", "domain": "privatedomain.com", "visibility": "private", "is_private": true }
GET /api/admin/emails/address/:address Read all emails for private domain address SUPER ADMIN

Fetches all incoming emails for the given address (including private domains). You can also use /api/emails/:address with the X-Admin-Password header.

CURL EXAMPLE
curl -H "X-Admin-Password: YOUR_ADMIN_PASSWORD" \ "https://tmailku.com/api/admin/emails/address/[email protected]"
GET /api/admin/emails/address/:address/latest Get latest email (OTP/Verification) for private domain SUPER ADMIN

Returns the single most recent email for a private domain address. Ideal for OTP automation bots.

CURL EXAMPLE
curl -H "X-Admin-Password: YOUR_ADMIN_PASSWORD" \ "https://tmailku.com/api/admin/emails/address/[email protected]/latest"
POST /api/admin/emails/create Create / inject email message into private inbox SUPER ADMIN

Injects or creates an incoming email directly into the target inbox via REST API without requiring SMTP port 25, complete with instant SSE realtime broadcast.

REQUEST EXAMPLE
curl -X POST \ -H "X-Admin-Password: YOUR_ADMIN_PASSWORD" \ -H "Content-Type: application/json" \ -d '{"to":"[email protected]","subject":"Kode OTP Anda 558912","body_text":"Kode verifikasi Anda adalah: 558912"}' \ "https://tmailku.com/api/admin/emails/create"