---
title: "Update a knowledge graph edge"
method: PATCH
path: "/knowledgeGraph/edges/{edge_id}"
tags: ["KnowledgeGraph"]
---

# Update a knowledge graph edge

`PATCH /knowledgeGraph/edges/{edge_id}`

Updates mutable fields of a knowledge graph edge (ordinal, weight, description, properties). Immutable fields (source_node_id, destination_node_id, label, created_at) are rejected with 400. Mandatory If-Match header. source_node_id is required for PK-aligned lookup.

## Path parameters

- `edge_id` string, required

## Query parameters

- `workspace_id` string, required
- `application_id` string
- `source_node_id` string, required

## Headers

- `If-Match` string

## Request body

- UpdateKnowledgeGraphEdgeRequest — Request body for updating a knowledge graph edge (ordinal, weight, description, properties, agent metadata only). PATCH uses merge semantics: only fields present in the request body with a non-null value are updated; fields that are absent or explicitly null are preserved at their existing stored value. Immutable identity fields (workspace_id, edge_id, source_node_id, destination_node_id, label) cannot be changed via PATCH.
  - `ordinal` integer — Updated ordering hint (preserves existing value if absent or null)
  - `weight` number, double — Updated edge weight (preserves existing value if absent or null)
  - `description` string — Updated relationship description (preserves existing value if absent or null)
  - `properties` object — Updated additional structured properties (preserves existing value if absent or null)
  - `agent_type` string — Agent type performing the update (preserves existing value if absent or null)
  - `agent_version` string — Agent version performing the update (preserves existing value if absent or null)

## Response `200`

The updated edge

- KnowledgeGraphEdge — A directed edge in the knowledge graph connecting two nodes
  - `edge_id` string — Unique identifier for the edge (server-generated, suffix -kge)
  - `workspace_id` string — The workspace this edge belongs to
  - `source_node_id` string — The source node ID
  - `destination_node_id` string — The destination node ID
  - `label` 'CONTAINS' | 'HAS_KNOWLEDGE' | 'DEPENDS_ON' | 'RELATED_TO' | 'COVERS' — Label for a knowledge graph edge indicating its relationship type
  - `ordinal` integer — Ordering hint for sibling edges
  - `weight` number, double — Edge weight (0.0-1.0)
  - `description` string — Human-readable description of this relationship
  - `properties` object — Additional structured properties for this edge
  - `version` integer — Monotonic edit counter (server-managed, readOnly)
  - `u_version_` string — ETag for optimistic locking (server-managed, readOnly)
  - `last_updated_by` string — Principal who last updated this edge (server-managed, readOnly)
  - `created_by` string — Principal who created this edge (server-managed, readOnly)
  - `agent_type` string — Agent type that wrote this edge
  - `agent_version` string — Agent version that wrote this edge
  - `created_at` string, date-time — Creation timestamp
  - `updated_at` string, date-time — Last update timestamp

## Other responses

- `400` — Invalid or missing parameter
- `401` — User not authenticated
- `403` — User not authorized
- `404` — Entity not found
- `412` — Unknown error
- `428` — Unknown error
- `default` — Unknown error

---

[API](https://skmtc.net/mabl/apis/mabl-api.md) · [All operations](https://skmtc.net/mabl/apis/mabl-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mabl/mabl-api/revisions/d0fc0114da66/schema)
