Flags

This pages discusses the REST API calls for flags.

Flags replace the Experiments schema. Experiments are being deprecated.

Flag schema

  • String name - The flag’s name

    • availableValues - The available values that this flag can be

  • String description - The description of the flag

  • Boolean enabled - Indicates if the flag is active

    • labels - The flag’s labels

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

  • [Array] platforms - Specific platforms configurations

    • String platforms[].name - Name of the platform, as defined in the SDK running

    • String platforms[].flag - Override the flag name, when needed - deprecated

  • [Array] platforms[].conditions - Conditions Array for the specific platform (see Condition schema)

    • platforms[].value - Value when no condition is met for the specific platform

  • [Array] conditions - Default platform conditions (All platforms that have no specific configurations)

    • value - Value when no Condition is met (for the Default platform)

Boolean flags default is false. String, Number, and uninitialized flags default is null, which means the default value in the code will be used.

Condition schema

  • value - The value when the Condition is met

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

    • String dependency.flag - Flag name

  • dependency.value - The Flag dependent on’s value

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

    • String group.operator - The logical relationship between the groups

    • Array group.name - Name of target groups

  • Object version - Condition flag value based release version

    • String version.operator - The operator to compare version

    • String version.semver - The version to compare to

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

    • String property.name - Name of a custom property

    • String property.operator - The operator to use on the property

    • String/Array/Number/Boolean property.operand - The operand to evaluate the operator with (value to compare with the custom property)

Flags calls

Get Flag

Returns a single flag by name

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

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',
  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 \
  --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")

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"

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")
  .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");
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"

	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

Flag response

200 with the flag as body, same structure as described for a single flag in the Get Flags Example 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: Array of Flag schema

Create flag

Add a new flag to all environments.

Creatie Flag schema

  • String name - The flag’s name

  • availableValues - The available values that this flag can be (defaults to [true, false]), either array of number, or array of string

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 Flag schema (name + availableValues)

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

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',
  headers: {
    'content-type': 'application/json',
    authorization: 'Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6'
  },
  body: {
    name: 'acmeFlagControl',
    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 \
  --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 = "{\"name\":\"acmeFlagControl\",\"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"

payload = "{\"name\":\"acmeFlagControl\",\"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, "{\"name\":\"acmeFlagControl\",\"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")
  .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");
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\",\"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"

	payload := strings.NewReader("{\"name\":\"acmeFlagControl\",\"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

BODY PARAMS

  • Flag scehma object

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

  • op string - The operation to be performed (one of add, remove, replace, move, copy, test)

  • path string - Path to the value that is to be changed. Ex: path: value is like saying flag.value

  • value string - The value to be used within the operations

  • from string - A string containing a JSON Pointer value

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