API - How to connect to Tempmail.id.vn via API

Official API Docs: https://tempmail.id.vn/docs/api

Create API Token

  • Step 1: Create an account at tempmail.id.vn
  • Step 2: Go to your profile via the avatar or here
  • Step 3: Generate an API token in the API section to use it.

Note: The API token is only shown once when it's created. If you forget it, delete and generate a new one.

Sample code using Guzzle library

Token Information Lookup

Get the current user info associated with the token.

curl -L -X GET 'https://tempmail.id.vn/api/user' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {token}'

Mail Management

Create a New Mail

curl -L -X POST 'https://tempmail.id.vn/api/email/create' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {token}' \
-d '{
	"user": "demo",
	"domain": "tempmail.id.vn"
}'
  • user is the desired username to create
  • domain is the domain name to assign

If both fields are not provided, a random mail will be created.

Your Mail List

curl -L -X GET 'https://tempmail.id.vn/api/email' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {token}'

Mail's Message List

curl -L -X GET 'https://tempmail.id.vn/api/email/{mail_id}' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {token}'
  • mail_id is the mail ID from the list

Read Message Content

curl -L -X GET 'https://tempmail.id.vn/api/message/{message_id}' \
-H 'Authorization: Bearer {token}'
  • message_id is the message ID from the list

Netflix Code

Automatically Fetch Netflix Code

  • To use this API, you need to create an email on tempmail. Then, set up forwarding from the email used with Netflix to the newly created tempmail address.
  • All emails will be redirected to the tempmail system, and you can check them there.
  • If the message is from Netflix and matches the format of 'Household Verification' or 'Temporary Netflix Access Code', the system will automatically extract the code for you.

To retrieve the code, simply call the following API:

curl -L -X POST 'https://tempmail.id.vn/api/netflix/get-code' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {token}' \
--data-raw '{
	"email": "[email protected]"
}'
  • email is the Netflix-used email address for which you want to fetch the code