API (application-programming interface) is code that sends information back and forth between two places. For example, you would use API to automatically send subscribers from your WordPress forms to your MailerLite email list.
This communication is triggered by API calls. If one program requests information from another (i.e makes an API call) then your trusty API goes to fetch the data for you.
API connection allows data to be automatically exchanged and updated at any given time.
What is API used for?
MailerLite uses API to receive and send data to other applications, so you can transfer information and connect to other apps. For example, a customer who purchases a product in Shopify can be brought over to MailerLite as a subscriber using our Shopify integration. Using your unique account API token, you can choose from over 100 pre-developed integrations with MailerLite.
API connections to other apps can also be made using our integration with Zapier and Relay.app. Our API documentation is also available to anyone, and can be used to build custom integrations.
Where to find your MailerLite account API key (Generate API token)
1. Head to the Integrations page, which you can find on the lefthand sidebar.
2. Under MailerLite API, you will see the two options:
API: Integrate with other applications.
E-commerce API: Our E-commerce API allows you to connect an external shop to your MailerLite account.
3. Click Use for the API.
4. Click Generate new token.
4. Name the token. This can be any name so you can easily recognize what the token is being used for. For example, if you are creating an API token to use for our Shopify integration, you can add the word “Shopify” here.
5. Choose IP restrictions. Specify which IP addresses can access this API key. You can choose to give access to any IP address, or certain IPs only.
IP Allowlist: Here, you can create a list of trusted IP addresses that are permitted to use your API key. Only requests coming from these specified IP addresses will be accepted.
6. Click Create token.
7. Copy the key that is shown, or click Download to save the key as a TXT file.
MailerLite API documentation (for developers only)
On the Developer API page, you will find all the information you need regarding our API documentation. This includes:
Our API Reference which provides access to MailerLite JSON API. Here you can find all of the information for developing your own integration.
Limited support! Our support team is ready to assist with questions regarding MailerLite native integrations, however we do not offer support for custom API setups or third-party integrations.
Where to find the Group ID
You may need your Group ID for various API calls. Each individual group in your account will have a different identification number. To locate the Group IDs for your account:
Navigate to the Integrations tab.
Go to MailerLite API
Next to API, click Use.
4. Scroll down to the Groups section to find the Group IDs for the groups in your account.
Group IDs can also be located using the API call to list all groups. The IDs for each list can be found in the response.