apyhub
Back
▣ RETRIEVAL KIT · VERIFICATION KIT

Temporary Email Inbox & OTP API

What it does

The Temporary Email Inbox & OTP API creates a temporary email inbox and pulls the one-time code (OTP) and verification link out of every email it receives. Your tests and AI agents get the code directly, without parsing email HTML.

Send POST /inboxes with an empty body to get a random address, or set inbox to pick your own name at one of the provider's domains. GET /domains lists the domains you can use. Then trigger the email from your app. GET /inboxes/{inbox}/otp returns the code and link from the newest email. Set since to ignore codes from earlier test runs. You can also call GET /inboxes/{inbox}/wait, which holds the request open until the next email arrives. Set its timeout between 10 and 25 seconds.

The API detects codes of 4 to 8 characters, numeric or alphanumeric. Messages are kept for 24 hours. Other endpoints list, read and delete messages and inboxes.

Teams use this temporary email API to run end-to-end tests of sign-up, login and password-reset flows in Playwright, Selenium or Cypress. It gives each CI run a fresh inbox and lets AI agents confirm verification emails on their own. AI agents can call it through ApyHub MCP.

Before you test sign-ups with a temp mail API, check whether your own form blocks disposable addresses with the Email Validation API. Use the Generate Webpage Screenshot API to capture the confirmation page after each test.

▣ ENDPOINT 01 / 08
GET
List Temp Mail Domains
https://api.eu.apyhub.com/dishis/temporary-email-inbox-otp/domains

QUICKSTART

GUIDE

Quickstart

List the available temp email domains.

curl -X GET "https://api.eu.apyhub.com/dishis/temporary-email-inbox-otp/domains" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a JSON object with count as an integer, data as an array of domain objects, and success as a boolean.

Each object in data can include domain as a string, tier as "free" or "pro", and tags as an array of strings.

{
  "count": 2,
  "data": [
    {
      "domain": "lumenbay.info",
      "tier": "free",
      "tags": ["popular"]
    }
  ],
  "success": true
}
TRY ITLIVE · 1 ATOM
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.

About this endpoint

What it does

Returns the available temp mail domains as a JSON object containing a total count, a data array of domain objects, and a success boolean.

Response

Returns a JSON object with count as an integer, data as an array of objects, and success as a boolean. Each item in data includes the domain name, its tier, and its tags.

ParameterTypeMandatoryDescription
countIntegerYesTotal number of domain items returned.
dataObject ArrayYesArray of domain objects. Each object includes domain, tier, and tags.
data[].tagsString ArrayYesTags associated with the domain.
data[].tierENUMYesDomain tier. Allowed values: free, pro.
data[].domainStringYesThe domain name.
▣ ENDPOINT 02 / 08
POST
Create Temporary Inbox
https://api.eu.apyhub.com/dishis/temporary-email-inbox-otp/inboxes

QUICKSTART

GUIDE

Quickstart

Create a temp inbox by sending its email address in the request body.

curl -X POST "https://api.eu.apyhub.com/dishis/temporary-email-inbox-otp/inboxes" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"inbox":"[email protected]"}'

What you'll get back

Returns a JSON object with inbox string, message string, and success boolean fields.

{
  "inbox": "[email protected]",
  "message": "Inbox registered.",
  "success": true
}
TRY ITLIVE · 5 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body
Address to create. Leave out for a random one.

About this endpoint

What it does

Creates a temporary inbox address. You can supply a specific email address to create, or omit it to let the service generate a random one.

Request Body

ParameterTypeMandatoryDescription
inboxStringNoEmail address to create. Format: email. Leave out for a random one.

Response

Returns a JSON object with three top-level fields: inbox string, message string, and success boolean.

ParameterTypeMandatoryDescription
inboxStringNoThe created inbox address.
messageStringNoA response message.
successBooleanNoIndicates whether the inbox was created successfully.
▣ ENDPOINT 03 / 08
GET
Wait for the Next Email
https://api.eu.apyhub.com/dishis/temporary-email-inbox-otp/inboxes/:inbox/wait

QUICKSTART

GUIDE

Quickstart

Wait for a new email in the specified inbox, using the inbox value in the path and the default timeout query parameter.

