Add contacts
Add one or more contacts to an audience.
POST
/api/v1/partner/email/audiences/:id/contacts
Connected apps need email.contacts:write. See Connected apps (OAuth).
Request body
json
{
"contacts": [
{ "email": "[email protected]", "first_name": "Asha", "last_name": "Rao", "attributes": { "city": "Pune" } },
{ "email": "[email protected]" }
]
}Use an audience_id from List audiences.
Response
json
{ "success": true, "added": 1, "skipped": 1 }- A new email is added as
subscribedand counts inadded. - An email already in the audience counts in
skipped. Its first and last name are updated, and its status stays as it was, so an unsubscribed contact is never subscribed again this way. - An invalid address counts in
skipped.
cURL
bash
curl -X POST https://api.splashifypro.com/api/v1/partner/email/audiences/8b2f6c1e-9a4d-4f1b-b6a2-1c3d5e7f9a0b/contacts \
-H "Authorization: Bearer $SPLASHIFY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"contacts":[{"email":"[email protected]","first_name":"Asha"}]}'