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

# Create Message

> Create a new chat message in a session.

If graph_delta is provided, the corresponding PRJ nodes/edges will be
created in the project graph.



## OpenAPI

````yaml /openapi.json post /v1/projects/{project_id}/chat/sessions/{session_id}/messages
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}/chat/sessions/{session_id}/messages:
    post:
      tags:
        - chat
      summary: Create Message
      description: |-
        Create a new chat message in a session.

        If graph_delta is provided, the corresponding PRJ nodes/edges will be
        created in the project graph.
      operationId: >-
        create_message_v1_projects__project_id__chat_sessions__session_id__messages_post
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Project Id
        - name: session_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Session Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatMessageCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatMessageOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    ChatMessageCreate:
      properties:
        role:
          type: string
          title: Role
        content:
          type: string
          title: Content
        parts_json:
          anyOf:
            - items: {}
              type: array
            - type: 'null'
          title: Parts Json
        context_vault_ids_used:
          anyOf:
            - items:
                type: string
                format: uuid
              type: array
            - type: 'null'
          title: Context Vault Ids Used
        graph_delta:
          anyOf:
            - $ref: '#/components/schemas/GraphDelta'
            - type: 'null'
      type: object
      required:
        - role
        - content
      title: ChatMessageCreate
    ChatMessageOut:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        session_id:
          type: string
          format: uuid
          title: Session Id
        role:
          type: string
          title: Role
        content:
          type: string
          title: Content
        parts_json:
          anyOf:
            - items: {}
              type: array
            - type: 'null'
          title: Parts Json
        context_vault_ids_used:
          anyOf:
            - items:
                type: string
                format: uuid
              type: array
            - type: 'null'
          title: Context Vault Ids Used
        graph_nodes_created:
          type: integer
          title: Graph Nodes Created
        graph_edges_created:
          type: integer
          title: Graph Edges Created
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - id
        - session_id
        - role
        - content
        - context_vault_ids_used
        - graph_nodes_created
        - graph_edges_created
        - created_at
      title: ChatMessageOut
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    GraphDelta:
      properties:
        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: GraphDelta
    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
    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
  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

````