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

NameInTypeRequiredWhat it is
Idempotency-KeyheaderstringNoMakes a repeat of this call safe for 24 hours.

Body

FieldTypeRequiredWhat it is
preferencesobject[]Yes

Answer

200. The person's preferences as they count now.

200
{
  "organisation": "org_3ahrz6dmv29gqy5ckt18fp",
  "data": [
    {
      "category": "billing",
      "email": false,
      "dashboard": false,
      "required": ["email"]
    }
  ]
}
FieldTypeAlwaysWhat it is
organisationstringYes
dataNotificationPreference[]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

ClientCall
TypeScriptpod.notices.setPreferences(preferences)
Pythonpod.notices.set_preferences(preferences)