Unlink a feature from a Contextual Bandit
Removes every contextual-bandit-ref rule pointing at this contextual bandit from the feature and drops the feature from the bandit’s linked-feature list. The rule removal lands in a draft revision unless autoPublish is set. When the feature has no such rule left, only the linkage is cleared.
DELETE
/
v1
/
contextual-bandits
/
{id}
/
linked-feature
/
{featureId}
cURL
curl -X DELETE 'https://api.growthbook.io/api/v1/contextual-bandits/{id}/linked-feature/{featureId}' \
-H 'Authorization: Bearer YOUR_API_KEY'import requests
url = "https://api.growthbook.io/api/v1/contextual-bandits/{id}/linked-feature/{featureId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.growthbook.io/api/v1/contextual-bandits/{id}/linked-feature/{featureId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.growthbook.io/api/v1/contextual-bandits/{id}/linked-feature/{featureId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.growthbook.io/api/v1/contextual-bandits/{id}/linked-feature/{featureId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.growthbook.io/api/v1/contextual-bandits/{id}/linked-feature/{featureId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.growthbook.io/api/v1/contextual-bandits/{id}/linked-feature/{featureId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"featureId": "<string>",
"removedRuleIds": [
"<string>"
],
"revisionVersion": 123,
"published": true
}Authorizations
bearerAuthbasicAuth
If using Bearer auth, pass the Secret Key as the token:
curl https://api.growthbook.io/api/v1/features -H "Authorization: Bearer secret_abc123DEF456"
Path Parameters
The Contextual Bandit id
The linked feature id
Query Parameters
Publish the resulting revision immediately instead of leaving it as a draft.
Allowed value:
"true"Remove the rule from this existing draft revision instead of live. Required when the rule hasn't been published yet — omitting it targets the live revision, which has nothing to remove.
Was this page helpful?
⌘I
cURL
curl -X DELETE 'https://api.growthbook.io/api/v1/contextual-bandits/{id}/linked-feature/{featureId}' \
-H 'Authorization: Bearer YOUR_API_KEY'import requests
url = "https://api.growthbook.io/api/v1/contextual-bandits/{id}/linked-feature/{featureId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.growthbook.io/api/v1/contextual-bandits/{id}/linked-feature/{featureId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.growthbook.io/api/v1/contextual-bandits/{id}/linked-feature/{featureId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.growthbook.io/api/v1/contextual-bandits/{id}/linked-feature/{featureId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.growthbook.io/api/v1/contextual-bandits/{id}/linked-feature/{featureId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.growthbook.io/api/v1/contextual-bandits/{id}/linked-feature/{featureId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"featureId": "<string>",
"removedRuleIds": [
"<string>"
],
"revisionVersion": 123,
"published": true
}
