---
title: "Update agent graph"
method: PATCH
path: "/api/v2/projects/{projectKey}/agent-graphs/{graphKey}"
tags: ["AI Configs"]
---

# Update agent graph

`PATCH /api/v2/projects/{projectKey}/agent-graphs/{graphKey}`

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.

## Path parameters

- `projectKey` string, required
- `graphKey` string, required

## Headers

- `LD-API-Version` 'beta', required

## Request body

- AgentGraphPatch — Request body for updating an agent graph. If rootConfigKey or edges are present, both must be present.
  - `name` string — A human-readable name for the agent graph
  - `description` string — A description of the agent graph
  - `maintainerId` string — The ID of the member who maintains this agent graph. Pass an empty string to remove maintainer.
  - `maintainerTeamKey` string — The key of the team that maintains this agent graph. Pass an empty string to remove maintainer.
  - `rootConfigKey` string — The AI Config key of the root node. If present, edges must also be present.
  - `edges` AgentGraphEdge[] — The edges in the graph. If present, rootConfigKey must also be present. Replaces all existing edges.
    - `key` string, required — A unique key for this edge within the graph
    - `sourceConfig` string, required — The AI Config key that is the source of this edge
    - `targetConfig` string, required — The AI Config key that is the target of this edge
    - `handoff` object — The handoff options from the source AI Config to the target AI Config

## Response `200`

Agent graph updated

- AgentGraph — An agent graph representing a directed graph of AI Configs
  - `_access` AiConfigsAccess
    - `denied` AiConfigsAccessDenied[], required
      - `action` string, required
      - `reason` AiConfigsAccessDeniedReason, required
        - `resources` string[] — Resource specifier strings
        - `notResources` string[] — Targeted resources are the resources NOT in this list. The <code>resources</code> and <code>notActions</code> fields must be empty to use this field.
        - `actions` ActionSpecifier[] — Actions to perform on a resource
        - `notActions` ActionSpecifier[] — Targeted actions are the actions NOT in this list. The <code>actions</code> and <code>notResources</code> fields must be empty to use this field.
        - `effect` 'allow' | 'deny', required — Whether this statement should allow or deny actions on the resources.
        - `role_name` string
    - `allowed` AiConfigsAccessAllowedRep[], required
      - `action` string, required
      - `reason` AiConfigsAccessAllowedReason, required
        - `resources` string[] — Resource specifier strings
        - `notResources` string[] — Targeted resources are the resources NOT in this list. The <code>resources</code> and <code>notActions</code> fields must be empty to use this field.
        - `actions` ActionSpecifier[] — Actions to perform on a resource
        - `notActions` ActionSpecifier[] — Targeted actions are the actions NOT in this list. The <code>actions</code> and <code>notResources</code> fields must be empty to use this field.
        - `effect` 'allow' | 'deny', required — Whether this statement should allow or deny actions on the resources.
        - `role_name` string
  - `key` string, required — A unique key for the agent graph
  - `name` string, required — A human-readable name for the agent graph
  - `description` string — A description of the agent graph
  - `_maintainer` union
    - object
      - `_id` string, required
      - `email` string, required
      - `firstName` string
      - `lastName` string
      - `role` string, required
      - `kind` string
    - object
      - `key` string, required
      - `name` string, required
      - `kind` string
  - `rootConfigKey` string — The AI Config key of the root node
  - `edges` AgentGraphEdge[] — The edges in the graph
    - `key` string, required — A unique key for this edge within the graph
    - `sourceConfig` string, required — The AI Config key that is the source of this edge
    - `targetConfig` string, required — The AI Config key that is the target of this edge
    - `handoff` object — The handoff options from the source AI Config to the target AI Config
  - `createdAt` integer, required
  - `updatedAt` integer, required

## Other responses

- `400` — Bad request
- `403` — Forbidden
- `404` — Not found
- `500` — Internal server error

## Changes

- **2026-02-28** `69c5c9aafe78` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/launchdarkly/apis/launchdarkly-rest-api/changes/api/v2/projects/:projectKey/agent-graphs/:graphKey/patch.md)

---

[API](https://skmtc.dev/launchdarkly/apis/launchdarkly-rest-api.md) · [All operations](https://skmtc.dev/launchdarkly/apis/launchdarkly-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/launchdarkly/launchdarkly-rest-api/revisions/69c5c9aafe78/schema)
