curl --request PATCH \
--url https://app.launchdarkly.com/api/v2/projects/{projectKey}/agent-graphs/{graphKey} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'LD-API-Version: <ld-api-version>' \
--data '
{
"maintainerId": "507f1f77bcf86cd799439011",
"rootConfigKey": "rootConfigKey",
"name": "name",
"maintainerTeamKey": "example-team-key",
"edges": [
{
"sourceConfig": "sourceConfig",
"targetConfig": "targetConfig",
"handoff": "{}",
"key": "key"
},
{
"sourceConfig": "sourceConfig",
"targetConfig": "targetConfig",
"handoff": "{}",
"key": "key"
}
],
"description": "description"
}
'import requests
url = "https://app.launchdarkly.com/api/v2/projects/{projectKey}/agent-graphs/{graphKey}"
payload = {
"maintainerId": "507f1f77bcf86cd799439011",
"rootConfigKey": "rootConfigKey",
"name": "name",
"maintainerTeamKey": "example-team-key",
"edges": [
{
"sourceConfig": "sourceConfig",
"targetConfig": "targetConfig",
"handoff": "{}",
"key": "key"
},
{
"sourceConfig": "sourceConfig",
"targetConfig": "targetConfig",
"handoff": "{}",
"key": "key"
}
],
"description": "description"
}
headers = {
"LD-API-Version": "<ld-api-version>",
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'LD-API-Version': '<ld-api-version>',
Authorization: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
maintainerId: '507f1f77bcf86cd799439011',
rootConfigKey: 'rootConfigKey',
name: 'name',
maintainerTeamKey: 'example-team-key',
edges: [
{
sourceConfig: 'sourceConfig',
targetConfig: 'targetConfig',
handoff: '{}',
key: 'key'
},
{
sourceConfig: 'sourceConfig',
targetConfig: 'targetConfig',
handoff: '{}',
key: 'key'
}
],
description: 'description'
})
};
fetch('https://app.launchdarkly.com/api/v2/projects/{projectKey}/agent-graphs/{graphKey}', 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/projects/{projectKey}/agent-graphs/{graphKey}",
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([
'maintainerId' => '507f1f77bcf86cd799439011',
'rootConfigKey' => 'rootConfigKey',
'name' => 'name',
'maintainerTeamKey' => 'example-team-key',
'edges' => [
[
'sourceConfig' => 'sourceConfig',
'targetConfig' => 'targetConfig',
'handoff' => '{}',
'key' => 'key'
],
[
'sourceConfig' => 'sourceConfig',
'targetConfig' => 'targetConfig',
'handoff' => '{}',
'key' => 'key'
]
],
'description' => 'description'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json",
"LD-API-Version: <ld-api-version>"
],
]);
$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/projects/{projectKey}/agent-graphs/{graphKey}"
payload := strings.NewReader("{\n \"maintainerId\": \"507f1f77bcf86cd799439011\",\n \"rootConfigKey\": \"rootConfigKey\",\n \"name\": \"name\",\n \"maintainerTeamKey\": \"example-team-key\",\n \"edges\": [\n {\n \"sourceConfig\": \"sourceConfig\",\n \"targetConfig\": \"targetConfig\",\n \"handoff\": \"{}\",\n \"key\": \"key\"\n },\n {\n \"sourceConfig\": \"sourceConfig\",\n \"targetConfig\": \"targetConfig\",\n \"handoff\": \"{}\",\n \"key\": \"key\"\n }\n ],\n \"description\": \"description\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("LD-API-Version", "<ld-api-version>")
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/projects/{projectKey}/agent-graphs/{graphKey}")
.header("LD-API-Version", "<ld-api-version>")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"maintainerId\": \"507f1f77bcf86cd799439011\",\n \"rootConfigKey\": \"rootConfigKey\",\n \"name\": \"name\",\n \"maintainerTeamKey\": \"example-team-key\",\n \"edges\": [\n {\n \"sourceConfig\": \"sourceConfig\",\n \"targetConfig\": \"targetConfig\",\n \"handoff\": \"{}\",\n \"key\": \"key\"\n },\n {\n \"sourceConfig\": \"sourceConfig\",\n \"targetConfig\": \"targetConfig\",\n \"handoff\": \"{}\",\n \"key\": \"key\"\n }\n ],\n \"description\": \"description\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/projects/{projectKey}/agent-graphs/{graphKey}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["LD-API-Version"] = '<ld-api-version>'
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"maintainerId\": \"507f1f77bcf86cd799439011\",\n \"rootConfigKey\": \"rootConfigKey\",\n \"name\": \"name\",\n \"maintainerTeamKey\": \"example-team-key\",\n \"edges\": [\n {\n \"sourceConfig\": \"sourceConfig\",\n \"targetConfig\": \"targetConfig\",\n \"handoff\": \"{}\",\n \"key\": \"key\"\n },\n {\n \"sourceConfig\": \"sourceConfig\",\n \"targetConfig\": \"targetConfig\",\n \"handoff\": \"{}\",\n \"key\": \"key\"\n }\n ],\n \"description\": \"description\"\n}"
response = http.request(request)
puts response.read_body{
"createdAt": 0,
"_maintainer": {
"kind": "kind"
},
"_access": {
"allowed": [
{
"reason": {
"role_name": "role_name",
"notActions": [
null,
null
],
"notResources": [
"notResources",
"notResources"
],
"effect": "allow",
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"actions": [
"*"
]
},
"action": "action"
},
{
"reason": {
"role_name": "role_name",
"notActions": [
null,
null
],
"notResources": [
"notResources",
"notResources"
],
"effect": "allow",
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"actions": [
"*"
]
},
"action": "action"
}
],
"denied": [
{
"reason": {
"role_name": "role_name",
"notActions": [
null,
null
],
"notResources": [
"notResources",
"notResources"
],
"effect": "allow",
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"actions": [
"*"
]
},
"action": "action"
},
{
"reason": {
"role_name": "role_name",
"notActions": [
null,
null
],
"notResources": [
"notResources",
"notResources"
],
"effect": "allow",
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"actions": [
"*"
]
},
"action": "action"
}
]
},
"rootConfigKey": "rootConfigKey",
"_site": {
"href": "href",
"type": "type"
},
"name": "name",
"edges": [
{
"sourceConfig": "sourceConfig",
"targetConfig": "targetConfig",
"handoff": "{}",
"key": "key"
},
{
"sourceConfig": "sourceConfig",
"targetConfig": "targetConfig",
"handoff": "{}",
"key": "key"
}
],
"description": "description",
"key": "key",
"updatedAt": 6
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}Update agent graph
Edit an existing agent graph.
The request body must be a JSON object of the fields to update. The values you include replace the existing values for the fields.
If the update includes rootConfigKey or edges, both must be present and will be treated as full replacements.
curl --request PATCH \
--url https://app.launchdarkly.com/api/v2/projects/{projectKey}/agent-graphs/{graphKey} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'LD-API-Version: <ld-api-version>' \
--data '
{
"maintainerId": "507f1f77bcf86cd799439011",
"rootConfigKey": "rootConfigKey",
"name": "name",
"maintainerTeamKey": "example-team-key",
"edges": [
{
"sourceConfig": "sourceConfig",
"targetConfig": "targetConfig",
"handoff": "{}",
"key": "key"
},
{
"sourceConfig": "sourceConfig",
"targetConfig": "targetConfig",
"handoff": "{}",
"key": "key"
}
],
"description": "description"
}
'import requests
url = "https://app.launchdarkly.com/api/v2/projects/{projectKey}/agent-graphs/{graphKey}"
payload = {
"maintainerId": "507f1f77bcf86cd799439011",
"rootConfigKey": "rootConfigKey",
"name": "name",
"maintainerTeamKey": "example-team-key",
"edges": [
{
"sourceConfig": "sourceConfig",
"targetConfig": "targetConfig",
"handoff": "{}",
"key": "key"
},
{
"sourceConfig": "sourceConfig",
"targetConfig": "targetConfig",
"handoff": "{}",
"key": "key"
}
],
"description": "description"
}
headers = {
"LD-API-Version": "<ld-api-version>",
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'LD-API-Version': '<ld-api-version>',
Authorization: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
maintainerId: '507f1f77bcf86cd799439011',
rootConfigKey: 'rootConfigKey',
name: 'name',
maintainerTeamKey: 'example-team-key',
edges: [
{
sourceConfig: 'sourceConfig',
targetConfig: 'targetConfig',
handoff: '{}',
key: 'key'
},
{
sourceConfig: 'sourceConfig',
targetConfig: 'targetConfig',
handoff: '{}',
key: 'key'
}
],
description: 'description'
})
};
fetch('https://app.launchdarkly.com/api/v2/projects/{projectKey}/agent-graphs/{graphKey}', 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/projects/{projectKey}/agent-graphs/{graphKey}",
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([
'maintainerId' => '507f1f77bcf86cd799439011',
'rootConfigKey' => 'rootConfigKey',
'name' => 'name',
'maintainerTeamKey' => 'example-team-key',
'edges' => [
[
'sourceConfig' => 'sourceConfig',
'targetConfig' => 'targetConfig',
'handoff' => '{}',
'key' => 'key'
],
[
'sourceConfig' => 'sourceConfig',
'targetConfig' => 'targetConfig',
'handoff' => '{}',
'key' => 'key'
]
],
'description' => 'description'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json",
"LD-API-Version: <ld-api-version>"
],
]);
$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/projects/{projectKey}/agent-graphs/{graphKey}"
payload := strings.NewReader("{\n \"maintainerId\": \"507f1f77bcf86cd799439011\",\n \"rootConfigKey\": \"rootConfigKey\",\n \"name\": \"name\",\n \"maintainerTeamKey\": \"example-team-key\",\n \"edges\": [\n {\n \"sourceConfig\": \"sourceConfig\",\n \"targetConfig\": \"targetConfig\",\n \"handoff\": \"{}\",\n \"key\": \"key\"\n },\n {\n \"sourceConfig\": \"sourceConfig\",\n \"targetConfig\": \"targetConfig\",\n \"handoff\": \"{}\",\n \"key\": \"key\"\n }\n ],\n \"description\": \"description\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("LD-API-Version", "<ld-api-version>")
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/projects/{projectKey}/agent-graphs/{graphKey}")
.header("LD-API-Version", "<ld-api-version>")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"maintainerId\": \"507f1f77bcf86cd799439011\",\n \"rootConfigKey\": \"rootConfigKey\",\n \"name\": \"name\",\n \"maintainerTeamKey\": \"example-team-key\",\n \"edges\": [\n {\n \"sourceConfig\": \"sourceConfig\",\n \"targetConfig\": \"targetConfig\",\n \"handoff\": \"{}\",\n \"key\": \"key\"\n },\n {\n \"sourceConfig\": \"sourceConfig\",\n \"targetConfig\": \"targetConfig\",\n \"handoff\": \"{}\",\n \"key\": \"key\"\n }\n ],\n \"description\": \"description\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/projects/{projectKey}/agent-graphs/{graphKey}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["LD-API-Version"] = '<ld-api-version>'
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"maintainerId\": \"507f1f77bcf86cd799439011\",\n \"rootConfigKey\": \"rootConfigKey\",\n \"name\": \"name\",\n \"maintainerTeamKey\": \"example-team-key\",\n \"edges\": [\n {\n \"sourceConfig\": \"sourceConfig\",\n \"targetConfig\": \"targetConfig\",\n \"handoff\": \"{}\",\n \"key\": \"key\"\n },\n {\n \"sourceConfig\": \"sourceConfig\",\n \"targetConfig\": \"targetConfig\",\n \"handoff\": \"{}\",\n \"key\": \"key\"\n }\n ],\n \"description\": \"description\"\n}"
response = http.request(request)
puts response.read_body{
"createdAt": 0,
"_maintainer": {
"kind": "kind"
},
"_access": {
"allowed": [
{
"reason": {
"role_name": "role_name",
"notActions": [
null,
null
],
"notResources": [
"notResources",
"notResources"
],
"effect": "allow",
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"actions": [
"*"
]
},
"action": "action"
},
{
"reason": {
"role_name": "role_name",
"notActions": [
null,
null
],
"notResources": [
"notResources",
"notResources"
],
"effect": "allow",
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"actions": [
"*"
]
},
"action": "action"
}
],
"denied": [
{
"reason": {
"role_name": "role_name",
"notActions": [
null,
null
],
"notResources": [
"notResources",
"notResources"
],
"effect": "allow",
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"actions": [
"*"
]
},
"action": "action"
},
{
"reason": {
"role_name": "role_name",
"notActions": [
null,
null
],
"notResources": [
"notResources",
"notResources"
],
"effect": "allow",
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"actions": [
"*"
]
},
"action": "action"
}
]
},
"rootConfigKey": "rootConfigKey",
"_site": {
"href": "href",
"type": "type"
},
"name": "name",
"edges": [
{
"sourceConfig": "sourceConfig",
"targetConfig": "targetConfig",
"handoff": "{}",
"key": "key"
},
{
"sourceConfig": "sourceConfig",
"targetConfig": "targetConfig",
"handoff": "{}",
"key": "key"
}
],
"description": "description",
"key": "key",
"updatedAt": 6
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}Authorizations
Headers
Version of the endpoint.
beta Body
Agent graph object to update
Request body for updating an agent graph. If rootConfigKey or edges are present, both must be present.
A human-readable name for the agent graph
A description of the agent graph
The ID of the member who maintains this agent graph. Pass an empty string to remove maintainer.
"507f1f77bcf86cd799439011"
The key of the team that maintains this agent graph. Pass an empty string to remove maintainer.
"example-team-key"
The config key of the root node. If present, edges must also be present.
The edges in the graph. If present, rootConfigKey must also be present. Replaces all existing edges.
Show child attributes
Show child attributes
Response
Agent graph updated
An agent graph representing a directed graph of configs
A unique key for the agent graph
A human-readable name for the agent graph
Show child attributes
Show child attributes
{ "allowed": [ { "reason": { "role_name": "role_name", "notActions": [null, null], "notResources": ["notResources", "notResources"], "effect": "allow", "resources": ["proj/*:env/*;qa_*:/flag/*"], "actions": ["*"] }, "action": "action" }, { "reason": { "role_name": "role_name", "notActions": [null, null], "notResources": ["notResources", "notResources"], "effect": "allow", "resources": ["proj/*:env/*;qa_*:/flag/*"], "actions": ["*"] }, "action": "action" } ], "denied": [ { "reason": { "role_name": "role_name", "notActions": [null, null], "notResources": ["notResources", "notResources"], "effect": "allow", "resources": ["proj/*:env/*;qa_*:/flag/*"], "actions": ["*"] }, "action": "action" }, { "reason": { "role_name": "role_name", "notActions": [null, null], "notResources": ["notResources", "notResources"], "effect": "allow", "resources": ["proj/*:env/*;qa_*:/flag/*"], "actions": ["*"] }, "action": "action" } ] }
Show child attributes
Show child attributes
{ "href": "href", "type": "type" }
A description of the agent graph
- Option 1
- Option 2
Show child attributes
Show child attributes
{ "kind": "kind" }
The config key of the root node
The edges in the graph
Show child attributes
Show child attributes