API v2Free with an account

Temp Mail API: temporary inboxes for your code

One request creates a temporary email address. The next ones read its mail as JSON. Made for sign-up tests, checks of transactional email and apps that need a throwaway inbox.

The TempMailo app for Android reads mail through the same methods.

# 1. Create an address
curl -X POST \
  https://tempmailo.co/api/v2/create/ \
  -H "X-Api-Key: YOUR_API_KEY" \
  -d lifetime=3600

# 2. Read its mail with the token from step 1
curl https://tempmailo.co/api/v2/messages/ \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Authorization: Bearer MAILBOX_TOKEN"

The API at a glance

Price
Free
Access
API key from a free account
Format
JSON over HTTPS
New addresses
100 per day
Address lifetime
10 or 60 minutes
Mail
Receive only, up to 15 MB

Terms checked on . Every limit is in the table Free limits.

What it is for

Sign-up tests

Create an address, register a test user in your app, read the confirmation code and finish the flow. Each run gets a clean inbox.

Checks of your own email

Confirm that a welcome or reset email arrives. Read its HTML and plain text, the raw source and the attachments.

An inbox inside your product

Give users a throwaway address in an app or a bot. The TempMailo app for Android is built this way.

When the API is the wrong tool

  • You need to send email. TempMailo addresses only receive. Use a transactional email service for sending.
  • You need a mailbox for longer than 60 minutes. The address and its mail are deleted when the timer ends. Use a regular mailbox for anything you keep.
  • The mail is confidential. Messages are stored as received until the address expires. Do not route private data through a temporary inbox.

Quick start

Three steps to the first email.

  1. Get an API key. Create a free account, confirm its email and create a key on the API page of your account.

    Create a free account
  2. Create an address. Send your key in the X-Api-Key header. The reply holds the address and a token for its mailbox.

    Request
    curl -X POST \
      https://tempmailo.co/api/v2/create/ \
      -H "X-Api-Key: YOUR_API_KEY" \
      -d lifetime=3600
    Response
    {
      "ok": true,
      "time": 1795801080,
      "token": "3f1c9a7e5b2d4c6e8a0b1d3f5a7c9e1b",
      "mailbox": {
        "email": "ed9qfemu@example.org",
        "login": "ed9qfemu",
        "domain": "example.org",
        "created": 1795801080,
        "expired": 1795804680,
        "lifetime": 3600
      },
      "quota": {
        "create_day": {
          "used": 1,
          "limit": 100,
          "reset": 1795824000
        },
        "create_hour": {
          "used": 1,
          "limit": 30,
          "reset": 1795802400
        }
      }
    }
  3. Read the mail. Ask for messages with the mailbox token. Poll every 5 seconds or slower, and pass after with the last message id to get only new mail.

    Request
    curl https://tempmailo.co/api/v2/messages/ \
      -H "X-Api-Key: YOUR_API_KEY" \
      -H "Authorization: Bearer MAILBOX_TOKEN"
    Response
    {
      "ok": true,
      "time": 1795801102,
      "mailbox": {
        "email": "ed9qfemu@example.org",
        "login": "ed9qfemu",
        "domain": "example.org",
        "created": 1795801080,
        "expired": 1795804680,
        "lifetime": 3600
      },
      "messages": [
        {
          "id": 3,
          "from": "noreply@app.example",
          "from_name": "Example App",
          "subject": "Your code is 418 507",
          "preview": "Enter this code to sign in.",
          "date": 1795801102,
          "unread": true,
          "attachments": 0
        }
      ]
    }

    The message method returns one email in full: text, HTML, recipients and attachments.

Free limits

What a free key can do.

TempMailo API limits for a free account
LimitValueAt the limit
New addresses100 per day and 30 per hour, per accountReply 429 rate_limited. The hour count starts again on the hour, the day count at 00:00 UTC. A new key does not reset them.
Requests60 per minute, per accountReply 429 rate_limited. The Retry-After header gives the seconds to wait.
API keysOne per accountA new key switches the old one off.
Address lifetime10 or 60 minutes, your choiceAfter that the mailbox methods reply 410 expired.
Messages per requestUp to 100, newest firstPass after to get only newer mail.
Email sizeUp to 15 MB with attachmentsLarger emails do not arrive.
Sending mailNot availableThe address only receives.
PriceFreeHigher limits will be a paid option. See Need higher limits?

Limits checked on . When a limit changes, this table changes first.

Every reply to a request with a key carries the headers X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset for the count of requests per minute. The usage method shows all your counters.

