TempMailg API Documentation

TempMailg API Documentation

Use this documentation to generate your personal API key, connect the dedicated user API host, read mailbox messages, manage owned mailboxes, and integrate Temp Mail into your own apps or automations.

User API Base URL
Request format Use your API key only in the Authorization Bearer header and keep endpoint URLs clean.

User API endpoints

Every endpoint below uses the same base URL and the same Bearer token. Mailbox, message, and attachment requests are checked against the authenticated user account.

GET https://v1.tempmailg.com/api/domains?type={type}

Fetch the domains allowed for the current user plan and account.

Allowed type values: free, premium, all. Free plan can use only free. Premium plan can use free, premium, or all.
Get allowed domains
curl --request GET \
  --url 'https://v1.tempmailg.com/api/domains?type=free' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_USER_API_KEY'

Example response

{
    "status": true,
    "data": {
        "requested_type": "free",
        "allowed_types": [
            "free"
        ],
        "domains": [
            {
                "domain": "example.com",
                "type": "Free",
                "custom": false
            }
        ]
    }
}
POST https://v1.tempmailg.com/api/emails

Create a new random mailbox owned by the authenticated user.

Create random mailbox
curl --request POST \
  --url 'https://v1.tempmailg.com/api/emails' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_USER_API_KEY'

Example response

{
    "status": true,
    "data": {
        "id": 2301,
        "email": "randombox@example.com",
        "domain": "example.com",
        "expire_at": "2026-06-07T19:47:26+00:00",
        "expires_in_seconds": 600,
        "created_at": "2026-06-07T19:37:26+00:00",
        "email_token": "encrypted-email-token"
    }
}
POST https://v1.tempmailg.com/api/emails/{email}/{username}/{domain}

Update or switch an existing owned mailbox to a new username and allowed domain.

Use an existing owned mailbox email in {email}.
Update owned mailbox
curl --request POST \
  --url 'https://v1.tempmailg.com/api/emails/current@example.com/demo123/example.com' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_USER_API_KEY'

Example response

{
    "status": true,
    "data": {
        "id": 2302,
        "email": "demo123@example.com",
        "domain": "example.com",
        "expire_at": "2026-06-07T19:47:26+00:00",
        "expires_in_seconds": 600,
        "created_at": "2026-06-07T19:37:26+00:00",
        "email_token": "encrypted-email-token"
    }
}
DELETE https://v1.tempmailg.com/api/emails/{email}

Delete an owned mailbox.

Delete owned mailbox
curl --request DELETE \
  --url 'https://v1.tempmailg.com/api/emails/demo123@example.com' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_USER_API_KEY'

Example response

{
    "status": true,
    "message": "Email has been successfully deleted."
}
GET https://v1.tempmailg.com/api/messages?email={email}

List messages for an owned mailbox.

The email query parameter must belong to the authenticated user account.
Read mailbox messages
curl --request GET \
  --url 'https://v1.tempmailg.com/api/messages?email=demo123@example.com' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_USER_API_KEY'

Example response

{
    "status": true,
    "mailbox": "randombox@example.com",
    "messages": [
        {
            "is_seen": false,
            "subject": "Welcome to Temp Mail",
            "from": "Example Sender",
            "from_email": "hello@example.org",
            "to": "randombox@example.com",
            "receivedAt": "2026-06-07 19:37:26",
            "id": "ap94AWDg123ELQz07vrVB9dLXlbqZM5NGwYxOJKko8n6m1",
            "html": true,
            "content": "<p>Hello from the inbox.</p>",
            "attachments": [
                {
                    "name": "file.txt",
                    "extension": "txt",
                    "size": 91,
                    "url": "https://v1.tempmailg.com/api/messages/ap94AWDg123ELQz07vrVB9dLXlbqZM5NGwYxOJKko8n6m1/attachments/file.txt"
                }
            ]
        }
    ]
}
GET https://v1.tempmailg.com/api/messages/{messageId}

Read a single owned message.

Read one message
curl --request GET \
  --url 'https://v1.tempmailg.com/api/messages/ap94AWDg123ELQz07vrVB9dLXlbqZM5NGwYxOJKko8n6m1' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_USER_API_KEY'

Example response

{
    "status": true,
    "data": {
        "is_seen": true,
        "subject": "Welcome to Temp Mail",
        "from": "Example Sender",
        "from_email": "hello@example.org",
        "to": "randombox@example.com",
        "receivedAt": "2026-06-07 19:37:26",
        "id": "ap94AWDg123ELQz07vrVB9dLXlbqZM5NGwYxOJKko8n6m1",
        "html": true,
        "content": "<p>Hello from the inbox.</p>",
        "attachments": [
            {
                "name": "file.txt",
                "extension": "txt",
                "size": 91,
                "url": "https://v1.tempmailg.com/api/messages/ap94AWDg123ELQz07vrVB9dLXlbqZM5NGwYxOJKko8n6m1/attachments/file.txt"
            }
        ]
    }
}
DELETE https://v1.tempmailg.com/api/messages/{messageId}

Delete a single owned message.

Delete one message
curl --request DELETE \
  --url 'https://v1.tempmailg.com/api/messages/ap94AWDg123ELQz07vrVB9dLXlbqZM5NGwYxOJKko8n6m1' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_USER_API_KEY'

Example response

{
    "status": true,
    "message": "Message was deleted successfully."
}
GET https://v1.tempmailg.com/api/messages/{messageId}/attachments/{filename}

Download an attachment from an owned message.

This endpoint downloads the file directly.
Download an attachment
curl --request GET \
  --url 'https://v1.tempmailg.com/api/messages/ap94AWDg123ELQz07vrVB9dLXlbqZM5NGwYxOJKko8n6m1/attachments/file.txt' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_USER_API_KEY' \
  --output file.txt
Download behavior This endpoint returns the requested file directly instead of a JSON body.
Do you accept cookies?

We use cookies to enhance your browsing experience. By using this site, you consent to our cookie policy.

Read Cookies
Loading chat...
Connecting to community chat.