DEVELOPER & BOT API

Temp Mail REST API

Generate 10-minute disposable @mail.s4z.top addresses and poll incoming emails from your bots, scripts, or automated workflows.

POST/api/bot/mail

Generates a random 10-minute temporary email address (expiresIn: 600 seconds). Supports optional HMAC authentication identical to go.s4z.top.

GET/api/bot/mail?email=xyz@mail.s4z.top

Poll this endpoint every 5–10 seconds from your bot or script to fetch incoming messages. Returns 404 once the 10-minute TTL expires.

Recommended polling interval: 5 seconds
PYTHON POLLING EXAMPLE
import time
import requests

BASE_URL = "https://mail.s4z.top"

# 1. Generate a 10-minute temp mail
res = requests.post(f"{BASE_URL}/api/bot/mail")
data = res.json()
email = data["email"]
print("Generated Temp Mail:", email)

# 2. Poll every 5 seconds for incoming messages
while True:
    poll = requests.get(f"{BASE_URL}/api/bot/mail", params={"email": email}).json()
    if poll.get("messages"):
        latest = poll["messages"][0]
        print("New Email Subject:", latest["subject"])
        print("Body:", latest["text"])
        break
    time.sleep(5)
NODE.JS HMAC AUTH EXAMPLE
import crypto from 'crypto';

const BASE_URL = 'https://mail.s4z.top';
const SECRET = process.env.BOT_API_SECRET || 's4z_default_bot_secret';

// Optional HMAC signature (same pattern as go.s4z.top)
const timestamp = Date.now().toString();
const hmac = crypto.createHmac('sha256', SECRET)
  .update('create_temp_mail' + timestamp)
  .digest('hex');

const createRes = await fetch(`${BASE_URL}/api/bot/mail`, {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ timestamp, hmac })
});
const { email } = await createRes.json();
console.log('Temp Email:', email);