Apply a patch to a feature's variants (in all environments).
PATCH<your-unleash-url>/api/admin/projects/:projectId/features/:featureName/variants
Apply a list of patches patch to the specified feature's variants. The patch objects should conform to the JSON-patch format (RFC 6902).
⚠️ Warning: This method is not atomic. If something fails in the middle of applying the patch, you can be left with a half-applied patch. We recommend that you instead patch variants on a per-environment basis, which is an atomic operation.
Request
Responses
- 200
- 400
- 401
- 403
- 404
featureVariantsSchema
The request data does not match what we expect.
Authorization information is missing or invalid. Provide a valid API token as the authorization
header, e.g. authorization:*.*.my-admin-token
.
The provided user credentials are valid, but the user does not have the necessary permissions to perform this operation
The requested resource was not found.
Authorization: Authorization
name: Authorizationtype: apiKeyin: headerdescription: API key needed to access this API
- curl
- python
- go
- nodejs
- ruby
- csharp
- php
- java
- powershell
- CURL
curl -L -X PATCH '<your-unleash-url>/api/admin/projects/:projectId/features/:featureName/variants' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: <Authorization>' \
-d '[
{
"path": "/type",
"op": "replace",
"from": "/type",
"value": "kill-switch"
}
]'
ResponseClear