Skip to the documentation
API

Add contacts to an audience in bulk

Puts up to 200 contacts in one audience in one call, by address. Like the single add, it takes addresses that are already in the workspace book and never creates a contact: an address that is not one comes back in `missing` and nothing is written for it, while the rest of the call still goes through.

POSTapi.openemail.uk/audiences/{id}/contacts/batch

Runs the real call against your workspace, with your own key.

POST /audiences/{id}/contacts/batch

Puts up to 200 contacts in one audience in one call, by address. Like the single add, it takes addresses that are already in the workspace book and never creates a contact: an address that is not one comes back in missing and nothing is written for it, while the rest of the call still goes through.

Example

Needs audiences:write. emails holds 1 to 200 addresses, trimmed and lowercased before they are matched.

curl
curl -X POST "$OE/audiences/aud_4c1b8e2a7d9f05c36b4e8a71/contacts/batch" -H "$AUTH" -H 'content-type: application/json' -d '{  "emails": ["[email protected]", "[email protected]", "[email protected]"]}'
Response
{  "object": "audience_batch",  "audienceId": "aud_4c1b8e2a7d9f05c36b4e8a71",  "added": 1,  "unchanged": 1,  "missing": ["[email protected]"]}

added counts the new memberships, unchanged the contacts that were in the audience already, and missing lists the addresses that are not contacts, lowercased and without repeats. Save those with POST /contacts, or send them to POST /audiences/{id}/import, which creates them.

Safe to replay. A second identical call adds nothing and reports everyone as unchanged. Adding to the default audience always answers added: 0, because every contact is in it already.

An empty emails, more than 200 addresses or any other key in the body is a 422, and nothing is written.