Flags

9 minute readReference
On this page

This pages discusses the REST API calls for flags.

Flags replace the Experiments schema. Experiments are being deprecated.

Schemas

Basic Flag

  • String name - The flag’s name

  • [String|Number|Boolean] availableValues - The available values for the flag: array of strings, array of numbers, array of booleans.

    • Default - [true, false]

  • Boolean isPermanent - Defines if the flag is permanent

    • Default - false

Flag Request

  • String name - The flag’s name

  • [String|Number|Boolean] availableValues - The available values for the flag: array of strings, array of numbers, array of booleans.

    • Default - [true, false]

  • String description - The description of the flag

    • Default - ""

  • Boolean enabled - Indicates if the flag is active

    • Default - true

  • Boolean isPermanent - Defines if the flag is permanent

    • Default - false

  • [String] labels - The flag’s labels

    • Default - []

  • String stickinessProperty - Stickiness property that controls percentage based tossing (shows if default value has been changed)

    • Default - rox.distinct_id

  • [Platform] platforms - Specific platform’s configurations

    • Default - []

  • [Condition] conditions - default platform conditions (all platforms that do not contain specific configurations)

    • Default - []

  • String|Number|Boolean value - Value when no condition is met (for the default platform), must be one of availableValues

The boolean flag’s default is false. The string, number, and uninitialized flag’s defaults are null, meaning that the default value in the code is used.

Flag Response

  • String name - The flag’s name

  • [String|Number|Boolean] availableValues - The available values for the flag: array of strings, array of numbers, array of booleans.

  • String description - The description of the flag

  • String created - The date the flag was created

  • String updated - The date the flag was last updated

  • Boolean enabled - Indicates if the flag is active

  • [String] labels - The flag’s labels

  • String stickinessProperty - Stickiness property that controls percentage based tossing (shows if default value has been changed)

  • [Platform] platforms - Specific platform’s configurations

  • [Condition] conditions - Default platform conditions (all platforms that do not contain specific configurations)

  • String|Number|Boolean value - Value when no condition is met (for the default platform), is one of availableValues

  • String status - The status of the flag. Can be one of the following: setup, active, inactive, or stale. This field is only present in the response if the includeFlagStatus query parameter is set to true.

  • Boolean isPermanent - Defines if the flag is permanent

Platform

  • String name - The name of the platform

  • String flag - The name of the flag

    • Default - flag name

  • [Condition] conditions - The targeting and conditions for the flag

    • Default - []

  • String|Number|Boolean value - Value when no condition is met

Condition

  • value - The value when the Condition is met

  • Dependency dependency - Condition this flag value with another flag value

  • Group group - Condition flag value based on target group(s)

  • Version version - Condition flag value based release version

  • Property property - Condition flag value based directly on a custom property

Dependency

  • String flag - Flag name

  • String|Boolean value - The flag’s value that the dependency is conditioned against.

Group

  • String operator - The logical relationship between groups

    • One of or|and|not

    • Default - or

  • [String]|String name - Name of target groups

Version

  • String operator - The operator to compare version

    • One of semver-gt|semver-gte|semver-eq|semver-ne|semver-lt|semver-lte

  • String semver - The version to compare to

Property

  • String name - Name of a custom property

  • String operator - The operator to use on the property

    • One of is-undefined|is-true|is-false|eq|ne|gte|gt|lt|lte|regex|semver-gt|semver-eq|semver-gte|semver-gt|semver-lt|semver-lte

  • String|[String]|Number|Boolean operand - The operand to evaluate the operator with (value to compare with the custom property)

Patch Flag

  • String op - The operation to be performed

    • one of add, remove, replace, move, copy, test

  • String path - Path to the value that is to be changed

    • Ex: path: value is like saying flag.value

  • String value - The value to be used within the operation

  • String from - A string containing a JSON Pointer value

Flags calls

Get Flag

Returns a single flag by name

https://x-api.rollout.io/public-api/applications/<applicationId>/<environmentName>/flags/<flagName>?includeFlagStatus=true

