Authentication

All requests to the API must be authenticated using an API Key.

Obtain your API Key

To obtain an API key, log in to the SMTP2GO App and navigate to the "Sending > API Keys" section.

On the API Keys page, click the "Add API Key" button to create an API Key. If you have an existing API Key, you can copy that or manage the settings by clicking on the API Key.

API Key Settings and Customisation

During the setup of your API Key and at any time thereafter, you can modify the following:

Using your API Key

Every request you make to the SMTP2GO API must authenticate with an API Key by either including the api_key field or you can include an X-Smtp2go-Api-Key field in your header.

{
    "api_key": "YourAPIKeyHere",
    "search_subject": "Booking",
    "event_types": ["opened", "clicked"],
    "only_latest": true,
    "limit": 1
}
{
  'Content-Type': 'application/json',
  'X-Smtp2go-Api-Key': 'YourAPIKeyHere'
}

Failure to supply an API Key, or supplying an API Key that is invalid or disabled, will result in a 401 - Unauthorisederror.