Notifly
API ReferenceSubscribers

Update subscriber preferences

Update subscriber preferences by its unique key identifier **subscriberId**. **workflowId** is optional field, if provided, this API will update that workflow preference, otherwise it will update global preferences

PATCH
/v2/subscribers/{subscriberId}/preferences

Update subscriber preferences by its unique key identifier subscriberId. workflowId is optional field, if provided, this API will update that workflow preference, otherwise it will update global preferences

Authorization

secretKey
Authorization<token>

API key authentication. Allowed headers-- "Authorization: ApiKey <secret_key>".

In: header

Path Parameters

subscriberId*string

The identifier of the subscriber

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://example.com/v2/subscribers/string/preferences" \  -H "Content-Type: application/json" \  -d '{}'
{  "data": {    "global": {      "enabled": true,      "channels": {        "email": true,        "sms": false,        "in_app": true,        "chat": false,        "push": true      },      "schedule": {        "isEnabled": true,        "weeklySchedule": {          "monday": {            "isEnabled": true,            "hours": [              {                "start": "09:00 AM",                "end": "05:00 PM"              }            ]          },          "tuesday": {            "isEnabled": true,            "hours": [              {                "start": "09:00 AM",                "end": "05:00 PM"              }            ]          },          "wednesday": {            "isEnabled": true,            "hours": [              {                "start": "09:00 AM",                "end": "05:00 PM"              }            ]          },          "thursday": {            "isEnabled": true,            "hours": [              {                "start": "09:00 AM",                "end": "05:00 PM"              }            ]          },          "friday": {            "isEnabled": true,            "hours": [              {                "start": "09:00 AM",                "end": "05:00 PM"              }            ]          },          "saturday": {            "isEnabled": true,            "hours": [              {                "start": "09:00 AM",                "end": "05:00 PM"              }            ]          },          "sunday": {            "isEnabled": true,            "hours": [              {                "start": "09:00 AM",                "end": "05:00 PM"              }            ]          }        }      }    },    "workflows": [      {        "enabled": true,        "channels": {          "email": true,          "sms": false,          "in_app": true,          "chat": false,          "push": true        },        "overrides": [          {            "channel": "in_app",            "source": "subscriber"          }        ],        "workflow": {          "slug": "string",          "identifier": "string",          "name": "string",          "updatedAt": "string"        },        "updatedAt": "string"      }    ]  }}