Skip to content

v1 API Endpoints

Alexander Epolite edited this page Feb 20, 2024 · 1 revision

API v1 Docs

Starting January 1st 2025, v2 will be the default version.

These docs are for legacy purposes, please upgrade to v2 of the API. Preface all requests to v1 with /v1/ to avoid interruptions.

Discord Server

Feel free to join the Discord Server if you need help with anything API related. Email us if you need assistance with billing, subscriptions, or anything else: [email protected].

Important Info

Inbox Expiration

Inboxes expire after a certain amount of time:

Subscription Inbox Lifespan
free One Hour
TempMail Plus Ten Hours
TempMail Ultra Thirty Hours

Inboxes no longer expire after 10 minutes since last check.

These expiration dates do not apply to custom domain inboxes.

Custom Domain Inbox Size

Custom Domains have an inbox size of 300 emails, or 16 MB, whichever comes first.

Custom Domain Inboxes may be erased after one month of last check to protect user's privacy (and to free up storage).

Authorization

First, you do not need an API key to use the free tier; however, you will need either an API Key or a legacy ID/Token to use TempMail Plus or Ultra.

Using an API Key

Authorization: Bearer tm.1234567890.abcdefghijklmnopqrstuvwxyzanditkeepsgoingon

Make sure to copy the FULL API Key from your dashboard. If you lose it, you will need to make a new one.

Using a legacy BananaCrumbs ID

This authorization uses the form id,token, such as:

Authorization: 123456781234567812345678,ABCDEFGHIJKLMNOPQRSTUVWXYZ

Replace with your own BananaCrumbs ID and token.

No new time can be added to legacy accounts; however, you can merge legacy accounts here after creating a new TempMail Account.

API Types

Email Object

Field Type Description
from string Email address of the sender
to string The address the email was sent to
subject string The email subject
body string The text body of the email
date number Unix timestamp (millis) the email was received
ip string The IP address of the sender (not always accurate)
html ?string The HTML of the email (possibly undefined)

Inbox Object

Field Type Description
address string The email address of this inbox
token string The token used to access this inbox

API Endpoints

GET /generate, /generate/rush, /generate/[domain]

Generate a normal, community, or specific domain. You can use any subdomain on the normal domains, or a random one will be used.

Returns on success (201)

JSON field Type Description
address string The email address you have created
token string The token used to access the inbox

Returns on failure (4xx / 5xx)

JSON field Type Description
error string An error explaining why an email could not be created

GET /auth/[token]

Returns 200

JSON field Type Description
email Email[] Array of Email objects, or null if it is invalid
token ?string "invalid" if the token is invalid, otherwise not present

GET /custom/[password]/[domain]

Custom domains are completely different in v1 than they are v2, if you are going to use the old custom domains, call v1 on the API.

You must have TempMail Plus or higher to use Custom Domains

Configure legacy custom domains here.

The password field is the long token given on the custom domain configuration page. The value added to the _tmpml TXT record is an SHA512 hash of that password.

Retruns:

JSON field Type Description
email Email[] Array of Email objects

v1 will not alert you if the password is invalid. Upgrade to v2 to use that.

GET /webhook/add/[URL]

Adds a webhook to your account, must have TempMail Ultra and sign in to use this. Webhook should start with https:// before the URL.

GET /webhook/remove

Removes the webhook from your account.

GET /addpublic/[domain]

Adds a community domain. Configure community domains here.

GET /stats

Get the stats for TempMail.