시작하기

TempMail 개발자 API에 오신 것을 환영합니다. 우리는 다음과 같은 멋진 기능을 제공합니다...

  • API 키 등록 필요 없음 (무료 등급)
  • Plus 및 Ultra 사용자용 커스텀 도메인
  • 그리고 더 많은 기능! 자세한 내용은 가격 페이지 를 확인하세요.

라이브러리를 사용하지 않는 경우, 모든 POST 요청은 Content-Type 헤더를 application/json으로 설정해야 합니다!

라이브러리 선택

Python

NodeJS

Java

HTTP

$ pip3 install tempmail-lol

API 유형

이메일

받은 편지함을 확인할 때 반환되는 이메일 객체입니다.

이름유형설명
fromstring이메일 발신자
tostring수신자 (임시 이메일)
subjectstring이메일 제목
bodystring일반 텍스트 본문, 비어 있을 수 있음
html?string이메일 HTML (null일 수 있음)
datenumber이메일이 수신된 시점의 Unix 타임스탬프

받은 편지함

이메일 주소와 액세스 토큰을 포함하는 받은 편지함 객체입니다.

이름유형설명
addressstring생성된 이메일 주소
tokenstring받은 편지함을 보기 위해 사용되는 액세스 토큰

받은 편지함 수명

받은 편지함은 구독 등급에 따라 다른 수명을 가집니다.

구독 등급수명
무료 (구독 없음)한 시간
TempMail Plus열 시간
TempMail Ultra삼십 시간

받은 편지함 수명은 생성 받은 편지함 메서드를 다시 요청하여 연장할 수 있습니다 (커스텀 도메인에만 해당).

받은 편지함 생성

받은 편지함 생성 메서드는 GET 또는 POST로 사용할 수 있습니다. POST 메서드는 받은 편지함의 접두사와 도메인을 사용자 정의할 수 있는 옵션을 제공합니다.

GET 메서드는 현재 레거시 이유로만 존재합니다.

POST /v2/inbox/create
from TempMail import TempMail
tmp = TempMail("optional-api-key")

inb = tmp.createInbox()

# Or... use a prefix
inb = tmp.createInbox(prefix = "joe")

# You can use a setup custom domain here
inb = tmp.createInbox(domain = "mycustomdomain.com", prefix = "optional")

본문

매개변수유형설명기본값
domain?string받은 편지함의 도메인, 또는 랜덤. 커스텀 도메인일 수 있음.null
prefix?string받은 편지함의 접두사, 또는 랜덤.null

응답 (201)

이름유형설명
addressstring받은 편지함의 이메일 주소.
tokenstring받은 편지함의 토큰.

이메일 가져오기

이메일이 생성될 때 받은 토큰을 사용하여 이메일을 가져옵니다. 토큰을 잃어버린 경우, 더 이상 이메일에 접근할 수 없습니다. 커스텀 도메인이 아닌 경우, 법적 이유로 이메일 주소를 제공할 수 없으므로 지원팀에 연락하지 마세요.

GET /v2/inbox
from TempMail import TempMail
tmp = TempMail("optional-api-key")

inb = tmp.createInbox()

emails = tmp.getEmails(inb.token)

print("Emails:")

for email in emails:
    print("\tSender: " + email.sender)
    print("\tRecipient: " + email.recipient)
    print("\tSubject: " + email.subject)
    print("\tBody: " + email.body)
    print("\tHTML: " + str(email.html)) # may be None
    print("\tDate: " + str(email.date)) # Unix timestamp in milliseconds

쿼리

매개변수유형설명기본값
tokenstring받은 편지함에 접근하기 위해 사용되는 토큰null

응답 (200)

이름유형설명
emailsEmail[]서버에서 받은 이메일 배열
expiredboolean받은 편지함이 만료된 경우 (받은 편지함 수명 참조)

커스텀 도메인 준비

TempMail에서 커스텀 도메인을 사용하기 전에 몇 가지 레코드를 설정해야 합니다. 계정 페이지에서 수행하는 것이 좋지만, API를 통해서도 수행할 수 있습니다.

커스텀 도메인을 사용하려면 TempMail Plus 또는 Ultra 구독이 필요합니다.

POST /v2/custom

본문

매개변수유형설명기본값
domainstringTempMail에 등록할 도메인null

Response (200)

이름유형설명
uuidstring도메인 레코드에 설정할 UUID (아래 참조)

[uuid].yourdomain.com 아래에 이 레코드를 추가하고 값을 tm-custom-domain-verification.으로 설정하세요.

서브 도메인을 사용하는 경우, [uuid].subdomain.yourdomain.com.으로 설정하세요.

응답 (4xx)

