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

# Create Path

> Create a new



## OpenAPI

````yaml /api-reference/openapi.json post /v1/path/
openapi: 3.1.0
info:
  title: Diga API
  version: 0.1.0
servers:
  - url: https://api.diga.io
    description: Production
security: []
paths:
  /v1/path/:
    post:
      tags:
        - Conversational Paths
      summary: Create Path
      description: Create a new
      operationId: create_path_v1_path__post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePathRequestSchema'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PathResponseSchema'
        '400':
          description: Bad Parameter
          content:
            application/json:
              example:
                status: error
                error_code: BAD_PARAMETER
                message: Invalid parameter value provided
              schema:
                $ref: '#/components/schemas/ErrorResponseSchema'
        '403':
          description: Forbidden - Insufficient permissions
          content:
            application/json:
              example:
                status: error
                error_code: INTERNAL_SERVER_ERROR
                message: Missing required permissions
              schema:
                $ref: '#/components/schemas/ErrorResponseSchema'
        '404':
          description: Knowledge Base Not Found
          content:
            application/json:
              example:
                status: error
                error_code: KNOWLEDGE_BASE_NOT_FOUND
                message: Error from KnowledgeBaseNotFoundException
              schema:
                $ref: '#/components/schemas/ErrorResponseSchema'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              example:
                status: error
                error_code: INTERNAL_SERVER_ERROR
                message: 'Error: Internal Server Error'
              schema:
                $ref: '#/components/schemas/ErrorResponseSchema'
      security:
        - CustomHTTPBearer: []
