---
title: "Update subscriber preferences"
method: PATCH
path: "/v2/subscribers/{subscriberId}/preferences"
tags: ["Subscribers"]
---

# Update subscriber preferences

`PATCH /v2/subscribers/{subscriberId}/preferences`

## Request

- Base URL: `https://api.notifly.io`
- URL: `https://api.notifly.io/v2/subscribers/{subscriberId}/preferences`
- Auth: API key in header `Authorization`

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

## Path parameters

- `subscriberId` string, required

## Request body

- PatchSubscriberPreferencesDto
  - `channels` PatchPreferenceChannelsDto
    - `email` boolean: Email channel preference
    - `sms` boolean: SMS channel preference
    - `in_app` boolean: In-app channel preference
    - `push` boolean: Push channel preference
    - `chat` boolean: Chat channel preference
    - `tool` boolean: Tool channel preference
  - `workflowId` string: Workflow internal _id, identifier or slug. If provided, update workflow specific preferences, otherwise update global preferences
  - `schedule` ScheduleDto
    - `isEnabled` boolean, required: Schedule enabled
    - `weeklySchedule` WeeklyScheduleDto
      - `monday` DayScheduleDto
        - `isEnabled` boolean, required: Day schedule enabled
        - `hours` TimeRangeDto[]: Hours
          - `start` string, required: Start time
          - `end` string, required: End time
      - `tuesday` DayScheduleDto
        - `isEnabled` boolean, required: Day schedule enabled
        - `hours` TimeRangeDto[]: Hours
          - `start` string, required: Start time
          - `end` string, required: End time
      - `wednesday` DayScheduleDto
        - `isEnabled` boolean, required: Day schedule enabled
        - `hours` TimeRangeDto[]: Hours
          - `start` string, required: Start time
          - `end` string, required: End time
      - `thursday` DayScheduleDto
        - `isEnabled` boolean, required: Day schedule enabled
        - `hours` TimeRangeDto[]: Hours
          - `start` string, required: Start time
          - `end` string, required: End time
      - `friday` DayScheduleDto
        - `isEnabled` boolean, required: Day schedule enabled
        - `hours` TimeRangeDto[]: Hours
          - `start` string, required: Start time
          - `end` string, required: End time
      - `saturday` DayScheduleDto
        - `isEnabled` boolean, required: Day schedule enabled
        - `hours` TimeRangeDto[]: Hours
          - `start` string, required: Start time
          - `end` string, required: End time
      - `sunday` DayScheduleDto
        - `isEnabled` boolean, required: Day schedule enabled
        - `hours` TimeRangeDto[]: Hours
          - `start` string, required: Start time
          - `end` string, required: End time
  - `context` object

## Response `200`

OK

- object
  - `data` GetSubscriberPreferencesDto
    - `global` SubscriberGlobalPreferenceDto, required
      - `enabled` boolean, required: Whether notifications are enabled globally
      - `channels` SubscriberPreferenceChannels, required
        - `email` boolean: Email channel preference
        - `sms` boolean: SMS channel preference
        - `in_app` boolean: In-app channel preference
        - `chat` boolean: Chat channel preference
        - `push` boolean: Push notification channel preference
        - `tool` boolean: Tool channel preference
      - `schedule` ScheduleDto
        - `isEnabled` boolean, required: Schedule enabled
        - `weeklySchedule` WeeklyScheduleDto
          - `monday` DayScheduleDto
            - `isEnabled` boolean, required: Day schedule enabled
            - `hours` TimeRangeDto[]: Hours
              - …
          - `tuesday` DayScheduleDto
            - `isEnabled` boolean, required: Day schedule enabled
            - `hours` TimeRangeDto[]: Hours
              - …
          - `wednesday` DayScheduleDto
            - `isEnabled` boolean, required: Day schedule enabled
            - `hours` TimeRangeDto[]: Hours
              - …
          - `thursday` DayScheduleDto
            - `isEnabled` boolean, required: Day schedule enabled
            - `hours` TimeRangeDto[]: Hours
              - …
          - `friday` DayScheduleDto
            - `isEnabled` boolean, required: Day schedule enabled
            - `hours` TimeRangeDto[]: Hours
              - …
          - `saturday` DayScheduleDto
            - `isEnabled` boolean, required: Day schedule enabled
            - `hours` TimeRangeDto[]: Hours
              - …
          - `sunday` DayScheduleDto
            - `isEnabled` boolean, required: Day schedule enabled
            - `hours` TimeRangeDto[]: Hours
              - …
    - `workflows` SubscriberWorkflowPreferenceDto[], required: Workflow-specific preference settings
      - `enabled` boolean, required: Whether notifications are enabled for this workflow
      - `channels` SubscriberPreferenceChannels, required
        - `email` boolean: Email channel preference
        - `sms` boolean: SMS channel preference
        - `in_app` boolean: In-app channel preference
        - `chat` boolean: Chat channel preference
        - `push` boolean: Push notification channel preference
        - `tool` boolean: Tool channel preference
      - `overrides` SubscriberPreferenceOverrideDto[], required: List of preference overrides
        - `channel` 'in_app' | 'email' | 'sms' | 'chat' | 'push' | 'tool', required: Channel type through which the message is sent
        - `source` 'subscriber' | 'template' | 'workflowOverride', required: The source of overrides
      - `workflow` SubscriberPreferencesWorkflowInfoDto, required
        - `slug` string, required: Workflow slug
        - `identifier` string, required: Unique identifier of the workflow
        - `name` string, required: Display name of the workflow
        - `updatedAt` string: last updated date
      - `updatedAt` string: Timestamp when the subscriber last updated their preference. Only present if subscriber explicitly set preferences.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `405`: Method Not Allowed
- `409`: Conflict
- `413`: Payload Too Large
- `414`: URI Too Long
- `415`: Unsupported Media Type
- `422`: Unprocessable Entity
- `429`: The client has sent too many requests in a given amount of time.
- `500`: Internal Server Error
- `503`: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.

---

[API](https://skmtc.dev/notifly/apis/notifly-api.md) · [All operations](https://skmtc.dev/notifly/apis/notifly-api/llms.txt) · [OpenAPI document](https://skmtc.dev/notifly/apis/notifly-api/revisions/af909b9e1e57?raw)
