NAV Navbar
javascript python csharp

Introduction

Welcome to the official DankMail API! Here you will find all public endpoints for our tempmail service.

Authentication

Currently you do not need to get your own apikey, but must use our default key to authenticate requests. The API key should be added to the end of the request url.

Ex. https://dankmail.org/actions.php?action=getDomains&apikey=dankmail

Below is the current default API key. API Key: dankmail

Requests

Get List of All Available Domains

let result = {
  method: "GET",
  url: "https://dankmail.org/actions.php?action=getDomains&apikey=dankmail"
};
import requests

result = requests.request('GET', 'https://dankmail.org/actions.php', params={'action':'getDomains', 'apikey':'dankmail'})
using System.Net.Http;

var hClient = new HttpClient();
hClient.DefaultRequestHeaders.Clear();

var result = await hClient.GetAsync("https://dankmail.org/actions.php?action=getDomains&apikey=dankmail");

The above request returns JSON structured like this:

["dankmail.org", "depressive.club", "discord.sucks"]

This endpoint retrieves the list of all available domains.

HTTP Request

GET https://dankmail.org/actions.php

Query Parameters

Parameter Default Description
action getDomains The action used to get domains.
apikey dankmail The apikey used for authentication.

Create An Email ID

let result = {
  method: "POST",
  //[emailId] should be replaced with the id to create.
  url: "https://dankmail.org/user.php?user=[emailId]&apikey=dankmail"
};
import requests

#[emailId] should be replaced with the id to create.
result = requests.request('POST', 'https://dankmail.org/user.php', params={'user':'[emailId]', 'apikey':'dankmail'})
using System.Net.Http;

var hClient = new HttpClient();
hClient.DefaultRequestHeaders.Clear();

//[emailId] should be replaced with the id to create.
var result = await hClient.PostAsync("https://dankmail.org/user.php?user=[emailId]&apikey=dankmail", null);

The above request returns JSON structured like this:

["mail@dankmail.org"]

This endpoint creates a new email id.

HTTP Request

POST https://dankmail.org/user.php

URL Parameters

Parameter Default Description
user - The name of the email id to create.
apikey dankmail The apikey used for authentication.

Fetch Emails

let result = {
  method: "GET",
  //[emailId] should be replaced with the id to get emails from.
  url: "https://dankmail.org/mail.php?email=[emailID]&apikey=dankmail"
};
import requests

#[emailId] should be replaced with the id to create.
result = requests.request('GET', 'https://dankmail.org/mail.php', params={'email':'[emailId]', 'apikey':'dankmail'})
using System.Net.Http;

var hClient = new HttpClient();
hClient.DefaultRequestHeaders.Clear();

//[emailId] should be replaced with the id to create.
var result = await hClient.GetAsync("https://dankmail.org/user.php?user=[emailId]&apikey=dankmail");

The above request returns JSON structured like this:

[
  {
    "textPlain": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque tincidunt\r\nelementum nunc, vel consequat arcu faucibus vitae.",
    "textHtml": "<div dir=\"auto\"><span style=\"font-family:&quot;open sans&quot;,arial,sans-serif;font-size:14px;text-align:justify;background-color:rgb(255,255,255)\">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque tincidunt elementum nunc, vel consequat arcu faucibus vitae.</span></div>\r\n",
    "id": 141,
    "date": "2019-04-23 12:53:24",
    "headersRaw": "Takes too much space",
    "headers": {
      "date": "Tue, 23 Apr 2019 17:23:24 +0530",
      "Date": "Tue, 23 Apr 2019 17:23:24 +0530",
      "subject": "This is an example mail.",
      "Subject": "This is an example mail.",
      "message_id": "<CALARW7HGZ6FEEWV3+3Y9PqiRkxhVr9DG+wD_tqXhv6BcS64V2w@mail.gmail.com>",
      "toaddress": "example@skid.wtf",
      "to": [{ "mailbox": "example", "host": "skid.wtf" }],
      "fromaddress": "FakeZane Dev <fakezanedev@gmail.com>",
      "from": [
        {
          "personal": "FakeZane Dev",
          "mailbox": "fakezanedev",
          "host": "gmail.com"
        }
      ],
      "reply_toaddress": "FakeZane Dev <fakezanedev@gmail.com>",
      "reply_to": [
        {
          "personal": "FakeZane Dev",
          "mailbox": "fakezanedev",
          "host": "gmail.com"
        }
      ],
      "senderaddress": "FakeZane Dev <fakezanedev@gmail.com>",
      "sender": [
        {
          "personal": "FakeZane Dev",
          "mailbox": "fakezanedev",
          "host": "gmail.com"
        }
      ]
    },
    "subject": "This is an example mail.",
    "fromName": "FakeZane Dev",
    "fromAddress": "fakezanedev@gmail.com",
    "to": { "example@skid.wtf": null },
    "toString": "example@skid.wtf",
    "cc": [],
    "bcc": [],
    "replyTo": { "fakezanedev@gmail.com": "FakeZane Dev" },
    "messageId": "<CALARW7HGZ6FEEWV3+3Y9PqiRkxhVr9DG+wD_tqXhv6BcS64V2w@mail.gmail.com>",
    "tmail_attachments": [],
    "tmail_delete_url": "http://dankmail.org/actions.php?action=delete&id=141&email=example",
    "tmail_download_url": "http://dankmail.org/actions.php?action=download&id=141&email=example"
  }
]

