The AB Marketing API lets your other systems — your online shop, your app, your CRM — send in their contacts, what those people agreed to, their unsubscribes, and what they did after an email. An API is a way for one program to talk to another; this page is for whoever looks after those systems, and it carries the full reference, so an integration can be built from it alone.
Create a key
- Open API from the workspace’s buttons. Only a Manager or an Admin can create or revoke keys.
- Say Which system will use it, e.g. Online shop (production). Make one key per system, so each can be revoked on its own.
- Click Create key, copy it from Copy this key now into the other system’s secret settings, and click I’ve stored it.
Each key shows when it was created and last used. Revoke refuses that system from then on; what it already sent is kept.
What the API does
Base address https://blz.actionbridge.io. Send the key on every call as Authorization: Bearer mk_… (or X-AB-Key: mk_… if your tool can’t set that header). Requests and answers are JSON.
| Call | For |
|---|---|
GET /api/marketing/topics | The workspace’s topics and their ids. Topics are made in the app, never through the API. |
POST /api/marketing/contacts | Up to 500 contacts per call, each with optional consent per topic, or an unsubscribe, bounce or complaint |
POST /api/marketing/events | Up to 500 events — “bought”, “booked a demo” — which become Acted in your results |
Up to 120 calls a minute from one address. Each contact and each event succeeds or is refused on its own, with a reason, so one bad row never stops the rest.
Or: the website tag
If what you want to count happens on your website — a sign-up, a purchase — you may not need anyone to call the API. The website tag is a snippet for your pages that reports those events from the visitor’s browser.
- Enter your website’s domains. On the API page, under Website tag, type them in Your website’s domains (one per line, such as
example.com; subdomains are included) and click Save domains. A Manager or an Admin can do this. - Paste the snippet into every page, before
</head>. It is shown once the domains are saved, with a Copy button. - Tell it the visitor agreed to cookies: when your cookie banner records consent, call
abm('consent', 'granted'). - Report what they did:
abm('event', 'purchase', { id: 'order-1042' }). Theidis optional; with it, a repeat counts once.
abm('consent', 'granted'), the tag stores nothing and sends nothing — asking for consent is your site’s job. Links to other websites never carry the reference.The key in the snippet is not a secret; it only works from pages on your domains. Replace key issues a new one, and pages with the old snippet stop counting until you paste the new one. Use the API instead for what happens away from your website, such as an order confirmed in your back office.
The same rules as a person
- Consent needs a basis —
opt-in,customer,business-cardorimported-unknown— and an opt-in needs the name of the wording the person saw (noticeVersion). The same meanings as in Topics and consent. - Restoring a withdrawal, or lifting a suppression, needs a
reasona person can read later. - Sending the same thing again changes nothing, so a nightly sync of everyone is fine.
- A blank field changes nothing: the API can update a name or company but never empty it.
- Events are only accepted for people the workspace already knows — a contact it holds or someone it has emailed. Others are refused and nothing about them is kept. Send an
id(such as the order number) so a retried call records the event once.
Unsubscribing on your own site
If your system keeps track of who wants your email, readers can unsubscribe on your site instead of on ours. Set your unsubscribe address on the Sending page (see Connecting your email service), then send each contact’s unsubscribeToken: your own id for that person, which is put into your address where it says {token}. A reader with no token keeps our unsubscribe link.
- Accept the one-click request. Gmail’s and Yahoo’s unsubscribe button sends a
POSTto your address with the bodyList-Unsubscribe=One-Click(RFC 8058), without showing a page. Your address must accept it and unsubscribe the person without asking anything more. - Send the unsubscribe back. Post it as a withdrawal for the topic or as
"suppress": "unsubscribed". Until you do, we keep sending to them. - Keep the token stable. Sending a different token replaces the stored one; a blank or missing one leaves it as it is, so a token can’t be removed through the API yet.
Reference
GET /api/marketing/topics
{ "topics": [ { "id": "3f1c…", "name": "Product news" } ] }
Archived topics are not listed. Consent is always sent against these ids, never names.
POST /api/marketing/contacts
{
"contacts": [
{
"email": "hana@example.jp",
"name": "Hana Sato",
"company": "Example KK",
"locale": "ja-JP",
"unsubscribeToken": "c-81f2a9",
"consent": [
{
"topic": "3f1c…",
"granted": true,
"basis": "opt-in",
"noticeVersion": "shop-signup-2025-04",
"occurredAt": "2025-04-02T09:15:00+09:00"
}
]
},
{ "email": "left@example.jp", "suppress": "unsubscribed" }
]
}
A contact (1 to 500 per call):
| Field | Required | Notes |
|---|---|---|
email | yes | The address is the contact. Upper and lower case are the same address. |
name, company, locale | no | Fill in or update a contact. A blank or missing field changes nothing. locale is a language tag such as ja-JP or en-US; it picks the signature and footer the person gets (see Connecting your email service). This is the way to change the language of a contact you already hold. |
unsubscribeToken | no | Your own id for this person, used in your unsubscribe address (see Unsubscribing on your own site above). Up to 500 characters, with no spaces. A different one replaces the stored token; a blank or missing one changes nothing. |
consent | no | At most 50 items. See the next table. |
suppress | no | unsubscribed, hard-bounce or complaint. After this nothing is sent to the address, whatever its topics say. |
liftSuppression | no | true to undo a suppression. Needs reason. Not together with suppress. |
reason | with liftSuppression | Why the address may receive mail again, in words a person can read later. |
A consent item:
| Field | Required | Notes |
|---|---|---|
topic | yes | A topic id from GET /topics. |
granted | yes | true: they agreed. false: they withdrew. |
basis | when granted is true | opt-in, customer, business-card or imported-unknown. |
noticeVersion | when basis is opt-in | The name of the wording they agreed to, one you will still recognise later, such as shop-signup-2025-04. A new version for the same topic is recorded as a new agreement. |
occurredAt | no | When it happened in your system (ISO 8601). Kept as evidence; it never reorders history and may not be in the future. |
reason | to restore a withdrawal | A granted: true after a withdrawal is refused without one. |
Bringing unsubscribes across from another tool
Do this first, before any contacts with consent, so nobody who opted out elsewhere is ever mailed.
- Unsubscribed from everything:
{ "email": "left@example.jp", "suppress": "unsubscribed" }. An address the workspace has never seen becomes a contact that holds only this suppression, with no consent. - Unsubscribed from one topic:
{ "email": "x@example.jp", "consent": [ { "topic": "3f1c…", "granted": false } ] }. This is recorded for an unknown address too. - Nothing brings them back by accident. A CSV import never lifts a suppression and leaves alone any topic a person already has history on. Through the API, lifting needs
liftSuppressionwith areason, and re-granting a withdrawn topic needs areason. The person themselves can resubscribe from their preferences page.
The answer
200 with one result per contact, in the order sent:
{
"ok": true,
"results": [
{ "email": "hana@example.jp", "status": "created", "error": null,
"consent": [ { "topic": "3f1c…", "status": "recorded", "error": null } ],
"suppression": null },
{ "email": "left@example.jp", "status": "created", "error": null,
"consent": [], "suppression": "recorded" }
]
}
status | Meaning |
|---|---|
created | A new contact |
updated | The name, company, locale or unsubscribe token changed |
unchanged | Nothing to change |
recorded | A consent item or a suppression was written |
refused | Nothing was written for it; see error |
suppression is null when the contact said nothing about it, otherwise recorded or unchanged.
POST /api/marketing/events
{
"events": [
{ "email": "pat@example.com", "name": "purchase", "occurredAt": "2026-11-29T10:15:00Z", "id": "order-1042" },
{ "email": "kim@example.com", "name": "demo booked" }
]
}
| Field | Required | Notes |
|---|---|---|
email | yes | The person’s address, as you hold it. |
name | yes | What they did, in a few plain words: letters, digits, spaces and _ - . :, up to 64 characters. Use the same name every time for the same thing. |
occurredAt | no | ISO 8601. Defaults to when we received it; not more than a day in the future. |
id | no | Your own id for the event, such as the order number, up to 128 characters. A retried call then records it once. |
An event counts for the last email the person clicked, if that click came in the 7 days before it; clicks by mail scanners never count. Each person counts once per email. The answer is one result per event, in order, with status (recorded or refused), error, and attributed (whether it counted for an email).
Errors
A refused contact, consent item or event carries one of these codes; the rest of the call still goes through.
| Code | Meaning |
|---|---|
email-invalid | The address is not one |
topic-not-found | The topic id is not one of this workspace’s |
topic-archived | The topic has been archived |
basis-unknown | granted: true with no basis, or one not listed above |
notice-version-required | An opt-in with no noticeVersion |
reason-required | Restoring a withdrawal or lifting a suppression with no reason |
occurred-at-invalid | occurredAt is in the future |
cause-unknown | suppress is not one of the three values |
suppress-and-lift | Both were sent for one contact |
too-many-consent-items | More than 50 consent items for one contact |
unsubscribe-token-invalid | An unsubscribeToken longer than 500 characters, or with a space or a control character in it. Nothing is written for that contact |
event-name-invalid | An event name outside the allowed characters or length |
contact-not-found | An event for someone the workspace neither holds nor has emailed |
For the whole call: 400 when the request itself is wrong (no contacts or events, or more than 500); 401 with {"ok":false,"error":"Unknown API key."} for any key that is not accepted (malformed, unknown, revoked, or another product’s); 429 past 120 calls a minute from one address — wait a minute and retry.
Not in the API yet
- Reading contacts back or learning about unsubscribes made in AB Marketing — the API only takes data in.
- Erasing a contact — ask in the app.
- Removing an unsubscribe token — a blank one changes nothing.