Node
cURL
Ruby
Python
Java
C#
Go
var request = require("request"); var options = { method: 'GET', url: 'https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/Production/flags/myFlag?includeFlagStatus=true', headers: { accept: 'application/json', authorization: 'Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6' } }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
curl --request GET \ --url https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/Production/flags/myFlag?includeFlagStatus=true \ --header 'accept: application/json' \ --header 'authorization: Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6'
require 'uri' require 'net/http' require 'openssl' url = URI("https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/Production/flags/myFlag?includeFlagStatus=true") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) request["accept"] = 'application/json' request["authorization"] = 'Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6' response = http.request(request) puts response.read_body
import requests url = "https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/Production/flags/myFlag?includeFlagStatus=true" headers = { 'accept': "application/json", 'authorization': "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6" } response = requests.request("GET", url, headers=headers) print(response.text)
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/Production/flags/myFlag?includeFlagStatus=true") .get() .addHeader("accept", "application/json") .addHeader("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6") .build(); Response response = client.newCall(request).execute();
var client = new RestClient("https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/Production/flags/myFlag?includeFlagStatus=true"); var request = new RestRequest(Method.GET); request.AddHeader("accept", "application/json"); request.AddHeader("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6"); IRestResponse response = client.Execute(request);
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/Production/flags/myFlag?includeFlagStatus=true" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("accept", "application/json") req.Header.Add("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }

PATH PARAMS

  • applicationId string - The application ID

  • environmentName string - The name of the environment

  • flagName string - The name of the flag

QUERY PARAMS

  • includeFlagStatus boolean - When set to true, the response will include the status field. For performance reasons, this is set to false by default.

Flag response

200 with the flag as body. 404 if the flag doesn’t exist or is deleted

Get Flags

Returns all flags

https://x-api.rollout.io/public-api/applications/<applicationId>/<environmentName>/flags

Node
cURL
Ruby
Python
Java
C#
Go
var request = require("request"); var options = { method: 'GET', url: 'https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/Production/flags', headers: { accept: 'application/json', authorization: 'Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6' } }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
curl --request GET \ --url https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/Production/flags \ --header 'accept: application/json' \ --header 'authorization: Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6'
require 'uri' require 'net/http' require 'openssl' url = URI("https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/Production/flags") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) request["accept"] = 'application/json' request["authorization"] = 'Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6' response = http.request(request) puts response.read_body
import requests url = "https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/Production/flags" headers = { 'accept': "application/json", 'authorization': "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6" } response = requests.request("GET", url, headers=headers) print(response.text)
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/Production/flags") .get() .addHeader("accept", "application/json") .addHeader("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6") .build(); Response response = client.newCall(request).execute();
var client = new RestClient("https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/Production/flags"); var request = new RestRequest(Method.GET); request.AddHeader("accept", "application/json"); request.AddHeader("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6"); IRestResponse response = client.Execute(request);
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/Production/flags" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("accept", "application/json") req.Header.Add("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }

PATH PARAMS

  • applicationId string - The application ID

  • environmentName string - The name of the environment

Flags response

Example:

[ { "type": "flag", "name": "myFlag", "availableValues": [ "false", "true" ], "description": "my flag description", "created": "2020-11-26T10:21:47.850Z", "updated": "", "enabled": false, "labels": [], "stickinessProperty": "rox.distinct_id", "platforms": [], "conditions": [], "value": null }, { "type": "flag", "name": "TestFlag2", "availableValues": [ "false", "true" ], "description": "test flag description", "created": "2020-11-25T12:06:58.028Z", "updated": "", "enabled": false, "labels": [], "stickinessProperty": "rox.distinct_id", "platforms": [], "conditions": [], "value": false }, { "type": "flag", "name": "TestFlag", "availableValues": [ "false", "true" ], "description": "test flag description", "created": "2020-11-25T13:58:58.034Z", "updated": "2020-11-25T13:58:59.837Z", "enabled": true, "labels": [], "stickinessProperty": "rox.distinct_id", "platforms": [], "conditions": [], "value": false }, { "type": "flag", "name": "default flag", "availableValues": [ "false", "true" ], "description": "default flag description", "created": "2020-11-27T12:41:22.837Z", "updated": "2020-11-27T12:41:22.838Z", "enabled": false, "labels": [], "stickinessProperty": "rox.distinct_id", "platforms": [], "conditions": [ { "property": { "name": "Foo", "operator": "is-false" }, "value": "abcd" }, { "group": { "name": [ "target_group_1", "target_group_2" ] }, "value": "1234" }, { "version": { "operator": "semver-eq", "semver": "4" }, "dependency": { "flag": "default flag", "value": "false" }, "value": "sample" } ], "value": "sample" } ]

Response schema type: [Flag]

Create flag

Add a new flag to all environments.

https://x-api.rollout.io/public-api/applications/<applicationId>/flags

