Update a Project
1 min
PATCH
https://api.optimizely.com/v2/projects/{project_id}
Path Parameters
- project_idinteger<int64>requiredDescriptionFormatint64
Body Parameters
- bodyProjectUpdaterequiredDescription
- confidence_thresholdnumber<double>ExampleDescriptionFormatdoubleMinimum0.5Maximum1
- dcp_service_idinteger<int64>ExampleDescriptionFormatint64
- descriptionstringExampleDescription
- namestringExampleDescription
- statusstring<active | archived>DescriptionAllowedactivearchived
- web_snippetWebSnippetUpdate
- enable_force_variationbooleanDescription
- exclude_disabled_experimentsbooleanDescription
- exclude_namesbooleanDescription
- include_jquerybooleanDescription
- ip_anonymizationbooleanDescription
- ip_filterstringExampleDescription
- librarystring<jquery-1.11.3-trim | jquery-1.11.3-full | jquery-1.6.4-trim | jquery-1.6.4-full | none>DescriptionAllowedjquery-1.11.3-trimjquery-1.11.3-fulljquery-1.6.4-trimjquery-1.6.4-fullnone
- project_javascriptstringExampleDescription
- visitor_id_locator_namestringExampleDescription
- visitor_id_locator_typestring<cookie | query | localStorage | js>DescriptionAllowedcookiequerylocalStoragejs
Responses
200
- Project
- account_idinteger<int64>ExampleDescriptionFormatint64
- confidence_thresholdnumber<double>ExampleDescriptionFormatdoubleMinimum0.5Maximum1
- createdstring<date-time>DescriptionFormatdate-time
- dcp_service_idinteger<int64>ExampleDescriptionFormatint64
- descriptionstringExampleDescription
- idinteger<int64>ExampleDescriptionFormatint64
- is_classicbooleanDescription
- is_flags_enabledbooleanDescription
- last_modifiedstring<date-time>DescriptionFormatdate-time
- namestringrequiredExampleDescription
- platformstring<web | ios | android | custom>DescriptionDefaultwebAllowedwebiosandroidcustom
- sdksstring[]Description
- socket_tokenstringExampleDescription
- statusstring<active | archived>DescriptionDefaultactiveAllowedactivearchived
- third_party_platformstring<salesforce>DescriptionAllowedsalesforce
- web_snippetWebSnippet
- code_revisionintegerDescription
- enable_force_variationbooleanDescriptionDefaultfalse
- exclude_disabled_experimentsbooleanDescriptionDefaultfalse
- exclude_namesbooleanDescriptionDefaulttrue
- include_jquerybooleanDescriptionDefaulttrue
- ip_anonymizationbooleanDescriptionDefaultfalse
- ip_filterstringExampleDescription
- js_file_sizeintegerExampleDescription
- librarystring<jquery-1.11.3-trim | jquery-1.11.3-full | jquery-1.6.4-trim | jquery-1.6.4-full | none>DescriptionDefaultjquery-1.11.3-trimAllowedjquery-1.11.3-trimjquery-1.11.3-fulljquery-1.6.4-trimjquery-1.6.4-fullnone
- project_javascriptstringExampleDescription
- visitor_id_locator_namestringExampleDescription
- visitor_id_locator_typestring<cookie | query | localStorage | js>DescriptionAllowedcookiequerylocalStoragejs
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/projects/{project_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/projects/{project_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/projects/{project_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/projects/{project_id}"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("PATCH", url, headers=headers, data=payload)
print(response.text)
200
// Return the updated Project
{
"account_id": 12345,
"confidence_threshold": 0.9,
"created": "",
"dcp_service_id": 121234,
"description": "Project for user sign up flow",
"id": 1000,
"is_classic": false,
"is_flags_enabled": false,
"last_modified": "",
"name": "Test Project",
"platform": "",
"sdks": [
""
],
"socket_token": "AABBCCDD~123456789",
"status": "",
"third_party_platform": "",
"web_snippet": {
"code_revision": 0,
"enable_force_variation": false,
"exclude_disabled_experiments": false,
"exclude_names": false,
"include_jquery": false,
"ip_anonymization": false,
"ip_filter": "^206\\.23\\.100\\.([5-9][0-9]|1([0-4][0-9]|50))$",
"js_file_size": 63495,
"library": "",
"project_javascript": "alert(\"Active Experiment\")",
"visitor_id_locator_name": "cookie_name",
"visitor_id_locator_type": ""
}
}400
// Invalid Project ID supplied
{
"code": "",
"message": "",
"messages": {},
"uuid": ""
}401
// Invalid credentials
{
"code": "",
"message": "",
"messages": {},
"uuid": ""
}403
// You do not have permission to update the specified Project
{
"code": "",
"message": "",
"messages": {},
"uuid": ""
}404
// Project not found
{
"code": "",
"message": "",
"messages": {},
"uuid": ""
}default
// Unexpected error
{
"code": "",
"message": "",
"messages": {},
"uuid": ""
}