components:
  schemas:
    CreatePathRequestSchema:
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Path Name
          description: The name of the path
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Path Description
          description: The description of the path
        global_prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: Global Prompt
          description: The global prompt for the path
        nodes:
          items:
            oneOf:
              - $ref: '#/components/schemas/StartNodeCreateSchema'
              - $ref: '#/components/schemas/ConversationNodeCreateSchema'
              - $ref: '#/components/schemas/EndNodeCreateSchema'
              - $ref: '#/components/schemas/ToolNodeCreateSchema'
              - $ref: '#/components/schemas/TransferNodeCreateSchema'
              - $ref: '#/components/schemas/FlowNodeCreateSchema'
            discriminator:
              propertyName: node_type
              mapping:
                conversation:
                  $ref: '#/components/schemas/ConversationNodeCreateSchema'
                end:
                  $ref: '#/components/schemas/EndNodeCreateSchema'
                flow:
                  $ref: '#/components/schemas/FlowNodeCreateSchema'
                start:
                  $ref: '#/components/schemas/StartNodeCreateSchema'
                tool:
                  $ref: '#/components/schemas/ToolNodeCreateSchema'
                transfer:
                  $ref: '#/components/schemas/TransferNodeCreateSchema'
          type: array
          title: Path Nodes
          description: The nodes in the path
      type: object
      required:
        - name
      title: CreatePathRequestSchema
      description: Request model for create or update path.
    PathResponseSchema:
      properties:
        id:
          type: string
          format: uuid
          title: Path ID
          description: Unique identifier for the path
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Path Name
          description: The name of the path
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Path Description
          description: The description of the path
        global_prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: Global Prompt
          description: The global prompt for the path
        nodes:
          items:
            oneOf:
              - $ref: '#/components/schemas/StartNodeResponseSchema'
              - $ref: '#/components/schemas/ConversationNodeResponseSchema'
              - $ref: '#/components/schemas/EndNodeResponseSchema'
              - $ref: '#/components/schemas/ToolNodeResponseSchema'
              - $ref: '#/components/schemas/TransferNodeResponseSchema'
              - $ref: '#/components/schemas/FlowNodeResponseSchema'
            discriminator:
              propertyName: node_type
              mapping:
                conversation:
                  $ref: '#/components/schemas/ConversationNodeResponseSchema'
                end:
                  $ref: '#/components/schemas/EndNodeResponseSchema'
                flow:
                  $ref: '#/components/schemas/FlowNodeResponseSchema'
                start:
                  $ref: '#/components/schemas/StartNodeResponseSchema'
                tool:
                  $ref: '#/components/schemas/ToolNodeResponseSchema'
                transfer:
                  $ref: '#/components/schemas/TransferNodeResponseSchema'
          type: array
          title: Path Nodes
          description: The nodes in the path
      type: object
      required:
        - id
        - name
        - nodes
      title: PathResponseSchema
      description: Response model for path
    ErrorResponseSchema:
      properties:
        status:
          type: string
          title: Status
          description: Status of the response, always 'error' for error responses
          default: error
        error_code:
          type: string
          title: Error Code
          description: Machine-readable error code in SCREAMING_SNAKE_CASE format
          examples:
            - PROJECT_NOT_FOUND
            - INVALID_EMAIL
            - UNAUTHORIZED_ROLE
        message:
          type: string
          title: Message
          description: Human-readable error message with details
          examples:
            - Project with id 550e8400-e29b-41d4-a716-446655440000 not found
            - The email invalid@email is not valid
            - Insufficient permissions to perform this action
      type: object
      required:
        - error_code
        - message
      title: ErrorResponseSchema
      description: Standard error response format for all API errors.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    StartNodeCreateSchema:
      properties:
        name:
          type: string
          title: Name
        node_type:
          type: string
          const: start
          title: Node Type
          default: start
        branches:
          anyOf:
            - items:
                $ref: '#/components/schemas/BranchCreateSchema'
              type: array
            - type: 'null'
          title: Branches
          default: []
        pos_x:
          anyOf:
            - type: number
            - type: 'null'
          title: Pos X
        pos_y:
          anyOf:
            - type: number
            - type: 'null'
          title: Pos Y
        is_global:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Global
          default: false
        global_condition:
          anyOf:
            - type: string
            - type: 'null'
          title: Global Condition
        wait_user:
          type: boolean
          title: Wait User
          default: false
        time_before_start:
          anyOf:
            - type: number
            - type: 'null'
          title: Time Before Start
      type: object
      required:
        - name
      title: StartNodeCreateSchema
    ConversationNodeCreateSchema:
      properties:
        name:
          type: string
          title: Name
        node_type:
          type: string
          const: conversation
          title: Node Type
          default: conversation
        branches:
          anyOf:
            - items:
                $ref: '#/components/schemas/BranchCreateSchema'
              type: array
            - type: 'null'
          title: Branches
          default: []
        pos_x:
          anyOf:
            - type: number
            - type: 'null'
          title: Pos X
        pos_y:
          anyOf:
            - type: number
            - type: 'null'
          title: Pos Y
        is_global:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Global
          default: false
        global_condition:
          anyOf:
            - type: string
            - type: 'null'
          title: Global Condition
        prompt:
          type: string
          title: Prompt
        fixed_prompt:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Fixed Prompt
          default: false
        cached_knowledge:
          anyOf:
            - type: string
            - type: 'null'
          title: Cached Knowledge
        knowledge_base_ids:
          anyOf:
            - items:
                type: string
                format: uuid
              type: array
            - type: 'null'
          title: Knowledge Base Ids
        knowledge_item_ids:
          anyOf:
            - items:
                type: string
                format: uuid
              type: array
            - type: 'null'
          title: Knowledge Item Ids
        skip_response:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Skip Response
        inherit_knowledge:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Inherit Knowledge
          default: true
      type: object
      required:
        - name
        - prompt
      title: ConversationNodeCreateSchema
    EndNodeCreateSchema:
      properties:
        name:
          type: string
          title: Name
        node_type:
          type: string
          const: end
          title: Node Type
          default: end
        branches:
          anyOf:
            - items:
                $ref: '#/components/schemas/BranchCreateSchema'
              type: array
            - type: 'null'
          title: Branches
          default: []
        pos_x:
          anyOf:
            - type: number
            - type: 'null'
          title: Pos X
        pos_y:
          anyOf:
            - type: number
            - type: 'null'
          title: Pos Y
        is_global:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Global
          default: false
        global_condition:
          anyOf:
            - type: string
            - type: 'null'
          title: Global Condition
      type: object
      required:
        - name
      title: EndNodeCreateSchema
    ToolNodeCreateSchema:
      properties:
        name:
          type: string
          title: Name
        node_type:
          type: string
          const: tool
          title: Node Type
          default: tool
        branches:
          anyOf:
            - items:
                $ref: '#/components/schemas/BranchCreateSchema'
              type: array
            - type: 'null'
          title: Branches
          default: []
        pos_x:
          anyOf:
            - type: number
            - type: 'null'
          title: Pos X
        pos_y:
          anyOf:
            - type: number
            - type: 'null'
          title: Pos Y
        is_global:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Global
          default: false
        global_condition:
          anyOf:
            - type: string
            - type: 'null'
          title: Global Condition
        integration_id:
          type: string
          format: uuid
          title: Integration Id
        tool_id:
          type: string
          format: uuid
          title: Tool Id
      type: object
      required:
        - name
        - integration_id
        - tool_id
      title: ToolNodeCreateSchema
    TransferNodeCreateSchema:
      properties:
        name:
          type: string
          title: Name
        node_type:
          type: string
          const: transfer
          title: Node Type
          default: transfer
        branches:
          anyOf:
            - items:
                $ref: '#/components/schemas/BranchCreateSchema'
              type: array
            - type: 'null'
          title: Branches
          default: []
        pos_x:
          anyOf:
            - type: number
            - type: 'null'
          title: Pos X
        pos_y:
          anyOf:
            - type: number
            - type: 'null'
          title: Pos Y
        is_global:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Global
          default: false
        global_condition:
          anyOf:
            - type: string
            - type: 'null'
          title: Global Condition
        phone_number:
          type: string
          title: Phone Number
      type: object
      required:
        - name
        - phone_number
      title: TransferNodeCreateSchema
    FlowNodeCreateSchema:
      properties:
        name:
          type: string
          title: Name
        node_type:
          type: string
          const: flow
          title: Node Type
          default: flow
        branches:
          anyOf:
            - items:
                $ref: '#/components/schemas/BranchCreateSchema'
              type: array
            - type: 'null'
          title: Branches
          default: []
        pos_x:
          anyOf:
            - type: number
            - type: 'null'
          title: Pos X
        pos_y:
          anyOf:
            - type: number
            - type: 'null'
          title: Pos Y
        is_global:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Global
          default: false
        global_condition:
          anyOf:
            - type: string
            - type: 'null'
          title: Global Condition
        flow_id:
          type: string
          title: Flow Id
      type: object
      required:
        - name
        - flow_id
      title: FlowNodeCreateSchema
    StartNodeResponseSchema:
      properties:
        name:
          type: string
          title: Name
        node_type:
          type: string
          const: start
          title: Node Type
          default: start
        branches:
          anyOf:
            - items:
                $ref: '#/components/schemas/BranchSchema'
              type: array
            - type: 'null'
          title: Branches
          default: []
        pos_x:
          anyOf:
            - type: number
            - type: 'null'
          title: Pos X
        pos_y:
          anyOf:
            - type: number
            - type: 'null'
          title: Pos Y
        is_global:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Global
          default: false
        global_condition:
          anyOf:
            - type: string
            - type: 'null'
          title: Global Condition
        wait_user:
          type: boolean
          title: Wait User
          default: false
        time_before_start:
          anyOf:
            - type: number
            - type: 'null'
          title: Time Before Start
      type: object
      required:
        - name
      title: StartNodeResponseSchema
      description: Defines a start node with all its properties.
    ConversationNodeResponseSchema:
      properties:
        name:
          type: string
          title: Name
        node_type:
          type: string
          const: conversation
          title: Node Type
          default: conversation
        branches:
          anyOf:
            - items:
                $ref: '#/components/schemas/BranchSchema'
              type: array
            - type: 'null'
          title: Branches
          default: []
        pos_x:
          anyOf:
            - type: number
            - type: 'null'
          title: Pos X
        pos_y:
          anyOf:
            - type: number
            - type: 'null'
          title: Pos Y
        is_global:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Global
          default: false
        global_condition:
          anyOf:
            - type: string
            - type: 'null'
          title: Global Condition
        prompt:
          type: string
          title: Prompt
        fixed_prompt:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Fixed Prompt
          default: false
        knowledge_base:
          anyOf:
            - items:
                type: string
                format: uuid
              type: array
            - type: 'null'
          title: Knowledge Base
        knowledge_item_ids:
          anyOf:
            - items:
                type: string
                format: uuid
              type: array
            - type: 'null'
          title: Knowledge Item Ids
        cached_knowledge:
          anyOf:
            - type: string
            - type: 'null'
          title: Cached Knowledge
        skip_response:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Skip Response
        inherit_knowledge:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Inherit Knowledge
          default: true
      type: object
      required:
        - name
        - prompt
      title: ConversationNodeResponseSchema
      description: Defines a conversation node/state with all its properties.
    EndNodeResponseSchema:
      properties:
        name:
          type: string
          title: Name
        node_type:
          type: string
          const: end
          title: Node Type
          default: end
        branches:
          anyOf:
            - items:
                $ref: '#/components/schemas/BranchSchema'
              type: array
            - type: 'null'
          title: Branches
          default: []
        pos_x:
          anyOf:
            - type: number
            - type: 'null'
          title: Pos X
        pos_y:
          anyOf:
            - type: number
            - type: 'null'
          title: Pos Y
        is_global:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Global
          default: false
        global_condition:
          anyOf:
            - type: string
            - type: 'null'
          title: Global Condition
      type: object
      required:
        - name
      title: EndNodeResponseSchema
      description: Defines an end node with all its properties.
    ToolNodeResponseSchema:
      properties:
        name:
          type: string
          title: Name
        node_type:
          type: string
          const: tool
          title: Node Type
          default: tool
        branches:
          anyOf:
            - items:
                $ref: '#/components/schemas/BranchSchema'
              type: array
            - type: 'null'
          title: Branches
          default: []
        pos_x:
          anyOf:
            - type: number
            - type: 'null'
          title: Pos X
        pos_y:
          anyOf:
            - type: number
            - type: 'null'
          title: Pos Y
        is_global:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Global
          default: false
        global_condition:
          anyOf:
            - type: string
            - type: 'null'
          title: Global Condition
        integration_id:
          type: string
          format: uuid
          title: Integration Id
        tool_id:
          type: string
          format: uuid
          title: Tool Id
      type: object
      required:
        - name
        - integration_id
        - tool_id
      title: ToolNodeResponseSchema
    TransferNodeResponseSchema:
      properties:
        name:
          type: string
          title: Name
        node_type:
          type: string
          const: transfer
          title: Node Type
          default: transfer
        branches:
          anyOf:
            - items:
                $ref: '#/components/schemas/BranchSchema'
              type: array
            - type: 'null'
          title: Branches
          default: []
        pos_x:
          anyOf:
            - type: number
            - type: 'null'
          title: Pos X
        pos_y:
          anyOf:
            - type: number
            - type: 'null'
          title: Pos Y
        is_global:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Global
          default: false
        global_condition:
          anyOf:
            - type: string
            - type: 'null'
          title: Global Condition
        phone_number:
          type: string
          title: Phone Number
      type: object
      required:
        - name
        - phone_number
      title: TransferNodeResponseSchema
      description: Defines a transfer call node with all its properties.
    FlowNodeResponseSchema:
      properties:
        name:
          type: string
          title: Name
        node_type:
          type: string
          const: flow
          title: Node Type
          default: flow
        branches:
          anyOf:
            - items:
                $ref: '#/components/schemas/BranchSchema'
              type: array
            - type: 'null'
          title: Branches
          default: []
        pos_x:
          anyOf:
            - type: number
            - type: 'null'
          title: Pos X
        pos_y:
          anyOf:
            - type: number
            - type: 'null'
          title: Pos Y
        is_global:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Global
          default: false
        global_condition:
          anyOf:
            - type: string
            - type: 'null'
          title: Global Condition
        flow_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Flow Id
      type: object
      required:
        - name
      title: FlowNodeResponseSchema
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    BranchCreateSchema:
      properties:
        to_node:
          type: string
          title: To Node
        condition:
          type: string
          title: Condition
      type: object
      required:
        - to_node
        - condition
      title: BranchCreateSchema
      description: Defines a route between two nodes.
    BranchSchema:
      properties:
        to_node:
          type: string
          title: To Node
        condition:
          type: string
          title: Condition
      type: object
      required:
        - to_node
        - condition
      title: BranchSchema
      description: Defines a route between two nodes.
  securitySchemes:
    CustomHTTPBearer:
      type: http
      scheme: bearer

````