Update Exclusion Groups
1 min
PATCH
https://api.optimizely.com/flags/v1//projects/{project_id}/groups
Path Parameters
- project_idintegerrequiredExampleDescription
Responses
200
- GroupMapExample
{ "987": { "archive_url": "/projects/12345/groups/archived", "archived": false, "created_time": "2019-05-08T00:00:00.000Z", "delete_url": "/projects/12345/groups/456", "description": "Updated description for group", "environment_key": "production", "id": 987, "name": "Promo Group", "project_id": 12345, "rules": { "456": { "created_time": "2022-01-08T00:00:00.000Z", "flag_key": "recurring_revenue", "flag_name": "Recurring Revenue", "flag_status": "unarchived", "rule_key": "experiment_one", "rule_name": "Experiment One", "traffic_allocation": 2000, "updated_time": "2022-01-08T00:00:00.000Z" } }, "unarchive_url": "/projects/12345/groups/unarchived", "update_url": "/projects/12345/groups", "updated_time": "2019-05-08T00:00:00.000Z", "url": "/projects/12345/groups/456", "urn": "groups.flag.optimizely.com::987" } }Description
400
401
403
404
409
curl
curl --request PATCH \
--url https://api.optimizely.com/flags/v1//projects/{project_id}/groups \
--header 'accept: application/json'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json-patch+json");
var requestOptions = {
method: 'PATCH',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://api.optimizely.com/flags/v1//projects/{project_id}/groups", 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/flags/v1//projects/{project_id}/groups")
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-patch+json"
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.optimizely.com/flags/v1//projects/{project_id}/groups"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/json-patch+json'
}
response = requests.request("PATCH", url, headers=headers, data=payload)
print(response.text)
200
// Successful update, archive or unarchive of Groups.
The response includes RESTful JSON (https://restfuljson.org/) styled links. If a
link is not present in the response, it indicates a user is not authorized to access
the related resource.
{}400
// Malformed requests and invalid parameter names and types
401
// Invalid credentials
403
// Do not have permission to perform the operation
404
// Not found. No content
409
// Conflicting resource state with requested action