Mail1s.net – Dịch Vụ Temp-Mail Bảo Vệ Quyền Riêng Tư
REST API

Mail1s.net APIScripts & automation

REST API to create temp addresses, read mail and manage inboxes from your script / server.

REST APIBearer TokenJSON responsesCORS *

Authentication

Every request must include one of these headers:

Authorization:

Bearer <api_key>

— OAuth standard, preferred.

X-API-Key:

<api_key>

— handy for tools that don't accept Bearer.

You don't have an API key yet. Create one on Profile — takes one click.

Every endpoint returns JSON. Errors look like { "error": "..." } with the appropriate HTTP status (401 wrong key, 403 forbidden, 404 not found, 429 over quota, 400 bad input).

CORS is * — so you can call directly from the browser if you want.

Node.js example (fetch)

Node.js / Browser
const API_KEY = '<API_KEY>';
const BASE    = 'https://your-host';

async function api(path, init = {}) {
  const r = await fetch(BASE + path, {
    ...init,
    headers: {
      Authorization: `Bearer ${API_KEY}`,
      'Content-Type': 'application/json',
      ...(init.headers ?? {}),
    },
  });
  if (!r.ok) throw new Error((await r.json()).error ?? r.statusText);
  return r.json();
}

// // 1. Create an address
const addr = await api('/api/v1/addresses', {
  method: 'POST',
  body: JSON.stringify({ domain: 'mail1s.net' }),
});
// console.log('Created:', addr.address);

// // 2. Wait a few seconds for mail to arrive…
await new Promise((r) => setTimeout(r, 5000));

// // 3. List inbox
const inbox = await api(`/api/v1/addresses/${encodeURIComponent(addr.address)}/messages`);
// console.log('Mail count:', inbox.count);

// // 4. Read the latest message
if (inbox.messages[0]) {
  const msg = await api(
    `/api/v1/addresses/${encodeURIComponent(addr.address)}/messages/${inbox.messages[0].id}`,
  );
  console.log('From:', msg.from, '— Subject:', msg.subject);
}

// // 5. Delete the address and clean up the inbox
await api(`/api/v1/addresses/${encodeURIComponent(addr.address)}`, { method: 'DELETE' });

Quotas (mails per day, saved addresses) follow your paid plan at /upgrade.

Quảng cáo

Quảng cáo