Contacts
How contacts are created and updated from events, and how unsubscribe and suppression work.
curl -X POST https://senlo.io/api/events \
-H "Authorization: Bearer $SENLO_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "event": "contact_updated", "email": "ada@example.com", "metadata": { "plan": "pro" } }'A contact is one email address in one workspace, with a name, a locale and free-form metadata. Automations run for contacts; triggered emails do not need one.
Fields
| Field | Meaning |
|---|---|
email | Unique per workspace. |
name | Optional. |
locale | Picks the language version an automation sends. See Locales. |
meta | Any JSON object. Sent as metadata in events, available to merge tags in automation emails. tags is an array of strings by convention. |
unsubscribed, unsubscribedAt | Set when the contact unsubscribes. |
Created and updated by events
POST /api/events is how your app keeps contacts current:
contact_addedcreates the contact. For an address that already exists, it updatesnameand replacesmetawith themetadatayou send (when you send one).contact_updatedupdatesnameandlocale, and mergesmetadataintometa: keys you do not send are kept. The contact must exist (404otherwise).tag_addedaddsmetadata.tagsto the contact's tags without duplicates. The contact must exist.order_createdandevent_triggeredcreate the contact if it is new, then start automations.
Unsubscribe
Every email Senlo sends carries a signed unsubscribe link ({{unsubscribe_url}}) and a one-click List-Unsubscribe header. When the recipient uses either:
- If the address is a contact, the contact is marked
unsubscribed. - If it is not (a triggered email to any address), the address is added to the workspace's suppression list with reason
UNSUBSCRIBE.
Either way Senlo stops mailing the address in this workspace: triggered emails and automation steps to it are skipped and logged FAILED with reason UNSUBSCRIBE.
Suppression
The suppression list (Audience in the workspace) holds addresses Senlo will not send to in this workspace. Every send checks it, and the contact's unsubscribed flag, first; a blocked recipient is skipped and the delivery log shows FAILED with the reason.
Addresses get there by:
| Reason | How |
|---|---|
BOUNCE | Your provider reported a bounce through its webhook. |
SPAM | The recipient marked the email as spam and the provider reported it. |
UNSUBSCRIBE | A recipient who is not a contact unsubscribed. |
Removing an entry from the list lets Senlo send to the address again. Bounces and complaints are only recorded if the provider's webhook is connected.