Articles in this section

API Keys and the MailerLogic API

Published:

MailerLogic provides API keys that let your applications and connected tools access account data and perform supported actions. You can use the API to manage contacts, send emails, retrieve analytics, enroll contacts in automations, and manage webhooks.

This guide explains the difference between account API keys and integration API keys, how to generate and rotate keys, how to authenticate API requests, and how to troubleshoot common errors.

Understand the Two Types of API Keys

MailerLogic supports two types of API keys. Choose the type that matches your integration.

Account API keyIntegration API key
Where to find itProfileIntegrations → Apps
PurposeAccess the account API from your own backendConnect third-party applications and automation tools
PermissionsBroad account-level accessLimited to the permissions you select
Key managementRotate the account key to replace itManage or revoke the individual connection
ExamplesYour application's backendZapier, Make, Pabbly, and other connected tools

Which should you use?

Use an account API key when you control the application and its backend. Use a scoped integration API key when connecting a third-party application, so it receives only the permissions it needs.

Generate Your Account API Key

An account API key authenticates requests made by your application to MailerLogic.

Step 1: Generate the API key

Go to 'Profile', find the 'API' section, and click 'Generate'.

Copy the key immediately and save it in a secure secrets manager.

The full key is displayed only once. After that, MailerLogic shows only a short prefix so you can identify the active key.

The full key is displayed only when it is generated. Copy and store it immediately. Afterward, MailerLogic displays only a shortened prefix, such as ml_live_a1b2…, so you can identify the active key.

If you lose the key, you cannot retrieve the original value. You must generate a replacement by rotating the account API key. 

API keys are available on paid plans. If you're on the Free plan, follow the upgrade prompt to access this feature.


Rotate Your Account API Key

Rotating your account API key generates a new key and revokes the previous account API key. All systems using the old key must be updated.

Only the 'account owner' can rotate the account API key. Admins and other team members cannot perform this action.

Before rotating the key

Prepare every application and service that uses the existing key. This may include backend applications, scheduled jobs, deployment environments, and internal tools.

Step 2: Rotate the API Key

Click the 'Rotate API Key' button.

Rotating the key immediately invalidates the previous key. Make sure you are ready to update every application that uses it.

2

Step 3: Copy the New API Key

Copy the 'New API Key' and store it securely in your secrets manager or the application that uses it.

3

Create a Scoped Integration API Key

Integration API keys let you give third-party applications only the permissions they need.

Step 4: Connect an App

Go to 'Integrations' → 'Apps' and connect the application you want to use.

4

Step 5: Select API Scopes

Select the required permissions or 'Scopes' and 'Generate the API key'.

Choose the Required Permissions

Integration keys use scopes to determine which API operations an application can perform.

ScopePermission
contacts:readRead contacts
contacts:writeCreate and update contacts
contacts:tagsTag contacts
emails:sendSend emails
templates:readRead saved templates
events:readRead events
analytics:readRead analytics
webhooks:readRead webhooks
webhooks:writeCreate and update webhooks
suppressions:readRead suppressions
suppressions:writeManage suppressions
automations:enrollEnroll contacts in automations

Select only the scopes required by the connected application.

For example, an integration that syncs new signups into MailerLogic needs contacts:write. It does not need emails:send unless it also sends email.

Limiting permissions reduces the potential impact if an integration is compromised.

5

Step 6: Store the API Key

Store the key securely in the connected application or its secrets manager.

You can change an integration's scopes, regenerate its key, or revoke the connection from Integrations → Apps.

6

Update or Revoke an Integration Key

From 'Integrations' → 'Apps', open the relevant connection and use the available management options to:

  • Change the permissions granted to the connection.

  • Regenerate its key, when supported.

  • Revoke the connection when it is no longer needed.

Revoking an integration key prevents that connection from using the revoked key. If you regenerate a key, update the connected application with the replacement.

Authenticate API Requests

Send your API key in the authentication header required by the MailerLogic developer documentation. Make requests over HTTPS.

Never place an API key in a URL query string. URLs can be recorded in server logs, browser history, and referrer information.

Keep Your API Key Secure

  • Use environment variables or a secrets manager. Do not hardcode keys in your application source.

  • Keep keys on your server. Never expose them in front-end JavaScript, mobile application binaries, or other code users can inspect.

  • Do not commit keys to source control. This applies even to private repositories.

  • Limit access. Share keys only with systems and people that require them.

  • Use scoped keys for third-party tools. Grant only the permissions needed for each integration.

Your frontend should communicate with your backend, and your backend should make authenticated requests to MailerLogic.

For the required authentication header, endpoint paths, and request formats, refer to the developer documentation linked from 'Integrations' → 'Apps'.

What Can You Do With the MailerLogic API?

The API supports several common email and contact-management workflows.

