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
- application/json
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, otherwisefalse
- sortOrder integer
How this context field should be sorted if no other sort order is selected
legalValues object[]
Responses
- 200
This response has no body.
Authorization
name: Authorizationtype: apiKeyin: header
Request
Request
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"
}
]
}'
python / requests
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"
}
]
}'
go / native
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"
}
]
}'
nodejs / axios
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"
}
]
}'
ruby / Net::HTTP
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"
}
]
}'
csharp / RestSharp
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"
}
]
}'
php / 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"
}
]
}'
java / OkHttp
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"
}
]
}'
powershell / RestMethod
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"
}
]
}'