Skip to content
On this page

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 Keyis provided in the X-Api-Key header.

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 get the response:

{
  "success": true
}

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

Creating a Namespace

Mailisk inboxes are refered to as namespaces. A namespace can be created under Namespaces in the dashboard.

Emails sent to anythinghere@{namespace}.mailisk.net will be received in the inbox. anythinghere can be replaced with whatever email address you want, for every namespace you have unlimited email addresses.

Example

If your namespace is mynamespace. Sending an email to hello@mynamespace.mailisk.net or world@mynamespace.mailisk.net will make that email appear in the inbox.

Reading Emails via API

With your namespace created and a few emails in the inbox, let's see how we can view this using the API. We will use the Search Inbox endpoint:

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 should respond with:

{
  "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,
      "spam_score": -1
    }
    ...
  ]
}

Reference

For more info regarding options and the response type see the Search Inbox API reference.

With this you should now be ready to automate email testing.