Skip to main content

Update an existing context field

PUT <your-unleash-url>/api/admin/context/:contextField

Authorization

name: Authorizationtype: apiKeyin: header

Endpoint that allows updating a custom context field. Used to toggle stickiness and add/remove legal values for this context field

Request

Path Parameters

  • contextField string required

Body

required

updateContextFieldSchema

  • description string

    A description of the context field

  • stickiness boolean

    true if this field should be available for use with custom stickiness, otherwise false

  • sortOrder integer

    How this context field should be sorted if no other sort order is selected

  • legalValues object[]

    A list of allowed values for this context field

  • Array [
  • value string required

    The valid value

  • description string

    Describes this specific legal value

  • ]
Responses

This response has no body.

Authorization

name: Authorizationtype: apiKeyin: header

Request

Base URL
<your-unleash-url>
apiKey
contextField — path required
Body required
{
"description": "The user's subscription tier",
"stickiness": false,
"sortOrder": 2,
"legalValues": [
{
"value": "gold"
},
{
"value": "silver"
},
{
"value": "crystal"
}
]
}
curl / cURL
curl -L -X PUT '<your-unleash-url>/api/admin/context/:contextField' \
-H 'Content-Type: application/json' \
-H 'Authorization: <API_KEY_VALUE>' \
--data-raw '{
"description": "The user'\''s subscription tier",
"stickiness": false,
"sortOrder": 2,
"legalValues": [
{
"value": "gold"
},
{
"value": "silver"
},
{
"value": "crystal"
}
]
}'