Getting started with the Flexmail transactional API

You can set up your desired implementation using our API. Before you start, it’s important to know that Flexmail strictly separates email marketing and transactional emails to protect deliverability for all your different types of email. That means that transactional and marketing messages never mix, including IP ranges.

Why are we so strict on splitting email traffic? It allows us to follow best practices for separating email reputation as recommended by inbox providers.

Our transactional API can only be used for emails sent to a single recipient, triggered by a user action. Think welcome emails, password resets or invoices. The email API doesn’t support bulk messages. For more information on the differences between transactional and marketing email, you can check out this article.

Step 1: Create a Flexmail account (if you don’t already have one)

Even if you only plan on sending transactional messages, you’ll need to setup a Flexmail account. If you already have a Flexmail account, you can activate the transactional trial using the widget on the dashboard. With our transactional trial, you can send up to 1.000 emails and test for 30 days.

If you haven’t found the transactional API documentation yet, you can find it here.

We’ll use this account for your authentication settings and billing details. If you choose to upgrade, you can choose your transactional subscription and/or marketing subscription there as well.

Step 2: Add a verified sender and set up email authentication

In order to send emails through Flexmail you’ll need to add a verified sender up for each email address you want to use in the From field of your emails.

Verifying a sender means that we send a verification email to the email address to ask for permission for this email address being used as a sender for your transactional and/or marketing emails. It also ensures you own the mailboxes you want to send from.

Screenshot of validation email

You also need to configure authentication through SPF, DKIM, DMARC and a custom return-path for the domains of those senders. This proves that your emails aren’t forged. In other words, it provides a way to verify that an email comes from who it claims to be from. Email authentication is most often used to block harmful or fraudulent uses of email such as phishing and spam. You can find more detailed instructions here.

These safeguards are one of the ways we maintain a great reputation with ISPs and are able to get your emails to the inbox reliably and quickly.

Step 3: Create a personal access token for API authentication

Flexmail authenticates your API requests using the HTTP Basic authentication scheme with your account ID as the username and a personal access token as the password.

Personal access tokens can be managed in the Flexmail application via Settings > API > Personal access tokens

Step 4: Send your first message using the API

Edit our curl example in your terminal: paste your credentials, specify the recipient and from names and email addresses. and enter a subject. Hit enter and check the inbox of the recipient to see your message.

Step 5: Making changes in your code

Congratulations, you’ve already sent your first email. You can now make the necessary code changes to fit everything to your needs. You can find all info you need in our Email API documentation. Make sure to check out personalisation and our web hooks as well.


Flexmail provides webhooks for messages sent, rejected, delivered, bounces, clicks, and open tracking events in the form of HTTP POSTs of well formatted JSON to the URL(s) you specified. Using these webhooks you can receive notifications and data in real-time, as the triggering events occur, without having to make any calls to our API to check for a new event.

Step 6: Let us help

If you’re ever stuck or unsure what to do, we’re always ready to help. Please don’t hesitate to reach out if there’s anything we can do to help you.

Did this answer your question? Thanks for your feedback There was a problem submitting your feedback. Please try again later.

Didn't find what you were looking for? Contact Us Contact Us