Choose which notices you get, and where
Sets the person's own choices for the categories named; a category not named keeps its setting.
PUT/v1/notification_preferences
Sets the person's own choices for the categories named; a category not named keeps its setting. Turning off a required channel, or naming a category the person's role does not hear, is invalid naming preferences.
For people only: a signed-in person's token makes this call. An API key is refused with person_required.
Request
curl -X PUT "https://api.pod.mapier.ai/v1/notification_preferences" \
-H "Authorization: Bearer $POD_PERSON_TOKEN" \
-H "Content-Type: application/json" \
-d '{"preferences":[{"category":"billing"}]}'Parameters
| Name | In | Type | Required | What it is |
|---|---|---|---|---|
Idempotency-Key | header | string | No | Makes a repeat of this call safe for 24 hours. |
Body
| Field | Type | Required | What it is |
|---|---|---|---|
preferences | object[] | Yes |
Answer
200. The person's preferences as they count now.
{
"organisation": "org_3ahrz6dmv29gqy5ckt18fp",
"data": [
{
"category": "billing",
"email": false,
"dashboard": false,
"required": ["email"]
}
]
}| Field | Type | Always | What it is |
|---|---|---|---|
organisation | string | Yes | |
data | NotificationPreference[] | Yes |
Errors
The refusals this call is known for: invalid, person_required. Any call can also answer unauthorized, rate_limited, unavailable or internal; the error list says what each means and when to send the call again.
In the SDKs
| Client | Call |
|---|---|
| TypeScript | pod.notices.setPreferences(preferences) |
| Python | pod.notices.set_preferences(preferences) |