Opt-out
Opt-out endpoints manage per-contact, per-platform, per-user messaging preferences. A contact can be opted out of one platform for one user but still reachable on other platforms or by other users.
All endpoints require authentication via the X-API-Key header. See Authentication.
Opt-out model
Opt-outs are stored on the contact document as a nested map:
Platforms: email, stacked-sms, personal-sms, twitter, web-chat.
A value of true means the contact has opted out of receiving messages on that platform from that user.
Get opt-out status
GET /opt-out/:id
Returns the opt-out map for a contact across all platforms and users.
Path parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Contact ID. |
Example request
Response
Set opt-out status
POST /opt-out
Sets the opt-out status for a specific contact, platform, and user combination.
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
contactId | string | Yes | Contact ID. |
userId | string | Yes | User ID. |
platform | string | Yes | email, stacked-sms, personal-sms, twitter, or web-chat. |
value | boolean | Yes | true to opt out, false to opt in. |
Example request
Response
Returns the updated opt-out map for the contact:
Errors
| Status | Message | Cause |
|---|---|---|
| 400 | Validation error | Missing required fields or invalid platform. |
Response envelope
All endpoints use the standard envelope:
Error responses:
data is null for a general failure, such as a database error or an upstream timeout. When the request is rejected because of a specific field, data carries the field(s) at fault instead:
Each issue carries a path (the dotted path into the request body) and a message. A label is added when the path is not self-describing, which today means custom fields only, for example "path": "fields.68b0a1f39c2e4d0012ab77e5", "label": "Class Year". issues is an array, but treat it as holding at most one entry: validation stops at the first failure.