curl -X GET "https://api.eu.apyhub.com/dishis/temporary-email-inbox-otp/inboxes/:inbox/wait?timeout=20" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a JSON object with success boolean, message string, and data object fields. data contains the email details: id, to, otp (nullable), date, from, subject, hasAttachment, and verificationLink (nullable).

{
  "success": true,
  "message": "Email received",
  "data": {
    "id": "msg_12345",
    "to": "[email protected]",
    "otp": "482931",
    "date": "2026-12-03T12:34:56Z",
    "from": "[email protected]",
    "subject": "Your verification code",
    "hasAttachment": false,
    "verificationLink": null
  }
}
TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.

About this endpoint

What it does

Waits for the next email in the specified inbox and returns the message details when one is available. You can optionally control how long the endpoint waits using the timeout query parameter.

Path Parameter(s)

AttributeTypeMandatoryDescription
inboxStringYesThe inbox identifier or email address.

Query Parameter(s)

AttributeTypeMandatoryDescription
timeoutIntegerNoWait time in seconds. Default: 20. Minimum: 10. Maximum: 25.

Response

Returns a JSON object with data, message, and success fields. data is an object containing the email details, message is a string, and success is a boolean indicating whether the request succeeded.

AttributeTypeMandatoryDescription
dataObjectNoEmail details object with id (String), to (String), otp (String, nullable), date (String, date-time), from (String), subject (String), hasAttachment (Boolean), and verificationLink (String, nullable).
messageStringNoResponse message.
successBooleanNoWhether the request succeeded.
▣ ENDPOINT 05 / 08
GET
List Inbox Messages
https://api.eu.apyhub.com/dishis/temporary-email-inbox-otp/inboxes/:inbox/messages

QUICKSTART

GUIDE

Quickstart

Fetch the messages for a single inbox.

curl -X GET "https://api.eu.apyhub.com/dishis/temporary-email-inbox-otp/inboxes/:inbox/messages" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a JSON object with count as an integer, data as an array of message objects, and success as a boolean.

{
  "count": 1,
  "data": [
    {
      "id": "msg_123",
      "to": "[email protected]",
      "otp": "482931",
      "date": "2026-12-03T10:15:30Z",
      "from": "[email protected]",
      "subject": "Your verification code",
      "hasAttachment": false,
      "verificationLink": "https://example.com/verify"
    }
  ],
  "success": true
}
TRY ITLIVE · 2 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.

About this endpoint

What it does

Lists the messages for a specific inbox and returns a JSON object containing the total message count, the message list, and a success flag.

Path Parameter(s)

AttributeTypeMandatoryDescription
inboxStringYesThe inbox identifier, in email address format.

Response

Returns a JSON object with count as an integer, data as an array of message objects, and success as a boolean. The message objects in data include message metadata and may include nullable fields for OTP and verification link.

ParameterTypeMandatoryDescription
countIntegerNoTotal number of messages returned.
dataObject ArrayNoArray of message objects. Each item includes id, to, otp, date, from, subject, hasAttachment, and verificationLink.
data[].idStringNoMessage identifier.
data[].toStringNoRecipient inbox address.
data[].otpStringNoOne-time password extracted from the message, when present; nullable.
data[].dateStringNoMessage date-time in date-time format.
data[].fromStringNoSender address.
data[].subjectStringNoMessage subject.
data[].hasAttachmentBooleanNoWhether the message has an attachment.
data[].verificationLinkStringNoVerification link extracted from the message, when present; nullable.
successBooleanNoIndicates whether the request completed successfully.
▣ ENDPOINT 06 / 08
GET
Read Email Message
https://api.eu.apyhub.com/dishis/temporary-email-inbox-otp/inboxes/:inbox/messages/:id

QUICKSTART

GUIDE

Quickstart

Fetch a single message from an inbox by its inbox name and message ID.

curl -X GET "https://api.eu.apyhub.com/dishis/temporary-email-inbox-otp/inboxes/:inbox/messages/:id"

What you'll get back

Returns a JSON object with a data object and a success boolean. The data object includes the message details such as id, to, from, subject, date, and optional fields like otp, html, text, attachments, and verificationLink.

