Skip to content

Getting Started

Sign in to TempMailHush and create an API key from your account page.

https://tempmailhush.com/account

Keep the key private. API keys use the sk- prefix.

Terminal window
curl -X POST https://tempmailhush.com/api/v1/mailboxes \
-H "X-API-Key: sk-your_api_key"

The response includes the mailbox ID, generated address, expiration time, and polling hints.

Submit the generated address to the flow you are testing. Keep the mailbox ID because message endpoints use it.

Terminal window
curl https://tempmailhush.com/api/v1/mailboxes/{mailbox_id}/messages \
-H "X-API-Key: sk-your_api_key"

Poll at a reasonable interval and stop when the expected sender, subject, code, or confirmation link appears.

import os
import requests
headers = {"X-API-Key": os.environ["TEMPMAILHUSH_API_KEY"]}
mailbox = requests.post(
"https://tempmailhush.com/api/v1/mailboxes",
headers=headers,
).json()
messages = requests.get(
f"https://tempmailhush.com/api/v1/mailboxes/{mailbox['id']}/messages",
headers=headers,
).json()
print(mailbox["address"], messages)