Iterable
Update user profiles and trigger cross-channel email/push/SMS campaign sends via the Iterable API.
Grounded in the Iterable API docs: https://api.iterable.com/api/docs
- Base URL:
https://api.iterable.com - Auth: a single server-side API key sent in the
Api-Keyrequest header. No OAuth/JWT exchange — pass the key directly asapiKey.
What it does
A thin, standard-library-only wrapper over five Iterable endpoints: read a user profile, upsert a user profile, and trigger a campaign send on any of the three channels (email, SMS, push) to a single recipient.
Operations
| operation | HTTP | Purpose |
|---|---|---|
get-user |
GET /api/users/getByEmail?email= |
Look up a user profile by email. |
update-user |
POST /api/users/update |
Upsert a profile keyed by email (or userId); dataFields is merged onto the profile. |
send-email |
POST /api/email/target |
Trigger an email campaign to one recipient. |
send-sms |
POST /api/sms/target |
Trigger an SMS campaign to one recipient. |
send-push |
POST /api/push/target |
Trigger a push campaign to one recipient. |
The three send-* operations are Iterable's "target" sends — they fire a
campaign (campaignId, an integer) at a single recipient identified by email
or userId, with optional dataFields merged into the template. This is the
standard path for transactional / triggered campaigns.
Inputs
| input | required | used by | notes |
|---|---|---|---|
apiKey |
yes | all | Iterable server-side API key (Api-Key header). |
operation |
yes | all | One of the five operations above. |
email |
— | all | Recipient/profile email. Required for get-user; for the others use this or userId. |
userId |
— | update-user, send-* | Alternative identifier to email. |
dataFields |
— | update-user, send-* | JSON object string. Profile fields for update-user; template merge data for send-*. |
campaignId |
— | send-* | Integer Iterable campaign id (required for the send operations). |
Outputs
result— the Iterable response body as a JSON string.status— the HTTP status code as a string (e.g."200").
API key setup
- Sign in to https://app.iterable.com.
- Go to Settings -> API Keys.
- Create a Server-side key and copy it.
- Pass that value as the
apiKeyinput. It is sent verbatim in theApi-Keyheader on every request — no token exchange required.
Examples
Look up a user:
{
"apiKey": "YOUR_SERVER_SIDE_KEY",
"operation": "get-user",
"email": "[email protected]"
}
Upsert profile fields:
{
"apiKey": "YOUR_SERVER_SIDE_KEY",
"operation": "update-user",
"email": "[email protected]",
"dataFields": "{\"firstName\":\"Jane\",\"plan\":\"pro\",\"signupSource\":\"hub\"}"
}
Trigger an email campaign to one recipient with template merge data:
{
"apiKey": "YOUR_SERVER_SIDE_KEY",
"operation": "send-email",
"campaignId": "1234567",
"email": "[email protected]",
"dataFields": "{\"orderId\":\"A-9981\",\"total\":\"$42.00\"}"
}
Trigger an SMS or push campaign (same shape, different operation):
{
"apiKey": "YOUR_SERVER_SIDE_KEY",
"operation": "send-sms",
"campaignId": "2233445",
"userId": "user_8842"
}
Notes
- Standard library only (
urllib,json) — no third-party packages. - Response bodies are capped at ~5 MB.
- 4xx/5xx responses are returned (not raised):
resultcarries Iterable's error JSON andstatuscarries the code, so you can branch on failures in a job.