API Documentation

Temporary Email Service — Base URL: https://dashboardmail.telego.my.id/api

Authentication

No authentication required. All endpoints are public. CORS is enabled for all origins.

Response Format

All responses follow this envelope:

{
  "success": true|false,
  "data": { ... },       // on success
  "error": "message",    // on failure
  "message": "message"   // optional info
}

Endpoints

GET /health

Check server status.

Response 200
{
  "status": "ok",
  "timestamp": "2026-07-04T14:00:00.000Z"
}
Try it
curl https://dashboardmail.telego.my.id/health
GET /api/email/get

Get a new email address from the pool. Email expires in 24 hours.

Response 200
{
  "success": true,
  "data": {
    "email": "john.smith42@mail.telego.my.id",
    "username": "john_smith42",
    "expires_at": "2026-07-05T14:00:00.000Z"
  }
}
Example
curl https://dashboardmail.telego.my.id/api/email/get

// JavaScript
const res = await fetch('/api/email/get');
const data = await res.json();
console.log(data.data.email);
GET /api/email/:address/inbox

Get all messages received by this email address.

Query params: ?limit=50 (default 50, max 200)
Response 200
{
  "success": true,
  "data": {
    "email": "john.smith42@mail.telego.my.id",
    "total": 3,
    "unread": 1,
    "messages": [
      {
        "id": 15,
        "from_address": "sender@gmail.com",
        "from_name": "John Doe",
        "subject": "Hello!",
        "text_body": "Hi there...",
        "html_body": "<html>...</html>",
        "received_at": "2026-07-04T14:30:00.000Z",
        "is_read": false,
        "has_attachments": false,
        "size_bytes": 1024
      }
    ]
  }
}
Example
curl "https://dashboardmail.telego.my.id/api/email/john.smith%40mail.telego.my.id/inbox?limit=10"

// JavaScript
const addr = 'john.smith@mail.telego.my.id';
const res = await fetch(
  `/api/email/${encodeURIComponent(addr)}/inbox`
);
const { data } = await res.json();
data.messages.forEach(m => console.log(m.subject));
GET /api/email/:address/message/:id

Get full details of a specific message. Auto-marks as read.

Response 200
{
  "success": true,
  "data": {
    "message": {
      "id": 15,
      "from_address": "sender@gmail.com",
      "from_name": "John Doe",
      "subject": "Hello!",
      "text_body": "Full email text here...",
      "html_body": "<html>Full HTML...</html>",
      "headers": { "X-Mailer": "..." },
      "attachments": [
        { "filename": "doc.pdf", "size": 51200 }
      ],
      "received_at": "2026-07-04T14:30:00.000Z",
      "is_read": true,
      "size_bytes": 1024
    }
  }
}
Example
curl "https://dashboardmail.telego.my.id/api/email/john.smith%40mail.telego.my.id/message/15"

// JavaScript
const res = await fetch(
  `/api/email/${encodeURIComponent(email)}/message/15`
);
const msg = (await res.json()).data.message;
console.log(msg.text_body);
DELETE /api/email/:address/message/:id

Delete a specific message permanently.

Response 200
{
  "success": true,
  "message": "Message deleted"
}
Example
curl -X DELETE "https://dashboardmail.telego.my.id/api/email/john.smith%40mail.telego.my.id/message/15"

// JavaScript
await fetch(
  `/api/email/${encodeURIComponent(email)}/message/15`,
  { method: 'DELETE' }
);
GET /api/pool/status

Get current email pool statistics.

Response 200
{
  "success": true,
  "data": {
    "pool": {
      "total_emails": 2000,
      "available_emails": 1987,
      "allocated_emails": 13,
      "expired_emails": 0,
      "total_messages": 42,
      "updated_at": "2026-07-04T14:00:00.000Z"
    },
    "status": "healthy"
  }
}

// status: "healthy" | "low" | "critical"
Example
curl https://dashboardmail.telego.my.id/api/pool/status

// JavaScript
const res = await fetch('/api/pool/status');
const { data } = await res.json();
console.log(`${data.pool.available_emails} available`);

Usage Flow

1
GET /api/email/get → get a temporary email address
2
Share this email address. Anyone can send emails to it via standard SMTP.
3
GET /api/email/:address/inbox → poll for new messages (every 10s recommended)
4
GET /api/email/:address/message/:id → read message body (HTML or text)
5
DELETE /api/email/:address/message/:id → delete message when done

Error Codes

CodeMeaningResponse
404Email or message not found{"success":false,"error":"Not found"}
500Internal server error{"success":false,"error":"Internal server error"}
503No emails available in pool{"success":false,"error":"No available emails..."}

Full Example (JavaScript)

// 1. Get a new email
const { data: { email, expires_at } } = await fetch(
  'https://dashboardmail.telego.my.id/api/email/get'
).then(r => r.json());

console.log(`Your email: ${email}`);
console.log(`Expires: ${expires_at}`);

// 2. Poll inbox every 10 seconds
setInterval(async () => {
  const { data: { messages, total, unread } } = await fetch(
    `https://dashboardmail.telego.my.id/api/email/${encodeURIComponent(email)}/inbox`
  ).then(r => r.json());
  
  if (unread > 0) {
    console.log(`${unread} new message(s)!`);
    messages.filter(m => !m.is_read).forEach(m => {
      console.log(`  ${m.subject} — from ${m.from_address}`);
    });
  }
}, 10000);

// 3. Read a message
const { data: { message } } = await fetch(
  `https://dashboardmail.telego.my.id/api/email/${encodeURIComponent(email)}/message/15`
).then(r => r.json());

// HTML email → message.html_body
// Plain text → message.text_body
console.log(message.text_body || message.html_body);

// 4. Delete a message
await fetch(
  `https://dashboardmail.telego.my.id/api/email/${encodeURIComponent(email)}/message/15`,
  { method: 'DELETE' }
);