이름유형설명
errorstring도메인을 설정할 수 없는 이유를 설명하는 오류

커스텀 도메인 주소 생성

일반 받은 편지함을 생성하는 것과 동일한 방법으로 커스텀 도메인 받은 편지함을 생성하세요, 하지만 귀하의 도메인으로!

참고 사항:

  • 도메인에 대한 UUID를 생성한 동일한 계정을 사용해야 합니다
  • prefix 매개변수는 선행 번호가 없는 일반 접두사를 설정합니다
POST /v2/inbox/create
from TempMail import TempMail
tmp = TempMail("API Key required for custom domains")

inb = tmp.createInbox()

inb = tmp.createInbox(domain = "mycustomdomain.com", prefix = "optional")

본문

매개변수유형설명기본값
domainstring귀하의 커스텀 도메인.null
prefix?string받은 편지함의 이메일 주소 (앞부분), 또는 랜덤.null

응답 (201)

이름유형설명
addressstring받은 편지함의 이메일 주소.
tokenstring받은 편지함의 토큰.

받은 편지함의 토큰을 잃어버린 경우, 동일한 접두사를 사용하여 메서드를 다시 호출하세요. 받은 편지함 수명이 구독에 따라 연장됩니다. 무한히 연장할 수 있습니다.

이메일 가져오기 메서드를 사용하여 받은 편지함을 확인하세요.

개인 웹훅

개인 웹훅을 설정하여 도메인의 모든 이메일이 웹훅으로 전달되도록 합니다.

활성화된 TempMail Ultra 구독이 필요합니다.

커스텀 도메인을 위해 이미 설정된 도메인 ([uuid].domain.com)이어야 합니다.

POST /v2/private_webhook

Body

매개변수유형설명기본값
domainstring웹훅을 설정할 도메인null
urlstring이메일이 전달될 웹훅 URLnull

응답 (200)

이름유형설명
successtrue항상 true
messagestring성공 정보 메시지

응답 (4xx)

이름유형설명
errorstring오류에 대한 세부 정보를 포함한 메시지

도메인을 쿼리 매개변수로 하여 DELETE /private_webhook을 사용하여 제거할 수도 있습니다.

표준 웹훅

생성한 모든 표준 이메일에 표준 웹훅을 설정합니다. 이메일이 웹훅으로 전달됩니다.

활성화된 TempMail Ultra 구독이 필요합니다.

기존 이메일에는 소급 적용되지 않습니다.

POST /v2/webhook

본문

매개변수유형설명기본값
urlstring이메일이 전달될 웹훅 URLnull

응답 (200)

이름유형설명
successtrue항상 true

응답 (4xx)

이름유형설명
errorstring오류에 대한 세부 정보를 포함한 메시지

계정에서 제거하려면 DELETE /webhook을 사용하여 제거할 수도 있습니다.

API v3 Overview NEW

API v3 is the new, consistent TempMail API. It adds account-level inbox management, a wait-for-email long poll, raw .eml downloads, per-inbox webhooks with automatic retries and delivery logs, custom domain management, a list of TempMail's own domains, scoped API keys, and a usage endpoint.

What changed from v2:

  • Fetches consume exactly what they return. Emails you receive in a response are deleted; emails excluded by your filters (since, from, limit) stay in the inbox. v2 wipes the whole inbox on every read.
  • Errors are consistent. Every error is { "error": { "code", "message" } } with a matching HTTP status-never a 200.
  • Rate limits are visible. Responses carry x-ratelimit-limit, x-ratelimit-remaining and x-ratelimit-reset headers (reset is a unix timestamp in seconds). 429 responses include retry-after.
  • v2 stays supported. Inboxes are shared between versions; v3 has its own create and fetch endpoints, but tokens work on both.
Base URL & authentication
Base URL:  https://api.tempmail.lol/v3

# account endpoints accept either key type:
Authorization: Bearer tempmail.20260101.abcdef...   # primary key
Authorization: Bearer tempmail.sk.abcdef...          # scoped key

# error envelope (here: HTTP 403)
{
  "error": {
    "code": "insufficient_scope",
    "message": "This API key does not have the required scope: domains:read",
    "required_scope": "domains:read"
  }
}

Scoped API Keys

Create additional API keys that can only do specific things, so your CI pipeline or a third-party integration never holds your full account credential. The key secret is returned once on creation and only a hash is stored.

Keys are managed with your primary API key (or the website), a scoped key can never manage keys.

Scopes

