Integrate temporary mail into your automated projects.
All API requests should be made to:
http://temply.fun/
Pass your API key in the request headers:
x-api-key: YOUR_API_KEY
Keep your key secret. Contact the admin to obtain one.
/api/v1/generate
Optional Query Params:
user: Specific username (alphanumeric, dots, dashes)subdomain: Specific subdomain (alphanumeric, dashes)domain: Custom domainPython Example:
import requests
url = "http://temply.fun/api/v1/generate"
headers = {"x-api-key": "YOUR_API_KEY"}
params = {
"user": "customname",
"subdomain": "test",
"domain": "temply.fun"
}
response = requests.get(url, headers=headers, params=params)
print(response.json()['email'])
# Result: customname@test.temply.fun
Response:
{
"success": true,
"email": "customname@test.temply.fun"
}
/api/v1/messages
Required Query Params:
email: The full email address to checkPython Example:
import requests
url = "http://temply.fun/api/v1/messages"
headers = {"x-api-key": "YOUR_API_KEY"}
params = {"email": "customname@test.temply.fun"}
response = requests.get(url, headers=headers, params=params)
messages = response.json().get('messages', [])
for msg in messages:
print(f"From: {msg['sender_email']} | Subject: {msg['subject']}")
Response:
{
"success": true,
"messages": [
{
"id": 42,
"sender_email": "noreply@example.com",
"recipient_email": "customname@test.temply.fun",
"subject": "Welcome!",
"body": "Hello there...",
"created_at": "2025-01-01T12:00:00.000Z"
}
]
}
/api/v1/wait
Blocks until a new message arrives in the inbox, then returns it. Max wait time is 120 seconds. Useful for automation flows that need to catch a verification email.
Required Query Params:
email: The email address to wait onOptional Query Params:
timeout: Seconds to wait (default: 60, max: 120)Python Example:
import requests
url = "http://temply.fun/api/v1/wait"
headers = {"x-api-key": "YOUR_API_KEY"}
params = {
"email": "customname@test.temply.fun",
"timeout": 90 # wait up to 90 seconds
}
response = requests.get(url, headers=headers, params=params)
if response.status_code == 200:
msg = response.json()['message']
print(f"Got email: {msg['subject']}")
elif response.status_code == 408:
print("Timed out, no email received")
Success Response:
{
"success": true,
"message": {
"id": 42,
"sender_email": "verify@example.com",
"recipient_email": "customname@test.temply.fun",
"subject": "Your verification code",
"body": "Your code is 123456",
"created_at": "2025-01-01T12:00:00.000Z"
}
}
Timeout Response (408):
{ "error": "Timeout: no message received within the specified wait time" }
/api/v1/inbox
Deletes all messages for a given email address. The inbox address itself remains registered.
Required Query Params:
email: The full email address to clearPython Example:
import requests
url = "http://temply.fun/api/v1/inbox"
headers = {"x-api-key": "YOUR_API_KEY"}
params = {"email": "customname@test.temply.fun"}
response = requests.delete(url, headers=headers, params=params)
print(response.json()) # {"success": true}
/api/v1/domains
Returns all active domains and whether they require a subdomain. If force_subdomain is true, you must include a subdomain when generating an address on that domain.
Python Example:
import requests
url = "http://temply.fun/api/v1/domains"
headers = {"x-api-key": "YOUR_API_KEY"}
response = requests.get(url, headers=headers)
for domain in response.json()['domains']:
subdomain_note = " (subdomain required)" if domain['force_subdomain'] else ""
allowed = domain.get('allowed_subdomains')
if allowed:
subdomain_note += f" — allowed: {allowed}"
print(f"{domain['domain']}{subdomain_note}")
Response:
{
"success": true,
"domains": [
{
"domain": "temply.fun",
"force_subdomain": false,
"allowed_subdomains": null
},
{
"domain": "example.com",
"force_subdomain": true,
"allowed_subdomains": "support,noreply"
}
]
}
When allowed_subdomains is not null, it is a comma-separated list of the only subdomains accepted on that domain.