> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ontora.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Graph

> 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.



## OpenAPI

````yaml /openapi.json post /v1/projects/{project_id}/graph/update
openapi: 3.1.0
info:
  title: Ontora API
  description: >-
    Ontora's public API. Covers interview campaigns, transcripts, synthesis
    reports, graph queries, webhooks, and workspace management. 


    **Authentication**: endpoints accept either a Clerk JWT (`Authorization:
    Bearer <token>`) or a workspace API key (`X-API-Key: ont_...`). Workspace
    keys are managed via `/v1/api-keys`.
  version: 0.1.0
servers: []
security:
  - ClerkJWT: []
  - WorkspaceApiKey: []
tags:
  - name: interviews
    description: Campaign CRUD, lifecycle, contacts, question sets.
  - name: campaign-insights
    description: Synthesis outputs — cartography, roadmap, personas, conversations.
  - name: interview-query
    description: Graph RAG query over campaign data.
  - name: interview-export
    description: Markdown / ZIP exports of transcripts and reports.
  - name: api-keys
    description: Manage workspace-scoped API keys for programmatic access.
  - name: webhook-endpoints
    description: Outbound webhook endpoints for automation.
  - name: booking
    description: Public self-scheduling endpoints for interview participants.
  - name: workspaces
    description: Workspace and membership management.
  - name: vaults
    description: Context vault management.
paths:
  /v1/projects/{project_id}/graph/update:
    post:
      tags:
        - projects
      summary: Update Graph
      description: |-
        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.
      operationId: update_graph_v1_projects__project_id__graph_update_post
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Project Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GraphUpdateRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GraphUpdateResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    GraphUpdateRequest:
      properties:
        message_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Message Id
        nodes:
          items:
            $ref: '#/components/schemas/GraphNodeCreate'
          type: array
          title: Nodes
          default: []
        edges:
          items:
            $ref: '#/components/schemas/GraphEdgeCreate'
          type: array
          title: Edges
          default: []
        ukl_refs:
          items:
            $ref: '#/components/schemas/UklRefCreate'
          type: array
          title: Ukl Refs
          default: []
      type: object
      title: GraphUpdateRequest
    GraphUpdateResponse:
      properties:
        nodes_created:
          type: integer
          title: Nodes Created
        edges_created:
          type: integer
          title: Edges Created
        refs_created:
          type: integer
          title: Refs Created
        node_keys:
          items:
            type: string
          type: array
          title: Node Keys
      type: object
      required:
        - nodes_created
        - edges_created
        - refs_created
        - node_keys
      title: GraphUpdateResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    GraphNodeCreate:
      properties:
        key:
          type: string
          title: Key
          default: auto
        node_type:
          type: string
          title: Node Type
        name:
          type: string
          title: Name
        properties:
          additionalProperties: true
          type: object
          title: Properties
          default: {}
        ukl_ref:
          anyOf:
            - type: string
            - type: 'null'
          title: Ukl Ref
      type: object
      required:
        - node_type
        - name
      title: GraphNodeCreate
    GraphEdgeCreate:
      properties:
        from_key:
          type: string
          title: From Key
        to_key:
          type: string
          title: To Key
        rel_type:
          type: string
          title: Rel Type
        properties:
          additionalProperties: true
          type: object
          title: Properties
          default: {}
      type: object
      required:
        - from_key
        - to_key
        - rel_type
      title: GraphEdgeCreate
    UklRefCreate:
      properties:
        prj_key:
          type: string
          title: Prj Key
        ukl_key:
          type: string
          title: Ukl Key
        ref_type:
          type: string
          title: Ref Type
          default: references
      type: object
      required:
        - prj_key
        - ukl_key
      title: UklRefCreate
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ClerkJWT:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Clerk-issued RS256 JWT.
    WorkspaceApiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: 'Workspace-scoped API key (prefix: `ont_`).'
    HTTPBearer:
      type: http
      scheme: bearer

````