Skip to content

Getting Started

Welcome to Mailisk 👋

Getting your API Key

To get started with the API, you will first need to obtain your API Key. This can be found under API keys in the dashboard

All requests to the REST endpoints require that the Api Key is provided in the X-Api-Key header.

sh
curl --request GET \
     --url https://api.mailisk.com/api/test \
     --header 'Accept: application/json' \
     --header 'X-Api-Key: {Api Key}'

If the API key is valid, you should receive the following response:

json
{
  "success": true
}

You should now be able to use the Mailisk API. For additional information, head over to the API reference.

Creating a Namespace

Mailisk inboxes are refered to as namespaces. You can create a namespace by navigating to Namespaces in the dashboard.

Emails sent to anything@{namespace}.mailisk.net will be received in the Namespace inbox. anything can be replaced with any email prefix you desire. Each namespace allows for unlimited email addresses.

Example

If your namespace is mynamespace, then emails sent to hello@mynamespace.mailisk.net or world@mynamespace.mailisk.net will be delievered to your Namespace's inbox.

Reading Emails via API

With your namespace created and a few emails in your inbox, let's explore how to view them using the API. We will use the Search Inbox endpoint:

sh
curl --request GET \
     --url https://api.mailisk.com/api/emails/{namespace}/inbox \
     --header 'Accept: application/json' \
     --header 'X-Api-Key: {Api Key}'

A successful request will respond with:

json
{
  "options": {
    "total_count": 2,
    "limit": 10,
    "offset": 0
  },
  "data": [
    {
      "id": "1656255823893-tk8rrslxv",
      "from": {
        "address": "test@test.com",
        "name": ""
      },
      "to": {
        "address": "something@test.mailisk.net",
        "name": ""
      },
      "subject": "This is a test",
      "html": "Hello world",
      "text": "Hello world",
      "received_date": "2022-06-26T15:03:43.000Z",
      "received_timestamp": 1656255823,
      "expires_timestamp": 1656259423,
    }
    ...
  ]
}

Reference

For more information regarding options and the response structure, refer to the Search Inbox API reference.

With this, you should now be prepared to automate email testing.

Examples

You can find a variety of written and code-based examples on our blog or in our GitHub repositories.

  • Password Reset w/ Cypress (Github, Blog)
  • Password Reset w/ Selenium in Node (Github, Blog)
  • Receive emails with Node (Blog)