Subscribers

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

Path parameters

subscriberIdstring required

The identifier of the subscriber

Request body

workflowIdstring

Workflow internal _id, identifier or slug. If provided, update workflow specific preferences, otherwise update global preferences

contextobject

Example request

{
  "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"
          }
        ]
      }
    }
  }
}

Response

OK

Example response

{
  "global": {
    "channels": {
      "email": true,
      "in_app": true,
      "push": true,
      "tool": 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": [
    {
      "channels": {
        "email": true,
        "in_app": true,
        "push": true,
        "tool": true
      }
    }
  ]
}

Changes

Changed in 1 of the 13 revisions of this API.13

  • 2e115ea8160c13See the full diff
    • added the new tool enum value to the //// response property for the response status

      response-property-enum-value-added

    • added the new optional request property /////

      new-optional-request-property

    • added the optional property ////////// to the response with the status

      response-optional-property-added

    • added the optional property /////// to the response with the status

      response-optional-property-added