Skip to main content

Update an existing context field

PUT 

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

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 stringrequired

Bodyrequired

updateContextFieldSchema

    descriptionstring

    A description of the context field

    Example: The user's subscription tier
    stickinessboolean

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

    Example: false
    sortOrderinteger

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

    Example: 2
    legalValues object[]

    A list of allowed values for this context field

  • Array [
  • valuestringrequired

    The valid value

    Example: #c154c1
    descriptionstring

    Describes this specific legal value

    Example: Deep fuchsia
  • ]

Responses

This response has no body.

Authorization: Authorization

name: Authorizationtype: apiKeyin: headerdescription: API key needed to access this API
curl -L -X PUT '<your-unleash-url>/api/admin/context/:contextField' \
-H 'Content-Type: application/json' \
-H 'Authorization: <Authorization>' \
-d '{
"description": "The user'\''s subscription tier",
"stickiness": false,
"sortOrder": 2,
"legalValues": [
{
"value": "gold"
},
{
"value": "silver"
},
{
"value": "crystal"
}
]
}'
Request Collapse all
Base URL
<your-unleash-url>
Auth
Parameters
— pathrequired
Body required
{
  "description": "The user's subscription tier",
  "stickiness": false,
  "sortOrder": 2,
  "legalValues": [
    {
      "value": "gold"
    },
    {
      "value": "silver"
    },
    {
      "value": "crystal"
    }
  ]
}
ResponseClear

Click the Send API Request button above and see the response here!