This endpoint fetches emails sent to an id.

HTTP Request

GET https://dankmail.org/mail.php

URL Parameters

Parameter Default Description
email - The email id to fetch emails from.
apikey dankmail The apikey used for authentication.

Delete An Email

let result = {
  method: "POST",
  //[ID] should be replaced with the id of the email(example@skid.wtf).
  //[emailId] should be replaced with the email id.
  url:
    "https://dankmail.org/actions.php?action=delete&id=[ID]&email=[emailId]&apikey=dankmail"
};
import requests

#[ID] should be replaced with the id of the email(example@skid.wtf).
#[emailId] should be replaced with the email id.
result = requests.request('POST', 'https://dankmail.org/actions.php', params={'action':'delete', 'id':'[ID]', 'email':'[emailId]', 'apikey':'dankmail'})
using System.Net.Http;

var hClient = new HttpClient();
hClient.DefaultRequestHeaders.Clear();

//[ID] should be replaced with the id of the email(example@skid.wtf).
//[emailId] should be replaced with the email id.
var result = await hClient.PostAsync("https://dankmail.org/actions.php?action=delete&id=[ID]&email=[emailId]&apikey=dankmail", null);

The above request does not return anything.

This endpoint is used to delete an email.

HTTP Request

POST https://dankmail.org/actions.php

URL Parameters

Parameter Default Description
action delete The action used to delete emails.
id - The id of the email to delete.
email - The email linked to this email id.
apikey dankmail The apikey used for authentication.

Download An Email

let result = {
  method: "GET",
  //[ID] should be replaced with the id of the email(example@skid.wtf).
  //[emailId] should be replaced with the email id.
  url:
    "https://dankmail.org/actions.php?action=download&id=[ID]&email=[emailId]&apikey=dankmail"
};
import requests

#[ID] should be replaced with the id of the email(example@skid.wtf).
#[emailId] should be replaced with the email id.
result = requests.request('GET', 'https://dankmail.org/actions.php', params={'action':'download', 'id':'[ID]', 'email':'[emailId]', 'apikey':'dankmail'})
using System.Net.Http;

var hClient = new HttpClient();
hClient.DefaultRequestHeaders.Clear();

//[ID] should be replaced with the id of the email(example@skid.wtf).
//[emailId] should be replaced with the email id.
var result = await hClient.GetAsync("https://dankmail.org/actions.php?action=download&id=[ID]&email=[emailId]&apikey=dankmail");

The above request returns a file with a .eml extension.

This endpoint is used to download an email.

HTTP Request

GET https://dankmail.org/actions.php

URL Parameters

Parameter Default Description
action download The action used to delete emails.
id - The id of the email to delete.
email - The email linked to this email id.
apikey dankmail The apikey used for authentication.

Errors

The DankMail API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Your API key is wrong.
403 Forbidden -- The email requested is hidden for administrators only.
404 Not Found -- The specified email could not be found.
405 Method Not Allowed -- You tried to access a email with an invalid method.
406 Not Acceptable -- You requested a format that isn't json.
410 Gone -- The email requested has been removed from our servers.
418 I'm a teapot.
429 Too Many Requests -- You're requesting too many emails! Slow down!
500 Internal Server Error -- We had a problem with our server. Try again later.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.