FeatureSupported operations
ContactsCreate, update, look up, tag, and manage contacts
Email sendingSend transactional and campaign emails through supported endpoints
TemplatesRetrieve saved templates
Events and analyticsAccess delivery, engagement, and other supported event data
SuppressionsRead and manage suppression records
AutomationsEnroll contacts in automations
WebhooksCreate and manage webhook endpoints programmatically

Available operations depend on the endpoint, the permissions assigned to your integration key, and your account's plan.

Consult the developer documentation linked from 'Integrations' → 'Apps' for the complete endpoint reference, request paths, parameters, and payload formats.

Send Transactional Emails Through the API

A specific user action or system event triggers transactional emails. Examples include:

  • Password resets.

  • Order confirmations and receipts.

  • Account activation links.

  • Important account notifications.

You can send transactional emails through the API or SMTP. Campaigns are generally used for planned marketing communications to lists or segments.

Transactional emailCampaign or marketing email
TriggerA user action or system eventA planned marketing send
RecipientsUsually an individual recipientA list or segment
PurposeDeliver information related to a transaction or account eventPromote products, services, or offers
Unsubscribe requirementsDepends on the message and applicable lawMarketing emails generally require an unsubscribe mechanism

Keep transactional messages focused on their intended purpose. Adding promotional content may change how a message is classified and affect compliance and deliverability.

Transactional emails sent through the API still count toward your plan's sending limits.

Understand API Rate Limits

MailerLogic limits API requests per account. The applicable rate limit depends on your plan.

The Free plan allows 60 requests per minute, with a maximum of 100 recipients per call. Paid plans may have higher limits.

Check 'Usage' → 'Rate Limiting' & 'Throughput' for your account's current limits.

Best Practices for Handling Rate Limits

  • Handle HTTP 429 responses: Reduce the request rate and retry after an appropriate delay.

  • Use exponential backoff: Increase the wait time between repeated retries.

  • Batch requests: Use batch operations when the endpoint supports them.

  • Cache data: Avoid repeatedly requesting information that has not changed.

  • Monitor usage: Review your account's usage and rate-limit information when requests are frequently throttled.

Avoid repeatedly retrying requests without a delay, as this can prolong rate-limit issues.

Troubleshooting

401: Authentication Failed

The request could not be authenticated.

Check the following:

  • Confirm that you're using the correct API key.

  • Check whether the account API key was rotated and your application still uses the old value.

  • Ensure the key has no extra spaces or newline characters.

  • Confirm that the key is supplied in the required authentication header, not a query parameter.

403: Forbidden

The request was authenticated, but the key does not have permission to perform the operation.

For integration keys, open Integrations → Apps and review the connection's assigned scopes. Add the required permission if appropriate and permitted.

Also verify that the selected account and plan support the requested operation.

429: Too Many Requests

Your application has exceeded the applicable API rate limit.

Reduce the request rate, implement exponential backoff, and retry after an appropriate delay. Check Usage → Rate Limiting & Throughput if the issue continues.

Email Sends Are Rejected

If an email request fails, check the following:

  • Verify that your sending domain has the required SPF and DKIM configuration.

  • Review your daily and monthly sending limits under Usage.

  • Check whether your account is still in its email warmup period.

I Lost My Account API Key

The full account API key cannot be recovered after generation.

The account owner must rotate the key, securely store the replacement, and update every system that uses it.

An Integration Cannot Access an Endpoint

Check that the integration key has the scope required by the endpoint. If the key was regenerated or revoked, update the connected application with a valid key.

Frequently Asked Questions

Can I have more than one account API key?

No. MailerLogic provides one account API key per account. If different systems need separate credentials, use scoped integration keys where supported. For applications that send through SMTP, you can also use separate SMTP credentials.

Do API keys expire automatically?

Account API keys do not expire on a fixed timer. Integration keys may have an expiration date, which is displayed on the connection when applicable.

Should I use the API or SMTP?

SMTP is a convenient option when an existing application already supports SMTP sending. The API supports additional workflows, including contact management, analytics, automation enrollment, and other programmatic operations.

You can use both, depending on your application's requirements.

Does API usage count toward my sending limit?

Emails sent through the API count toward your sending limits. Read-only API requests do not consume email-sending volume, but they count toward the API rate limit.

Can team members generate or rotate API keys?

Rotating the account API key is restricted to the account owner. Integration management is also subject to account permissions. See Managing Teams and User Invitations for details about role permissions.

What should I do if an API key is exposed?

Rotate the account API key immediately if it has been exposed. For an exposed integration key, revoke or regenerate the affected connection as appropriate. Update any legitimate systems that need the replacement credentials.

MailerLogic API keys let your applications connect securely to email and contact-management features. Keep account keys private, use scoped integration keys for third-party tools, and rotate exposed credentials promptly. Review permissions and rate limits regularly to keep your integrations secure and reliable.

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
Access denied
Access denied