Fair use

  • One key per account. Keep it private and out of public code.
  • No spam, fraud or bulk sign-ups on other sites. Such keys are blocked.
  • A key that keeps going over the limits can be paused.
  • One account per person or team. Accounts opened to get around the limits are closed.

The full rules are in the Terms of use.

Methods

Version 2.

The base address is https://tempmailo.co/api/v2/<method>/. Send parameters in the query string, as a form or as JSON. Every reply except an attachment file is JSON with ok and the server time. The API sends no CORS headers, so call it from a server, a test or an app, not from a web page.

API key

Identifies your account. Send it in the X-Api-Key header with every request. You can replace it in your account at any time, and the old key stops working at once.

Mailbox token

Comes back from create and opens one mailbox. Send it in the header Authorization: Bearer next to a key of the same account. It opens the mailbox until the address expires or is deleted.

Methods of the TempMailo API v2
MethodHTTPNeedsWhat it does
domainsGETAPI keyLists the domains you can use, the allowed lifetimes and the rules for your own login.
createPOSTAPI keyCreates an address. Returns the mailbox token and the mailbox.
statusGETKey and tokenShows the address, whether it is active, and the total and unread counts. Works after the address expires.
messagesGETKey and tokenLists messages, newest first, up to 100.
messageGETKey and tokenReturns one message in full by id and marks it as read.
sourceGETKey and tokenReturns the raw source of a message by id.
attachmentGETKey and tokenReturns the attachment file by message id and index.
deletePOSTKey and tokenDeletes the address, its mail and the token.
usageGETAPI keyShows your plan, your limits and how much of each is used.
Parameters of the create method. All are optional
ParameterValueDefault
lifetime600 or 3600 seconds3600
domainOne of the names returned by domainsRandom
loginYour own name: 5 to 32 characters from a-z 0-9 . _ -, with a letter or digit at both endsRandom, 8 characters
clientName and version of your app, for example signup-tests 1.0Empty

You only get mail that arrived after you created the address. If someone used the same name before, their old messages stay hidden from you.

Errors

A failed request returns an HTTP status and a short code in error.

HTTP/1.1 429 Too Many Requests
Retry-After: 37

{
  "ok": false,
  "time": 1795801103,
  "error": "rate_limited",
  "limit": {
    "scope": "requests_minute",
    "limit": 60,
    "reset": 1795801140
  }
}
Error codes of the TempMailo API
CodeHTTPWhat happened and what to do
auth_required401The request has no API key. Send it in the X-Api-Key header.
bad_key401The API key has the wrong form, is unknown or was replaced by a newer one. Use your current key, or create a new one in your account.
key_blocked403The account that owns the key is blocked or deleted. Write to us if you think this is a mistake.
bad_token401The mailbox token is missing or unknown, the address was deleted, or it was created by another account. Create a new address.
expired410The address lifetime is over. Create a new address.
rate_limited429Too many new addresses or requests. The limit field names the limit. Wait for the seconds in the Retry-After header, then retry. The numbers are in Free limits.
login_taken409That address is in use right now. Pick another login or domain. A reserved name such as postmaster gets the same code with status 400.
bad_lifetime bad_domain bad_login bad_login_length bad_after bad_message_id bad_attachment_index400A parameter is wrong. The code names it.
message_not_found attachment_not_found unknown_method404This mailbox has no such message or attachment, or the method name is wrong.
method_not_allowed405create and delete accept POST only.
app_only403The push method works only in the TempMailo apps.
dberror no_domains503The service is busy or under maintenance. Retry after a pause.
system_error500An error on our side. Retry, and write to us if it repeats.

Need higher limits?

The free limits fit tests and small projects. Higher limits are planned as a paid option, and there is no price list yet. Tell us what you are building and how many addresses you need per day. We will answer by email.

Ask about higher limits

Questions and answers

Is the TempMailo API free?

Yes. The TempMailo API is free within the limits on this page: 100 new addresses per day, 60 requests per minute, and addresses that live 10 or 60 minutes. You need a free account to get a key. Higher limits are planned as a paid option.

Can I send email through the API?

No. TempMailo addresses only receive mail. The API creates addresses and reads what arrives.

How long are messages kept?

Until the address expires: 10 or 60 minutes after you create it, or sooner if you call delete. After that the address and its mail are removed and cannot be restored.

Can someone else read the mail of my address?

Only a request with your API key and the mailbox token can read it, so keep both private. Mail that came to the same name before you created the address is never shown to you.

The TempMailo API is run by WOWLINK LTD, a company registered in Cyprus (HE 436805). About TempMailo Contact Terms of use Page updated on

We use cookies to keep your inbox open in this browser and to show ads. Cookie policy