---
title: "Update Graph"
method: POST
path: "/v1/projects/{project_id}/graph/update"
tags: ["projects"]
---

# Update Graph

`POST /v1/projects/{project_id}/graph/update`

Update the project graph with new nodes and edges.

This is the primary endpoint for adding data to the project graph,
typically called after processing a chat message.

## Path parameters

- `project_id` string, uuid, required

## Request body

- GraphUpdateRequest
  - `message_id` string, uuid, nullable
  - `nodes` GraphNodeCreate[]
    - `key` string
    - `node_type` string, required
    - `name` string, required
    - `properties` object
    - `ukl_ref` string, nullable
  - `edges` GraphEdgeCreate[]
    - `from_key` string, required
    - `to_key` string, required
    - `rel_type` string, required
    - `properties` object
  - `ukl_refs` UklRefCreate[]
    - `prj_key` string, required
    - `ukl_key` string, required
    - `ref_type` string

## Response `200`

Successful Response

- GraphUpdateResponse
  - `nodes_created` integer, required
  - `edges_created` integer, required
  - `refs_created` integer, required
  - `node_keys` string[], required

## Other responses

- `422` — Validation Error

---

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