{
  "data": {
    "id": "wNp8N0KoV",
    "to": "[email protected]",
    "otp": null,
    "date": "2024-01-01T12:00:00Z",
    "from": "[email protected]",
    "html": null,
    "text": "Your verification code is 123456.",
    "subject": "Your verification code",
    "attachments": [],
    "hasAttachment": false,
    "verificationLink": null
  },
  "success": true
}
TRY ITLIVE · 3 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.

About this endpoint

What it does

Retrieves a single email message from the specified inbox using the inbox name and message ID. The response returns the message details inside a JSON object, including metadata, content fields, attachment information, and a success flag.

Path Parameter(s)

AttributeTypeMandatoryDescription
inboxStringYesThe inbox identifier, in email-address format.
idStringYesThe message identifier.

Response

Returns a JSON object with a data object field and a success boolean field. The data object contains the email message details, and success indicates whether the request succeeded.

ParameterTypeMandatoryDescription
dataObjectYesMessage details object containing the email fields defined below.
successBooleanYesIndicates whether the request succeeded.
ParameterTypeMandatoryDescription
data.idStringYesThe message identifier.
data.toStringYesThe recipient address.
data.otpStringNoThe one-time password, if present.
data.dateStringYesThe message date and time in date-time format.
data.fromStringYesThe sender address.
data.htmlStringNoThe HTML version of the message body, if present.
data.textStringNoThe plain text version of the message body, if present.
data.subjectStringYesThe email subject.
data.attachmentsObject ArrayYesThe message attachments. Each item contains size, filename, and contentType.
data.attachments[].sizeIntegerYesThe attachment size.
data.attachments[].filenameStringYesThe attachment filename.
data.attachments[].contentTypeStringYesThe attachment MIME content type.
data.hasAttachmentBooleanYesIndicates whether the message includes one or more attachments.
data.verificationLinkStringNoA verification link, if present.
▣ ENDPOINT 07 / 08
DELETE
Delete Email Message
https://api.eu.apyhub.com/dishis/temporary-email-inbox-otp/inboxes/:inbox/messages/:id

QUICKSTART

GUIDE

Quickstart

Delete a specific message from an inbox by putting the inbox name and message ID in the URL.

curl -X DELETE "https://api.eu.apyhub.com/dishis/temporary-email-inbox-otp/inboxes/:inbox/messages/:id" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a JSON object with a message string and a success boolean.

{
  "message": "Message deleted.",
  "success": true
}
TRY ITLIVE · 1 ATOM
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.

About this endpoint

What it does

Deletes a specific email message from the inbox identified by inbox, using the message identifier in id. On success, it returns a JSON object indicating the deletion result.

Path Parameter(s)

AttributeTypeMandatoryDescription
inboxStringYesThe inbox identifier, string.
idStringYesThe message identifier, string.

Response

Returns a JSON object with a message string field and a success boolean field. The message field contains the result text, and success indicates whether the delete operation succeeded.

AttributeTypeMandatoryDescription
messageStringNoResult text returned by the API.
successBooleanNotrue when the deletion succeeded.
▣ ENDPOINT 08 / 08
DELETE
Delete Inbox
https://api.eu.apyhub.com/dishis/temporary-email-inbox-otp/inboxes/:inbox

QUICKSTART

GUIDE

Quickstart

Delete an inbox by passing its inbox address in the path.

curl -X DELETE "https://api.eu.apyhub.com/dishis/temporary-email-inbox-otp/inboxes/:inbox" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a JSON object with message as a string and success as a boolean.

{
  "message": "Inbox unregistered.",
  "success": true
}
TRY ITLIVE · 1 ATOM
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.

About this endpoint

What it does

Deletes the inbox identified by the inbox path parameter. On success, it returns a JSON object indicating whether the deletion succeeded and a message describing the result.

Path Parameter(s)

AttributeTypeMandatoryDescription
inboxStringYesThe inbox identifier, in email-address format.

Response

Returns a JSON object with two top-level fields: message as a string and success as a boolean. The message field contains the deletion result text, and success indicates whether the inbox was unregistered.

AttributeTypeMandatoryDescription
messageStringNoResult message returned by the API.
successBooleanNotrue when the delete operation succeeds, otherwise false.
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.