Change Permissions
1 min
PATCH
https://api.optimizely.com/permissions/projects/{project_id}/{entity_type}/{entity_id}
Path Parameters
- project_idintegerrequired
- entity_typeEntityTypeInPathrequired
- entity_idstringrequired
Body Parameters
- bodyPatchOperation[]required
- opOperationTyperequired
- pathstringrequired
- valueobject
Responses
200
- undefined
422
- HTTPValidationError
- detailValidationError[]
- locobject[]required
- msgstringrequired
- typestringrequired
curl
curl --request PATCH \
--url https://api.optimizely.com/permissions/projects/{project_id}/{entity_type}/{entity_id} \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"op": "",
"path": ""
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"op": "",
"path": ""
});
var requestOptions = {
method: 'PATCH',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.optimizely.com/permissions/projects/{project_id}/{entity_type}/{entity_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/permissions/projects/{project_id}/{entity_type}/{entity_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"
request.body = JSON.dump({
"op": "",
"path": ""
})
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.optimizely.com/permissions/projects/{project_id}/{entity_type}/{entity_id}"
payload = json.dumps({
"op": "",
"path": ""
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("PATCH", url, headers=headers, data=payload)
print(response.text)
200
// Successful Response
""422
// Validation Error
{
"detail": [
{
"loc": [
{}
],
"msg": "",
"type": ""
}
]
}