Node
cURL
Ruby
Python
Java
C#
Go
var request = require("request"); var options = { method: 'PUT', url: 'https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/flags', headers: { 'content-type': 'application/json', authorization: 'Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6' }, body: { name: 'acmeFlagControl' }, json: true }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
curl --request PUT \ --url https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/flags \ --header 'authorization: Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6' \ --header 'content-type: application/json' \ --data '{"name":"acmeFlagControl"}'
require 'uri' require 'net/http' require 'openssl' url = URI("https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/flags") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Put.new(url) request["content-type"] = 'application/json' request["authorization"] = 'Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6' request.body = "{\"name\":\"acmeFlagControl\"}" response = http.request(request) puts response.read_body
import requests url = "https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/flags" payload = "{\"name\":\"acmeFlagControl\"}" headers = { 'content-type': "application/json", 'authorization': "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6" } response = requests.request("PUT", url, data=payload, headers=headers) print(response.text)
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"name\":\"acmeFlagControl\"}"); Request request = new Request.Builder() .url("https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/flags") .put(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6") .build(); Response response = client.newCall(request).execute();
var client = new RestClient("https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/flags"); var request = new RestRequest(Method.PUT); request.AddHeader("content-type", "application/json"); request.AddHeader("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6"); request.AddParameter("application/json", "{\"name\":\"acmeFlagControl\"}", ParameterType.RequestBody); IRestResponse response = client.Execute(request);
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/flags" payload := strings.NewReader("{\"name\":\"acmeFlagControl\"}") req, _ := http.NewRequest("PUT", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }

PATH PARAMS

  • applicationId string - The application ID

BODY PARAMS

Create a flag configuration

Add a new flag configuration or override an existing one.

https://x-api.rollout.io/public-api/applications/<applicationId>/environmentName/flags/acmeFlagControl

Node
cURL
Ruby
Python
Java
C#
Go
var request = require("request"); var options = { method: 'PUT', url: 'https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/Production/flags/acmeFlagControl', headers: { 'content-type': 'application/json', authorization: 'Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6' }, body: { description: 'Applies foo to our Nifty App', enabled: true, labels: ['do-not-merge'], stickinessProperty: 'fixed' }, json: true }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
curl --request PUT \ --url https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/Production/flags/acmeFlagControl \ --header 'authorization: Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6' \ --header 'content-type: application/json' \ --data '{"name":"acmeFlagControl","description":"Applies foo to our Nifty App","enabled":true,"labels":["do-not-merge"],"stickinessProperty":"fixed"}'
require 'uri' require 'net/http' require 'openssl' url = URI("https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/Production/flags") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Put.new(url) request["content-type"] = 'application/json' request["authorization"] = 'Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6' request.body = "{\"description\":\"Applies foo to our Nifty App\",\"enabled\":true,\"labels\":[\"do-not-merge\"],\"stickinessProperty\":\"fixed\"}" response = http.request(request) puts response.read_body
import requests url = "https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/Production/flags/acmeFlagControl" payload = "{\"description\":\"Applies foo to our Nifty App\",\"enabled\":true,\"labels\":[\"do-not-merge\"],\"stickinessProperty\":\"fixed\"}" headers = { 'content-type': "application/json", 'authorization': "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6" } response = requests.request("PUT", url, data=payload, headers=headers) print(response.text)
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"description\":\"Applies foo to our Nifty App\",\"enabled\":true,\"labels\":[\"do-not-merge\"],\"stickinessProperty\":\"fixed\"}"); Request request = new Request.Builder() .url("https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/Production/flags/acmeFlagControl") .put(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6") .build(); Response response = client.newCall(request).execute();
var client = new RestClient("https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/Production/flags/acmeFlagControl"); var request = new RestRequest(Method.PUT); request.AddHeader("content-type", "application/json"); request.AddHeader("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6"); request.AddParameter("application/json", "{\"description\":\"Applies foo to our Nifty App\",\"enabled\":true,\"labels\":[\"do-not-merge\"],\"stickinessProperty\":\"fixed\"}", ParameterType.RequestBody); IRestResponse response = client.Execute(request);
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/Production/flags/acmeFlagControl" payload := strings.NewReader("{\"description\":\"Applies foo to our Nifty App\",\"enabled\":true,\"labels\":[\"do-not-merge\"],\"stickinessProperty\":\"fixed\"}") req, _ := http.NewRequest("PUT", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }

PATH PARAMS

  • applicationId string - The application id

  • environmentName string - The name of the environment that the flag belongs to

  • flagName string - The name of the flag

BODY PARAMS

  • Request schema type: Flag

Patch Flag

Patch Experiment object by flag name, patching is done according to JSON-Patch (RFC6902).

https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environmentName/flags/flagName

Node
cURL
Ruby
Python
Java
C#
Go
var request = require("request"); var options = { method: 'PATCH', url: 'https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/Production/flags/acmeFlagControl', headers: { 'content-type': 'application/json', authorization: 'Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6' }, body: [{op: 'replace', path: '/value', value: true}], json: true }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
curl --request PATCH \ --url https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/Production/flags/acmeFlagControl \ --header 'authorization: Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6' \ --header 'content-type: application/json' \ --data '[{"op":"replace","path":"/value","value":true}]'
require 'uri' require 'net/http' require 'openssl' url = URI("https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/Production/flags/acmeFlagControl") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Patch.new(url) request["content-type"] = 'application/json' request["authorization"] = 'Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6' request.body = "[{\"op\":\"replace\",\"path\":\"/value\",\"value\":true}]" response = http.request(request) puts response.read_body
import requests url = "https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/Production/flags/acmeFlagControl" payload = "[{\"op\":\"replace\",\"path\":\"/value\",\"value\":true}]" headers = { 'content-type': "application/json", 'authorization': "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6" } response = requests.request("PATCH", url, data=payload, headers=headers) print(response.text)
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "[{\"op\":\"replace\",\"path\":\"/value\",\"value\":true}]"); Request request = new Request.Builder() .url("https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/Production/flags/acmeFlagControl") .patch(body) .addHeader("content-type", "application/json") .addHeader("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6") .build(); Response response = client.newCall(request).execute();
var client = new RestClient("https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/Production/flags/acmeFlagControl"); var request = new RestRequest(Method.PATCH); request.AddHeader("content-type", "application/json"); request.AddHeader("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6"); request.AddParameter("application/json", "[{\"op\":\"replace\",\"path\":\"/value\",\"value\":true}]", ParameterType.RequestBody); IRestResponse response = client.Execute(request);
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/Production/flags/acmeFlagControl" payload := strings.NewReader("[{\"op\":\"replace\",\"path\":\"/value\",\"value\":true}]") req, _ := http.NewRequest("PATCH", url, payload) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }

