Sub topic 14
Integrations, APIs and getting your data out
This chapter assumes you know what an email service provider (ESP) does, how lists and tags work, and why consent records matter. It covers three things to check before you commit to a provider: native integrations, the API, and how you can export your data.
Three ways to connect an ESP
Most tools reach your ESP in one of three ways.
- Native integrations are built and maintained by the provider or the other tool's vendor. Examples are a checkout plugin or a form builder. They are the easiest to set up, but they usually cover only the common cases.
- Automation middlemen such as Zapier or Make connect thousands of apps without code. They fill the gaps in native integrations, but they add a monthly cost and one more thing that can break.
- The API is the provider's programmatic interface. It lets your own code add subscribers, apply tags and send messages. It takes the most effort and gives the most control.
What to check in an integration
A logo on a provider's integrations page does not tell you how deep the integration goes. Test these points during your trial:
- Does it sync consent status and tags, or only the email address?
- Does it sync in both directions? An unsubscribe in the ESP should reach your shop or CRM.
- Does it cover your actual use case? A shop integration that tracks purchases is different from one that only adds buyers to a list.
- Which pricing tier includes it? Some providers reserve the API or certain integrations for paid plans.
The API in practice
An API call usually needs a key, which you must keep secret. The sketch below shows the general shape. Endpoint paths, field names and authentication differ for each provider, so use your provider's documentation for the real values.
import os
import requests
API_KEY = os.environ["ESP_API_KEY"] # never hard-code the key
BASE_URL = "https://api.provider.example/v1" # placeholder; use your provider's URL
payload = {
"email": "[email protected]",
"first_name": "Ada",
"tags": ["newsletter"],
"consent_source": "signup-form",
}
response = requests.post(
f"{BASE_URL}/subscribers",
json=payload,
headers={"Authorization": f"Bearer {API_KEY}"},
timeout=10,
)
response.raise_for_status()
print(response.status_code)Common errors are hitting rate limits (too many requests per minute), ignoring error responses so failed signups go unnoticed, and sending a subscriber who never opted in.
Getting your data out
Portability is easy to ignore until you want to leave. Before you choose, run a test export and look at what you get.
A useful export has one row per contact and includes subscription status, consent source, consent date and tags, like this:
email,first_name,status,consent_source,consent_date,tags
[email protected],Ada,subscribed,signup-form,2025-03-14,newsletter;webinar
[email protected],Lin,unsubscribed,signup-form,2024-11-02,newsletterCheck for these gaps:
- Unsubscribed and bounced contacts missing from the export. You need them so you never email those people again.
- Consent details absent. Without them you cannot prove how someone opted in.
- Automations, templates and campaign history. These often cannot be exported in a reusable form, so plan to rebuild them.
You will use these checks again in the weighted scoring matrix, under the data export criterion.
Exercise
A provider's export contains only email addresses and first names. Name two problems this causes when you migrate, and what you should do before choosing the provider.
Show answer
You lose subscription status, so you might email people who unsubscribed, and you lose consent source and date, so you cannot prove how people opted in. Before choosing, test an export during the trial and either pick a provider whose export includes status and consent fields or confirm you can keep those records elsewhere.