Update a Feature
1 min
PATCH
https://api.optimizely.com/v2/features/{feature_id}
Path Parameters
- feature_idinteger<int64>requiredDescriptionFormatint64
Body Parameters
- bodyFeatureUpdaterequiredDescription
- archivedbooleanDescription
- descriptionstringDescription
- environmentsmap<string, FeatureEnvironment>Description
- keystringExampleDescriptionMax Length64Pattern^[a-zA-Z0-9_\-]+$
- namestringExampleDescription
- variablesFeatureVariableUpdate[]Description
- archivedbooleanDescriptionDefaultfalse
- default_valuestringExampleDescription
- descriptionstringDescription
- idinteger<int64>DescriptionFormatint64
- keystringDescription
- typestring<boolean | string | double | integer | json>DescriptionAllowedbooleanstringdoubleintegerjson
Responses
200
- Feature
- archivedbooleanDescriptionDefaultfalse
- createdstring<date-time>DescriptionFormatdate-time
- descriptionstringDescription
- environmentsmap<string, FeatureEnvironment>Description
- idinteger<int64>DescriptionFormatint64
- keystringrequiredExampleDescriptionMax Length64Pattern^[a-zA-Z0-9_\-]+$
- last_modifiedstring<date-time>DescriptionFormatdate-time
- namestringExampleDescription
- project_idinteger<int64>requiredDescriptionFormatint64
- variablesFeatureVariable[]Description
- archivedbooleanDescriptionDefaultfalse
- default_valuestringrequiredExampleDescription
- idinteger<int64>DescriptionFormatint64
- keystringrequiredDescription
- typestring<boolean | string | double | integer | json>requiredExampleDescriptionAllowedbooleanstringdoubleintegerjson
400
- Error
- codestring
- messagestring
- messagesobject
- uuidstring<uuid>Formatuuid
401
- Error
- codestring
- messagestring
- messagesobject
- uuidstring<uuid>Formatuuid
403
- Error
- codestring
- messagestring
- messagesobject
- uuidstring<uuid>Formatuuid
404
- Error
- codestring
- messagestring
- messagesobject
- uuidstring<uuid>Formatuuid
default
- Error
- codestring
- messagestring
- messagesobject
- uuidstring<uuid>Formatuuid
curl
curl --request PATCH \
--url https://api.optimizely.com/v2/features/{feature_id} \
--header 'accept: application/json'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var requestOptions = {
method: 'PATCH',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://api.optimizely.com/v2/features/{feature_id}", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.optimizely.com/v2/features/{feature_id}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.optimizely.com/v2/features/{feature_id}"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("PATCH", url, headers=headers, data=payload)
print(response.text)
200
// Successfully updated the Feature
{
"archived": false,
"created": "",
"description": "",
"environments": "",
"id": "",
"key": "new_checkout_page",
"last_modified": "",
"name": "the checkout feature",
"project_id": "",
"variables": [
{
"archived": false,
"default_value": "0.05",
"id": "",
"key": "",
"type": "double"
}
]
}400
// Invalid request body content
{
"code": "",
"message": "",
"messages": {},
"uuid": ""
}401
// Invalid credentials
{
"code": "",
"message": "",
"messages": {},
"uuid": ""
}403
// You do not have permission to update specified Feature
{
"code": "",
"message": "",
"messages": {},
"uuid": ""
}404
// Feature not found
{
"code": "",
"message": "",
"messages": {},
"uuid": ""
}default
// Unexpected error
{
"code": "",
"message": "",
"messages": {},
"uuid": ""
}