ScopeGrants
inboxes:createCreate inboxes (works on v1/v2 create endpoints too)
inboxes:readList your inboxes
webhooks:readRead webhook config and delivery logs
webhooks:writeSet/remove per-inbox webhooks
domains:readList/inspect custom domains
domains:writeRegister/verify/remove custom domains
usage:readRead usage & quota
GET/v3/keyslist keys
POST/v3/keyscreate a key
PATCH/v3/keys/:idrename / re-scope / revoke
DELETE/v3/keys/:iddelete a key
POST /v3/keys
curl -X POST https://api.tempmail.lol/v3/keys \
  -H "Authorization: Bearer $PRIMARY_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "ci key", "scopes": ["inboxes:create", "inboxes:read"]}'

# 201 -> { "key": "tempmail.sk....", "id": "...", "scopes": [...], ... }
#        the "key" field is shown ONCE. store it now

Create & Manage Inboxes

Create inboxes anonymously (free tier, per-IP limits) or with an API key (per-account limits, longer lifespans, account ownership). Inboxes created with a key belong to your account and can be listed with the inboxes:read scope; per-inbox endpoints are authorized by the inbox token itself.

POST /v3/inboxes - body (all optional)

ParameterTypeDescriptionDefault
prefix?stringLocal part prefix (a-z, 0-9, _, -)random
domain?stringA TempMail domain (see TempMail Domains), or a custom domain verified to your account. Plus/Ultra accounts draw random domains from their own premium pool.random
community?booleanPrefer a community domainfalse

GET /v3/inboxes - query

ParameterTypeDescriptionDefault
limit?numberPage size (max 200)50
cursor?stringnext_cursor from the previous pagenull
include_expired?booleanAlso return expired inboxesfalse
POST/v3/inboxescreate an inbox
GET/v3/inboxeslist your inboxes
GET/v3/inboxes/:tokenmetadata + email count
DELETE/v3/inboxes/:tokendelete inbox + its emails
POST /v3/inboxes
curl -X POST https://api.tempmail.lol/v3/inboxes \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"prefix": "ci-run-42"}'

# 201
{
  "address": "[email protected]",
  "token": "...",
  "created_at": "2026-07-16T00:22:22.000Z",
  "expires_at": 1784269342568,
  "expired": false,
  "webhook_configured": false
}

Fetch Emails & Raw .eml

Fetching emails consumes what it returns: emails in the response are deleted, while emails excluded by since or limit stay in the inbox (v2 deletes everything on read).

Raw RFC822 source is a TempMail Ultra feature. For Ultra-owned inboxes each fetched email includes a raw field with the exact MIME source received over SMTP (null if it was not captured). The standalone /raw endpoint downloads a .eml for an email that has NOT been consumed yet - useful with the email_id from webhook delivery logs. If the verbatim source is unavailable, a reconstructed .eml is served (marked with x-tempmail-reconstructed: true).

GET /v3/inboxes/:token/emails - query

ParameterTypeDescriptionDefault
since?numberOnly emails with date >= this unix ms timestamp0
limit?numberMax emails returned (max 200)100
GET/v3/inboxes/:token/emailsfetch + consume
DELETE/v3/inboxes/:token/emails/:iddelete without reading
GET/v3/inboxes/:token/emails/:id/rawdownload .eml (Ultra)
GET /v3/inboxes/:token/emails/:id/raw
curl -OJ https://api.tempmail.lol/v3/inboxes/$TOKEN/emails/$ID/raw

# -> Content-Type: message/rfc822
#    Content-Disposition: attachment; filename="<id>.eml"
#    x-tempmail-reconstructed: false

# without Ultra -> 403
# { "error": { "code": "tier_required", "required_tier": "ultra", ... } }

Wait for Email (long poll)

Blocks until an email matching your filters arrives, or the timeout passes - one request instead of a polling loop. Perfect for signup flows and CI: request the OTP, then wait for it.

Matched emails are returned and consumed; emails that do not match the from/since filters stay in the inbox untouched.

Query

ParameterTypeDescriptionDefault
timeout?numberSeconds to wait (max 60)30
from?stringSender filter, wildcards allowed (*@example.com)null
since?numberIgnore emails older than this unix ms timestamp0

At most 2 concurrent /wait requests per inbox. A timeout is still HTTP 200, with "timed_out": true and an empty emails array.

GET /v3/inboxes/:token/wait
curl "https://api.tempmail.lol/v3/inboxes/$TOKEN/wait?\
from=*@example.com&timeout=30"

# matched emails are consumed on return
{
  "emails": [{
    "id": "6a58244f...",
    "from": "[email protected]",
    "subject": "Your verification code is 482913",
    "body": "Code: 482913",
    "raw": "From: [email protected]\r\n...",  // Ultra only
    ...
  }],
  "timed_out": false,
  "waited_ms": 2311
}

Per-Inbox Webhooks & Delivery Logs

