Getting Started with the API

A quick start guide, important concepts about the API, and authentication instructions.

Whether you are an experienced user of SMTP2GO or have recently joined, this Getting Started with the API guide will take you through the basic steps and requirements to begin sending.

Already using the API? Our API Features Guide will introduce the functionality we offer through the API so you can make the most of your SMTP2GO Account.

This guide assumes you already have an Account with us. Should you not, head to our subscription pages or reach out for support to get signed up!

Your API Key

You can find, manage and add API Keys from your SMTP2GO Dashboard.

From here, navigate to the Sending > API Keys tab.

Here you'll be able to copy the API Key for the account, manage setting (detailed below), or include additional keys.

You'll use this Key in the requests as authentication; details of request Authentication can be found in our API Authentication guide.

API Key Settings and Customisation

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

  • Set the Description of your API Key. A friendly name to remember it by.
  • Set a Rate Limit for your API Key. This defaults to unlimited.
  • Set the Permissions for your API Key. You specify endpoint permissions; whether the key can access a particular POST.
  • Set a Default Unsubscribe Footer (more info)
  • Enable Open Tracking (more info)
  • Enable Click Tracking (more info)
  • Temporarily Disable your API Key
  • Enable Email Archiving (more info)
  • Set a BCC Address for Email Auditing
  • Enable and set Bounce Notifications

These changes are managed in the SMTP2GO app. Simply select Sending > API Keys then click the blue, linked name under the 'API Keys' header to begin modifying.

Using your API Key

Every request that you make to the SMTP2GO API, must be authenticated. Your account must be set up - including at least one or more Verified Senders.

Verifying your senders is mandatory. There are two options to choose from for verification which include verifying the Sender Domains or Single sender email addresses. For further details, please view our 'Verified Senders: Sender Domain vs Single Sender Emails' support page.

With a working Account and Verified senders, you a ready to begin structuring your request.

Technical Details

To work with the API, please adhere to the following guides:

  • All API Calls must be made with an HTTP POST request.
  • All input to and output from the API is made using JSON objects.
  • All calls return a JSON payload consisting of a result string and any data that was returned.
  • Any 200 OK responses indicate a successful call.
  • All requests must include the api_key field, however you can alternatively choose to 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 - Unauthorized status code (See 'Response Codes' for full details).