Users
Preferences

Update user preference set

Updates a complete preference set for a user. This is a destructive operation that will replace the existing preference set for the user.

put/v1/users/{user_id}/preferences/{id}

Path parameters

user_idstring required

The ID for the user that you set when identifying them in Knock.

idstring required
Example:default

Unique identifier for the preference set.

Request body

Example request

{
  "categories": {
    "marketing": false,
    "transactional": {
      "channel_types": {
        "email": false
      }
    }
  },
  "channel_types": {
    "email": true
  },
  "workflows": {
    "dinosaurs-loose": {
      "channel_types": {
        "email": false
      }
    }
  }
}

Response

OK

idstring required

Unique identifier for the preference set.

Example response

{
  "categories": {
    "marketing": false,
    "transactional": {
      "channel_types": {
        "email": false
      }
    }
  },
  "channel_types": {
    "email": true,
    "push": false,
    "sms": {
      "conditions": [
        {
          "argument": "US",
          "operator": "equal_to",
          "variable": "recipient.country_code"
        }
      ]
    }
  },
  "id": "default",
  "workflows": null
}

Changes