Attach a webhook to a single inbox (TempMail Ultra): new mail to that inbox is POSTed to your URL. Failed deliveries are retried automatically with backoff - 30s, 5m, 30m, 2h after the initial attempt (5 attempts total).

Every delivery and each attempt (status code, error, duration) is logged for 7 days and queryable - this covers account-wide (v2) webhooks, private domain webhooks, and per-inbox webhooks alike.

GET /v3/webhooks/deliveries - query

ParameterTypeDescription
status?stringpending | success | failed
address / domain?stringFilter by recipient inbox or domain
limit / cursor?number / ?stringPagination (max 200)
PUT/v3/inboxes/:token/webhookset webhook (Ultra)
GET/v3/inboxes/:token/webhookread webhook
DELETE/v3/inboxes/:token/webhookremove webhook
GET/v3/webhooks/deliveriesdelivery log
GET /v3/webhooks/deliveries
{
  "deliveries": [{
    "url": "https://example.com/hook",
    "event": "email.received",
    "address": "[email protected]",
    "status": "success",
    "attempt_count": 2,
    "attempts": [
      { "at": "...", "status_code": 500, "error": "HTTP 500", "duration_ms": 12 },
      { "at": "...", "status_code": 200, "error": null, "duration_ms": 45 }
    ],
    "created_at": "..."
  }],
  "next_cursor": null
}

Custom Domains

Register a custom domain to your account, get the exact DNS records to create, and re-run verification whenever you like - with structured per-record results instead of a single pass/fail. Requires TempMail Plus or Ultra.

DNS records returned by the API

TypeNameValue
TXT<hash>.yourdomain.comtm-custom-domain-verification
Amx.yourdomain.com(returned by the API)
MXyourdomain.commx.yourdomain.com (priority 10, must be the only MX)

The exact TXT name/value pair is account-specific - always read it from the API response.

POST /v3/domains/verify re-checks up to 100 of your domains in one call, least recently checked first, and returns the same per-domain results. It can run once every 10 minutes per account; calling it sooner returns 429 rate_limited with a retry-after header.

GET/v3/domainslist your domains
POST/v3/domainsregister + verify
GET/v3/domains/:domaindetails + DNS records
POST/v3/domains/:domain/verifyre-run verification
POST/v3/domains/verifyre-verify all (once per 10 min)
DELETE/v3/domains/:domainunregister
POST /v3/domains/:domain/verify
{
  "domain": { "domain": "yourdomain.com", "verified": true, ... },
  "checks": {
    "txt": { "pass": true,  "detail": "Ownership TXT record found." },
    "mx":  { "pass": false, "records": [...],
             "expected": "mx.yourdomain.com",
             "detail": "Expected a single MX record..." }
  },
  "dns": { "ownership_txt_options": [...], "mail_records": [...] }
}

TempMail Domains

List every domain TempMail itself serves, split into the premium pool that only Plus/Ultra accounts can create inboxes on and the free pool that any tier can use. Pass any of them as domain when creating an inbox. Requires TempMail Plus or Ultra and the domains:read scope; free accounts get a tier_required error.

Response fields

FieldTypeDescription
domains_premiumstring[]The premium pool. Random Plus/Ultra inboxes are drawn from here.
domains_freestring[]The free pool, including community domains. Usable by every tier.

An entry starting with *. is a wildcard: both the bare domain and any subdomain of it are accepted, so *.example.com lets you create [email protected] or [email protected]. The lists change over time as domains are rotated in and out, so re-fetch them rather than caching them for long.

GET/v3/domains/poollist TempMail domains (Plus/Ultra)
GET /v3/domains/pool
curl https://api.tempmail.lol/v3/domains/pool \
  -H "Authorization: Bearer tempmail.sk...."

{
  "domains_premium": [
    "*.plusonly.example",
    "premium.example"
  ],
  "domains_free": [
    "*.free.example",
    "community.example"
  ]
}

Usage & Quota

See your tier, how much of the inbox-creation window you have used, and counts of your active inboxes, keys, and domains. Requires the usage:read scope.

GET /v3/usage
{
  "tier": "ultra",
  "inbox_creation": {
    "window_seconds": 300,
    "limit": 5000,
    "used": 2,
    "remaining": 4998,
    "resets_at": 1784161500000,
    "limited_by": "account"
  },
  "inboxes_active": 2,
  "api_keys_active": 1,
  "custom_domains": 0,
  "webhook_deliveries_last_7d": 14
}

API 지원

API 도움이 필요하신가요? 저희 Discord 서버에 가입하세요! 문제가 있거나 API 사용 방법에 대해 궁금한 점이 있으면 언제든지 도와드리겠습니다.