List Flags
1 min
GET
https://api.optimizely.com/flags/v1//projects/{project_id}/flags
Path Parameters
- project_idintegerrequiredExampleDescription
Query Parameters
- per_pageinteger<int64>DescriptionFormatint64
- page_numberinteger<int64>DescriptionFormatint64
- page_tokenstringDescription
- page_windowintegerDescription
- sortstring[]Description
- archivedbooleanDescription
- enabledbooleanDescription
- flag_statusstring[]Example
[ "live", "paused" ]
Description - rule_statusstring[]Example
[ "draft", "!concluded" ]
Description - environment_statusstring[]Example
[ "draft", "!concluded" ]
Description - environment_typestring[]Description
- environmentstring[]Description
- rule_typestring[]Description
- querystringDescription
- key_liststring[]Description
- owner_user_idstring[]Description
- team_idsstring[]Description
Responses
200
- Flags
- countintegerrequiredExampleDescription
- create_urlobject
- UrlValue
- fetch_flag_urlobjectDescription
- UrlValue
- filter_urlobjectDescription
- UrlValue
- first_urlobjectrequiredDescription
- UrlValue
- itemsFlag[]required
- account_idinteger<int64>DescriptionFormatint64
- archive_urlobject
- UrlValue
- archivedboolean
- created_by_user_emailstringExample
- created_timestring<date-time>requiredExampleFormatdate-time
- delete_urlobject
- UrlValue
- descriptionstringExample
- environmentsmap<string, FlagEnvironment>required
- idintegerrequiredExample
- is_permanentbooleanDescriptionDefaultfalse
- keystringrequiredExample
- namestringrequiredExample
- outlier_filtering_enabledbooleanDefaultfalse
- owner_user_idstringExampleDescription
- project_idinteger<int64>DescriptionFormatint64
- revisionintegerDescription
- rolestringExampleDescription
- team_idsstring[]Example
[ "1234567890", "0987654321" ]
DescriptionDefault - unarchive_urlobject
- UrlValue
- update_urlobject
- UrlValue
- updated_timestring<date-time>requiredExampleFormatdate-time
- urlobjectrequiredDescription
- UrlValue
- urnstringrequiredExampleDescription
- variable_definitionsmap<string, VariableDefinition>Default{}
- last_urlobjectrequiredDescription
- UrlValue
- next_urlobjectDescription
- UrlList
- pageintegerrequiredExampleDescription
- prev_urlobjectDescription
- UrlList
- reset_urlobjectDescription
- UrlValue
- sort_urlobjectDescription
- UrlValue
- total_countintegerrequiredExampleDescription
- total_pagesintegerrequiredExampleDescription
- urlobjectrequiredDescription
- UrlValue
400
401
403
curl
curl --request GET \
--url https://api.optimizely.com/flags/v1//projects/{project_id}/flags \
--header 'accept: application/json'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var requestOptions = {
method: 'GET',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://api.optimizely.com/flags/v1//projects/{project_id}/flags", 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}/flags")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Get.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/flags/v1//projects/{project_id}/flags"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
200
// Successful retrieval of a page of Flags.
The response includes RESTful JSON (https://restfuljson.org/) styled links and pagination metadata.
Objects in this API MAY include a url property for a link to itself and MAY append _url to properties for related links.
If a link is not present in the response, it indicates a user is not authorized to access the related resource.
{
"count": 2,
"create_url": {},
"fetch_flag_url": {},
"filter_url": {},
"first_url": {},
"items": [
{
"account_id": "",
"archive_url": {},
"archived": false,
"created_by_user_email": "[email protected]",
"created_time": "2019-05-08T00:00:00.000Z",
"delete_url": {},
"description": "Flag used for driving customers to use recurring deposits by showing a graph of compound interest over time",
"environments": "",
"id": 45633994,
"is_permanent": false,
"key": "recurring_deposit",
"name": "Recurring Deposit",
"outlier_filtering_enabled": false,
"owner_user_id": "1234-abcd-5678-efgh",
"project_id": "",
"revision": 0,
"role": "admin",
"team_ids": [
""
],
"unarchive_url": {},
"update_url": {},
"updated_time": "2019-05-08T00:00:00.000Z",
"url": {},
"urn": "flags.flag.optimizely.com::asdfsdf-2344-efadf03-343434-efrrr",
"variable_definitions": ""
}
],
"last_url": {},
"next_url": {},
"page": 5,
"prev_url": {},
"reset_url": {},
"sort_url": {},
"total_count": 20,
"total_pages": 10,
"url": {}
}400
// Malformed requests and invalid parameter names and types
401
// Invalid credentials
403
// Do not have permission to perform the operation