Sub topic 14
Integrations, APIs and getting your data out
This chapter assumes you know what a subscriber list is, what an API is at a basic level (a way for one program to ask another to do something over HTTP), and that you have read the earlier chapters on core features and provider categories. The goal is to judge a provider's integrations and exit options before you commit, because both are hard to fix later.
Why this matters at selection time
An email service provider (ESP) rarely works alone. Your signup forms, store, payment processor, webinar tool and CRM (customer relationship management system) all hold facts about subscribers. If those tools cannot talk to your ESP, you end up copying data by hand. If you cannot get your data out of the ESP, you are locked in.
Evaluate two things separately:
- Integration depth: how well the ESP connects to the tools you already use.
- Portability: how completely you can export your data, and how usable that export is in another system.
Three ways an ESP connects to other tools
| Method | How it works | Typical use | Common weakness |
|---|---|---|---|
| Native integration | The ESP or the other tool ships a ready-made connector you switch on and authorize. | Store, forms, landing pages, analytics | Often covers only common cases. Field mapping may be fixed. |
| Automation middleware | A third-party service (such as Zapier or Make) moves data between apps using triggers and actions. | Linking tools with no native connector | Extra cost, delays, and one more thing that can break. |
| API and webhooks | Your own code calls the ESP's API, and the ESP calls your code with webhooks. | Custom apps, transactional sending, syncing with your database | Needs development time and error handling. |
A webhook is an HTTP request the ESP sends to a URL you control when an event happens, such as an unsubscribe or a bounce. An API works the other way: your code sends the request to the ESP.
What to check in an API
Marketing and transactional features differ between providers, so read the API documentation before you decide. Look for these points:
- Coverage. Can you create and update subscribers, manage tags or segments, trigger automations, and read campaign statistics? Some features available in the web interface are missing from the API.
- Authentication. Most ESPs use API keys or OAuth. Keys should be revocable and, ideally, scoped to limited permissions.
- Rate limits. Providers cap requests per second or per minute. A bulk sync that ignores limits will fail partway.
- Webhook events. Check whether you receive unsubscribes, spam complaints and hard bounces. You need these to keep other systems in sync.
- Idempotency and duplicates. If your code retries a request, will the subscriber be created twice? Updating by email address ("upsert") is safer than blind creation.
- Versioning. Find out how the provider announces breaking changes.
Providers differ here, and details change over time, so confirm against current documentation instead of relying on a summary.
A defensive API call
The sketch below adds a subscriber to a hypothetical provider. The URL, field names and header are placeholders. Your provider documents its own. The pattern is what matters: a timeout, an explicit status check, and a bounded retry that respects a rate-limit response.
import os
import time
import requests
API_URL = "https://api.esp.example/v1/subscribers"
API_KEY = os.environ["ESP_API_KEY"] # never hard-code keys
def upsert_subscriber(email, first_name, consent_source, max_attempts=3):
payload = {
"email": email,
"first_name": first_name,
"consent_source": consent_source,
}
headers = {"Authorization": f"Bearer {API_KEY}"}
for attempt in range(1, max_attempts + 1):
response = requests.put(API_URL, json=payload, headers=headers, timeout=10)
if response.status_code == 429: # rate limited
wait = int(response.headers.get("Retry-After", 2 ** attempt))
time.sleep(wait)
continue
response.raise_for_status() # raises on other 4xx and 5xx errors
return response.json()
raise RuntimeError(f"Gave up on {email} after {max_attempts} attempts")
if __name__ == "__main__":
print(upsert_subscriber("[email protected]", "Ada", "signup-form"))Run this only against a provider whose real endpoint and fields you have substituted. Using a PUT keyed on the email address makes a retry harmless, because repeating it updates the same record.
Integration patterns and where they go wrong
Common errors:
- One-way sync. The store pushes buyers to the ESP, but unsubscribes never flow back. The store later re-adds a person who opted out. This is a compliance problem, not only an annoyance.
- Field mismatch. The CRM uses one field for full name, the ESP uses two. Names arrive blank and personalization breaks.
- Tags versus lists. A tool built for one model can behave oddly with another. See the chapter on lists, tags and segments.
- Silent failure. Middleware tasks stop after an expired token and nobody notices for weeks. Set up alerts.
- Paid-tier gating. A connector or API access may exist only on a higher plan. Check this against the pricing model you chose.
Getting your data out
Portability is the part buyers skip. Test it during your trial, not on the day you leave.
What a complete export contains
A useful export holds more than email addresses. At minimum, expect:
- Subscription status for each address (subscribed, unsubscribed, cleaned or bounced, complained).
- Consent evidence: where and when the person opted in.
- Custom fields, tags and segment membership.
- Signup date and, where available, engagement history.
The sample below shows a minimal shape worth aiming for.
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,newsletterWhat often does not export
- Automation logic. Sequences and their conditions usually cannot be moved. You rebuild them by hand in the new tool.
- Email templates and designs. Some providers export HTML, others do not, and the HTML may not render the same elsewhere.
- Campaign reports. Aggregate numbers may export, but per-recipient history may not.
- Segments. Saved segments are rules, not data. You export the people, then recreate the rules.
- Suppression and consent proof. Some providers export unsubscribed and bounced contacts as separate files. If you lose them, you may email people who opted out.
Checking an export before you trust it
Run a quick script on the file during your trial. This one counts statuses and flags rows missing consent data.
import csv
from collections import Counter
counts = Counter()
missing_consent = []
with open("export.csv", newline="", encoding="utf-8") as f:
for row in csv.DictReader(f):
counts[row["status"]] += 1
if row["status"] == "subscribed" and not row.get("consent_date"):
missing_consent.append(row["email"])
print(dict(counts))
print(f"Subscribed with no consent date: {len(missing_consent)}")If the second number is large, you will not be able to prove consent for those people after a move. Raise it before you commit.
Decision criteria
Add these to the weighted matrix from the evaluation chapter:
- Does the provider have native connectors for your top three tools?
- Does the API cover the actions you need, and is it included in your plan?
- Do webhooks cover unsubscribes, bounces and complaints?
- Can you export status, consent data, tags and custom fields in one step?
- Is there a documented way to export suppressed contacts?
A practical test: during the trial, import 50 test contacts, connect one real integration, trigger one webhook, then export everything and load it into a spreadsheet. The gaps you find are the gaps you would live with.
Exercise
You are comparing two providers. Provider A has many native integrations but exports only email addresses and names. Provider B has fewer integrations, but its export includes subscription status, consent date, tags and a separate suppression list. Your list has 8,000 people collected under a privacy law that requires proof of consent. Which provider has the portability advantage, and what would you check before choosing Provider A anyway?
Show answer
Provider B has the portability advantage because its export keeps status, consent evidence, tags and suppressions, which you need to move without re-emailing opted-out people or losing proof of consent. Before choosing Provider A you would check whether consent data can be retrieved some other way, such as through its API or a support-assisted export, and whether you can keep your own copy of consent records in a database kept in sync through webhooks.