PATH PARAMS

  • applicationId string - The application id

  • environmentName* string - The name of the environment that the flag belongs to

  • flagName* string - Flag name

BODY PARAMS

Common patch body examples

Changing the stickiness property:

[{"op": "replace", "path": "/stickinessProperty", "value": "groupId"}]

Changing the flag’s value to true:

[{"op": "replace", "path": "/value", "value": true}]

Adding a group condition to the end of a flag’s configurations (assuming the flag already has conditions):

[{"op": "add", "path": "/conditions/-", "value": {"group":{"operator": "or", "name": "internalEmployees"}, "value": true}}]

Adding two items to the end of an equal one of array, to the third condition of the flag:

[{"op": "add", "path": "/conditions/2/property/operand/-", "value": "Sokka"}, {"op": "add", "path": "/conditions/2/property/operand/-", "value": "Katara"}]

Setting the flag to false for the Android platform (assuming there are platforms set, but Android is not):

[{"op": "add", "path": "/platforms/-", "value": [{"name": "Android", "value": false}]}]

Delete Flag

Removes flag from the application by its flag name.

https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/flags/flagName

Node
cURL
Ruby
Python
Java
C#
Go
var request = require("request"); var options = { method: 'DELETE', url: 'https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/flags/acmeFlagControl', headers: {authorization: 'Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6'} }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
curl --request DELETE \ --url https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/flags/acmeFlagControl \ --header 'authorization: Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6'
require 'uri' require 'net/http' require 'openssl' url = URI("https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/flags/acmeFlagControl") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Delete.new(url) request["authorization"] = 'Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6' response = http.request(request) puts response.read_body
import requests url = "https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/flags/acmeFlagControl" headers = {'authorization': 'Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6'} response = requests.request("DELETE", url, headers=headers) print(response.text)
OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/flags/acmeFlagControl") .delete(null) .addHeader("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6") .build(); Response response = client.newCall(request).execute();
var client = new RestClient("https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/flags/acmeFlagControl"); var request = new RestRequest(Method.DELETE); request.AddHeader("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6"); IRestResponse response = client.Execute(request);
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/flags/acmeFlagControl" req, _ := http.NewRequest("DELETE", url, nil) req.Header.Add("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }

PATH PARAMS

  • applicationId* string - The application ID

  • flagName* string - The flag name