TempMail API 文档

TempMailg API 文档

使用此文档生成您的个人API密钥,连接专用用户API主机,读取邮箱消息,管理属于自己的邮箱,并将Temp Mail集成到您的应用程序或自动化中。

用户 API 基本 URL
请求格式 只在Authorization Bearer头中使用您的API密钥,并保持端点URL清洁。

用户 API 端点

下面的每个端点都使用相同的基本 URL 和相同的 Bearer 令牌。邮箱、消息和附件请求将与已验证的用户帐户进行检查。

GET https://v1.tempmailg.com/api/domains?type={type}

获取当前用户计划和账户允许的域。

允许的类型值: free, premium, all. 免费计划只能使用 free. 高级计划可以使用 free, premium, 或 all.
获取允许的域
curl --request GET \
  --url 'https://v1.tempmailg.com/api/domains?type=free' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_USER_API_KEY'

示例响应

{
    "status": true,
    "data": {
        "requested_type": "free",
        "allowed_types": [
            "free"
        ],
        "domains": [
            {
                "domain": "example.com",
                "type": "Free",
                "custom": false
            }
        ]
    }
}
POST https://v1.tempmailg.com/api/emails

为已验证的用户创建一个新的随机邮箱。

创建随机邮箱
curl --request POST \
  --url 'https://v1.tempmailg.com/api/emails' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_USER_API_KEY'

示例响应

{
    "status": true,
    "data": {
        "id": 2301,
        "email": "randombox@example.com",
        "domain": "example.com",
        "expire_at": "2026-06-28T09:49:08+00:00",
        "expires_in_seconds": 600,
        "created_at": "2026-06-28T09:39:08+00:00",
        "email_token": "encrypted-email-token"
    }
}
POST https://v1.tempmailg.com/api/emails/{email}/{username}/{domain}

更新或切换现有的属于自己的邮箱到新的用户名和允许的域。

使用属于自己的邮箱邮箱 {email}。
更新属于自己的邮箱
curl --request POST \
  --url 'https://v1.tempmailg.com/api/emails/current@example.com/demo123/example.com' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_USER_API_KEY'

示例响应

{
    "status": true,
    "data": {
        "id": 2302,
        "email": "demo123@example.com",
        "domain": "example.com",
        "expire_at": "2026-06-28T09:49:08+00:00",
        "expires_in_seconds": 600,
        "created_at": "2026-06-28T09:39:08+00:00",
        "email_token": "encrypted-email-token"
    }
}
DELETE https://v1.tempmailg.com/api/emails/{email}

删除已拥有的邮箱。

删除属于自己的邮箱
curl --request DELETE \
  --url 'https://v1.tempmailg.com/api/emails/demo123@example.com' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_USER_API_KEY'

示例响应

{
    "status": true,
    "message": "Email has been successfully deleted."
}
GET https://v1.tempmailg.com/api/messages?email={email}

列出属于自己的邮箱中的消息。

电子邮件查询参数必须属于已验证的用户账户。
读取邮箱消息
curl --request GET \
  --url 'https://v1.tempmailg.com/api/messages?email=demo123@example.com' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_USER_API_KEY'

示例响应

{
    "status": true,
    "mailbox": "randombox@example.com",
    "messages": [
        {
            "is_seen": false,
            "subject": "Welcome to Temp Mail",
            "from": "Example Sender",
            "from_email": "hello@example.org",
            "to": "randombox@example.com",
            "receivedAt": "2026-06-28 09:39:08",
            "id": "ap94AWDg123ELQz07vrVB9dLXlbqZM5NGwYxOJKko8n6m1",
            "html": true,
            "content": "<p>Hello from the inbox.</p>",
            "attachments": [
                {
                    "name": "file.txt",
                    "extension": "txt",
                    "size": 91,
                    "url": "https://v1.tempmailg.com/api/messages/ap94AWDg123ELQz07vrVB9dLXlbqZM5NGwYxOJKko8n6m1/attachments/file.txt"
                }
            ]
        }
    ]
}
GET https://v1.tempmailg.com/api/messages/{messageId}

读取一个属于自己的消息。

读取一条消息
curl --request GET \
  --url 'https://v1.tempmailg.com/api/messages/ap94AWDg123ELQz07vrVB9dLXlbqZM5NGwYxOJKko8n6m1' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_USER_API_KEY'

示例响应

{
    "status": true,
    "data": {
        "is_seen": true,
        "subject": "Welcome to Temp Mail",
        "from": "Example Sender",
        "from_email": "hello@example.org",
        "to": "randombox@example.com",
        "receivedAt": "2026-06-28 09:39:08",
        "id": "ap94AWDg123ELQz07vrVB9dLXlbqZM5NGwYxOJKko8n6m1",
        "html": true,
        "content": "<p>Hello from the inbox.</p>",
        "attachments": [
            {
                "name": "file.txt",
                "extension": "txt",
                "size": 91,
                "url": "https://v1.tempmailg.com/api/messages/ap94AWDg123ELQz07vrVB9dLXlbqZM5NGwYxOJKko8n6m1/attachments/file.txt"
            }
        ]
    }
}
DELETE https://v1.tempmailg.com/api/messages/{messageId}

删除一个属于自己的消息。

删除一条消息
curl --request DELETE \
  --url 'https://v1.tempmailg.com/api/messages/ap94AWDg123ELQz07vrVB9dLXlbqZM5NGwYxOJKko8n6m1' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_USER_API_KEY'

示例响应

{
    "status": true,
    "message": "Message was deleted successfully."
}
GET https://v1.tempmailg.com/api/messages/{messageId}/attachments/{filename}

从属于自己的消息中下载附件。

本端点直接下载文件。
下载附件
curl --request GET \
  --url 'https://v1.tempmailg.com/api/messages/ap94AWDg123ELQz07vrVB9dLXlbqZM5NGwYxOJKko8n6m1/attachments/file.txt' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_USER_API_KEY' \
  --output file.txt
下载行为 此端点直接返回请求的文件,而不是 JSON 正文。
您接受Cookies吗?

我们使用 cookies 来提升您的浏览体验。通过使用本网站,您同意我们的 cookie 政策。

更多
Loading chat...
Connecting to community chat.