Update flag link
For the complete documentation index, see llms.txt. For the full documentation snapshot, see llms-full.txt.
Update a flag link. Updating a flag link uses a JSON patch representation of the desired changes. To learn more, read Updates.
curl --request PATCH \
--url https://app.launchdarkly.com/api/v2/flag-links/projects/{projectKey}/flags/{featureFlagKey}/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
[
{
"op": "replace",
"path": "/title",
"value": "Updated flag link title"
}
]
'import requests
url = "https://app.launchdarkly.com/api/v2/flag-links/projects/{projectKey}/flags/{featureFlagKey}/{id}"
payload = [
{
"op": "replace",
"path": "/title",
"value": "Updated flag link title"
}
]
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify([{op: 'replace', path: '/title', value: 'Updated flag link title'}])
};
fetch('https://app.launchdarkly.com/api/v2/flag-links/projects/{projectKey}/flags/{featureFlagKey}/{id}', 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://app.launchdarkly.com/api/v2/flag-links/projects/{projectKey}/flags/{featureFlagKey}/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
[
'op' => 'replace',
'path' => '/title',
'value' => 'Updated flag link title'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.launchdarkly.com/api/v2/flag-links/projects/{projectKey}/flags/{featureFlagKey}/{id}"
payload := strings.NewReader("[\n {\n \"op\": \"replace\",\n \"path\": \"/title\",\n \"value\": \"Updated flag link title\"\n }\n]")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://app.launchdarkly.com/api/v2/flag-links/projects/{projectKey}/flags/{featureFlagKey}/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"op\": \"replace\",\n \"path\": \"/title\",\n \"value\": \"Updated flag link title\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/flag-links/projects/{projectKey}/flags/{featureFlagKey}/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"op\": \"replace\",\n \"path\": \"/title\",\n \"value\": \"Updated flag link title\"\n }\n]"
response = http.request(request)
puts response.read_body{
"_links": {},
"_id": "1234a56b7c89d012345e678f",
"_deepLink": "https://example.com/archives/123123123",
"_timestamp": "{\"milliseconds\": 1655342199935, \"seconds\": 1655342199, \"rfc3339\": \"2022-06-16T01:16:39Z\", \"simple\": \"2022-06-16 01:16:39\"}",
"_createdAt": "1654104600000",
"_key": "flag-link-key-123abc",
"_integrationKey": "<string>",
"title": "Example link title",
"description": "Example link description",
"_metadata": {},
"_member": {
"_links": {},
"_id": "<string>",
"firstName": "<string>",
"lastName": "<string>"
}
}{
"code": "invalid_request",
"message": "Invalid request body"
}{
"code": "unauthorized",
"message": "Invalid access token"
}{
"code": "forbidden",
"message": "Forbidden. Access to the requested resource was denied."
}{
"code": "not_found",
"message": "Invalid resource identifier"
}{
"code": "optimistic_locking_error",
"message": "Conflict. Optimistic lock error. Try again later."
}{
"code": "rate_limited",
"message": "You've exceeded the API rate limit. Try again later."
}Authorizations
Path Parameters
The project key
The feature flag key
The flag link ID
Body
Response
Flag link response
The location and content type of related resources
Show child attributes
Show child attributes
The ID of this flag link
"1234a56b7c89d012345e678f"
The URL for the external resource the flag is linked to
"https://example.com/archives/123123123"
The time to mark this flag link as associated with the external URL. Defaults to the creation time of the flag link, but can be set to another time during creation.
Show child attributes
Show child attributes
"{\"milliseconds\": 1655342199935, \"seconds\": 1655342199, \"rfc3339\": \"2022-06-16T01:16:39Z\", \"simple\": \"2022-06-16 01:16:39\"}"
Timestamp of when the flag link was created
"1654104600000"
The flag link key
"flag-link-key-123abc"
The integration key for an integration whose manifest.json includes the flagLink capability, if this is a flag link for an existing integration
The title of the flag link
"Example link title"
The description of the flag link
"Example link description"
The metadata required by this integration in order to create a flag link, if this is a flag link for an existing integration. Defined in the integration's manifest.json file under flagLink.
Show child attributes
Show child attributes
Details on the member associated with this flag link
Show child attributes
Show child attributes
curl --request PATCH \
--url https://app.launchdarkly.com/api/v2/flag-links/projects/{projectKey}/flags/{featureFlagKey}/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
[
{
"op": "replace",
"path": "/title",
"value": "Updated flag link title"
}
]
'import requests
url = "https://app.launchdarkly.com/api/v2/flag-links/projects/{projectKey}/flags/{featureFlagKey}/{id}"
payload = [
{
"op": "replace",
"path": "/title",
"value": "Updated flag link title"
}
]
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify([{op: 'replace', path: '/title', value: 'Updated flag link title'}])
};
fetch('https://app.launchdarkly.com/api/v2/flag-links/projects/{projectKey}/flags/{featureFlagKey}/{id}', 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://app.launchdarkly.com/api/v2/flag-links/projects/{projectKey}/flags/{featureFlagKey}/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
[
'op' => 'replace',
'path' => '/title',
'value' => 'Updated flag link title'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.launchdarkly.com/api/v2/flag-links/projects/{projectKey}/flags/{featureFlagKey}/{id}"
payload := strings.NewReader("[\n {\n \"op\": \"replace\",\n \"path\": \"/title\",\n \"value\": \"Updated flag link title\"\n }\n]")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://app.launchdarkly.com/api/v2/flag-links/projects/{projectKey}/flags/{featureFlagKey}/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"op\": \"replace\",\n \"path\": \"/title\",\n \"value\": \"Updated flag link title\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/flag-links/projects/{projectKey}/flags/{featureFlagKey}/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"op\": \"replace\",\n \"path\": \"/title\",\n \"value\": \"Updated flag link title\"\n }\n]"
response = http.request(request)
puts response.read_body{
"_links": {},
"_id": "1234a56b7c89d012345e678f",
"_deepLink": "https://example.com/archives/123123123",
"_timestamp": "{\"milliseconds\": 1655342199935, \"seconds\": 1655342199, \"rfc3339\": \"2022-06-16T01:16:39Z\", \"simple\": \"2022-06-16 01:16:39\"}",
"_createdAt": "1654104600000",
"_key": "flag-link-key-123abc",
"_integrationKey": "<string>",
"title": "Example link title",
"description": "Example link description",
"_metadata": {},
"_member": {
"_links": {},
"_id": "<string>",
"firstName": "<string>",
"lastName": "<string>"
}
}{
"code": "invalid_request",
"message": "Invalid request body"
}{
"code": "unauthorized",
"message": "Invalid access token"
}{
"code": "forbidden",
"message": "Forbidden. Access to the requested resource was denied."
}{
"code": "not_found",
"message": "Invalid resource identifier"
}{
"code": "optimistic_locking_error",
"message": "Conflict. Optimistic lock error. Try again later."
}{
"code": "rate_limited",
"message": "You've exceeded the API rate limit. Try again later."
}