iotoms Docs

Update notification preferences

PUT
/api/v1/notifications/preferences

Turns one or more notification categories on or off for the signed-in user and returns the full updated list. Categories left out are unchanged; turning off a locked category such as admin broadcasts is ignored.

How to use it

  1. Read the current settings with Get notification preferences to see each category and whether it can be turned off.
  2. Send only the categories to change, each with enabled true or false.
  3. The change applies to the signed-in user only; the response lists all categories with their new effective settings. Locked categories stay on.

Authorization

BearerAuth
headerAuthorizationBearer <JWT>

Request Body

application/json
  1. body
preferences*array<>

Categories to change. Categories you leave out keep their current setting.

Response Body

OK

*/*
  1. response
status*string

Outcome of the call: SUCCESS when the request worked, ERROR when it did not.

message*string

Short human-readable message describing the result, for logs or display; do not parse it.

data?

The signed-in user's effective setting for every notification category.

Example Request
curl -X PUT 'https://beta.iotoms.com/api/v1/notifications/preferences' \  -H 'Content-Type: application/json' \  -d '{  "preferences": [    {      "category": "OPS_ROUTE_ASSIGNED",      "enabled": true    }  ]}'
Example Response
{  "status": "string",  "message": "string",  "data": {    "preferences": [      {        "category": "OPS_ROUTE_ASSIGNED",        "group": "OPS",        "enabled": true,        "canDisable": true      }    ]  }}