مرجع API توسعه‌دهندگان

نمای کلی API و احراز هویت

به API توسعه‌دهندگان tempmailto.com خوش آمدید؛ ساخت خودکار ایمیل موقت و دریافت پیام‌ها برای تست QA.

نشانی پایه
https://tempmailto.com/api
احراز هویت

کلید API خود را در هدر Authorization (پیشنهادی: Authorization: Bearer YOUR_API_KEY) یا X-API-Key ارسال کنید تا در URL و لاگ‌ها ثبت نشود. روش قدیمی مسیر نیز برای سازگاری پشتیبانی می‌شود.

پارامتر احراز هویت نوع محل مثال
Authorization / X-API-Key string هدر HTTP (پیشنهادی) Bearer YOUR_API_KEY
apiKey string بخش مسیر URL (قدیمی) YOUR_API_KEY
GET دامنه‌های فعال

Fetch list of all allowed domain names configured on the platform that can be used to generate temporary mailboxes.

GET https://tempmailto.com/api/domains/{apiKey}/{type}
پارامترهای مسیر
پارامتر نوع وضعیت توضیحات
apiKey string الزامی Your secret API authorization key.
type string الزامی Domain filter type. Accepted values: all, free, premium.
curl -X GET "https://tempmailto.com/api/domains/all" -H "Authorization: Bearer YOUR_API_KEY"
نمونه پاسخ
{
  "status": true,
  "data": {
    "domains": [
      {
        "domain": "tempmailto.com",
        "type": "Free"
      }
    ]
  }
}
POST ایجاد ایمیل جدید

Instantly generate and register a new random temporary email address address.

POST https://tempmailto.com/api/emails/{apiKey}
پارامترهای مسیر
پارامتر نوع وضعیت توضیحات
apiKey string الزامی Your secret API authorization key.
curl -X POST "https://tempmailto.com/api/emails" -H "Authorization: Bearer YOUR_API_KEY"
نمونه پاسخ
{
  "status": true,
  "data": {
    "id": 142,
    "email": "[email protected]",
    "domain": "tempmailto.com",
    "ip": "127.0.0.1",
    "fingerprint": "f38b25...",
    "expire_at": "2026-06-20 13:45:00",
    "created_at": "2026-06-20 13:35:00",
    "email_token": "eyJpdiI..."
  }
}
POST سفارشی‌سازی نشانی ایمیل

Transition an existing email to a customized address with a specific username and active domain.

POST https://tempmailto.com/api/emails/{apiKey}/{email}/{username}/{domain}
پارامترهای مسیر
پارامتر نوع وضعیت توضیحات
apiKey string الزامی Your secret API authorization key.
email string الزامی The current temporary email address you want to change.
username string الزامی The customized alias/username prefix for the new address.
domain string الزامی One of the active domain names fetched from the active domains endpoint.
curl -X POST "https://tempmailto.com/api/emails/[email protected]/john_doe/tempmailto.com" -H "Authorization: Bearer YOUR_API_KEY"
نمونه پاسخ
{
  "status": true,
  "data": {
    "id": 143,
    "email": "[email protected]",
    "domain": "tempmailto.com",
    "ip": "127.0.0.1",
    "fingerprint": "f38b25...",
    "expire_at": "2026-06-20 13:45:00",
    "created_at": "2026-06-20 13:35:00"
  }
}
POST حذف ایمیل موقت

Instantly release and expire a temporary email address to delete all cached inbox data.

POST https://tempmailto.com/api/emails/{apiKey}/{email}
پارامترهای مسیر
پارامتر نوع وضعیت توضیحات
apiKey string الزامی Your secret API authorization key.
email string الزامی The active temporary email address to be removed.
curl -X POST "https://tempmailto.com/api/emails/[email protected]" -H "Authorization: Bearer YOUR_API_KEY"
نمونه پاسخ
{
  "status": true,
  "message": "Email has been successfully deleted."
}
GET پیام‌های صندوق ورودی

Retrieve all message metadata and message summaries received inside the inbox of the specified temporary address.

GET https://tempmailto.com/api/messages/{apiKey}/{email}
پارامترهای مسیر
پارامتر نوع وضعیت توضیحات
apiKey string الزامی Your secret API authorization key.
email string الزامی The temporary email address to fetch the messages for.
curl -X GET "https://tempmailto.com/api/messages/[email protected]" -H "Authorization: Bearer YOUR_API_KEY"
نمونه پاسخ
{
  "status": true,
  "data": [
    {
      "id": "M2ZkMXQ1",
      "subject": "Verify your Account",
      "from": "Service Provider",
      "from_email": "[email protected]",
      "receivedAt": "2026-06-20 13:40:00",
      "is_seen": false,
      "html": true
    }
  ]
}
GET جزئیات پیام

Retrieve the full HTML/plain text body content, sender fields, headers, and attachments list of a specific message ID.

GET https://tempmailto.com/api/messages/{apiKey}/message/{messageId}
پارامترهای مسیر
پارامتر نوع وضعیت توضیحات
apiKey string الزامی Your secret API authorization key.
messageId string الزامی The unique identifier key of the message.
curl -X GET "https://tempmailto.com/api/messages/message/M2ZkMXQ1" -H "Authorization: Bearer YOUR_API_KEY"
نمونه پاسخ
{
  "status": true,
  "data": {
    "id": "M2ZkMXQ1",
    "subject": "Verify your Account",
    "from": "Service Provider",
    "from_email": "[email protected]",
    "to": "[email protected]",
    "receivedAt": "2026-06-20 13:40:00",
    "is_seen": true,
    "html": true,
    "content": "<p>Hi John, your verification code is <b>857102</b></p>",
    "attachments": []
  }
}
POST حذف پیام

Permanently purge and delete a specific message from the temp inbox storage.

POST https://tempmailto.com/api/messages/{apiKey}/message/{messageId}
پارامترهای مسیر
پارامتر نوع وضعیت توضیحات
apiKey string الزامی Your secret API authorization key.
messageId string الزامی The unique identifier key of the message to be deleted.
curl -X POST "https://tempmailto.com/api/messages/message/M2ZkMXQ1" -H "Authorization: Bearer YOUR_API_KEY"
نمونه پاسخ
{
  "status": true,
  "message": "Message has been successfully deleted."
}