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

# Update Edge

> Endpoint to update a edge by its ID.
Optionally verify the edge belongs to a specific version number before updating.



## OpenAPI

````yaml https://api-prod.interactly.ai/api-docs/workflows/api.json patch /workflows/v1/edges/{edge_id}
openapi: 3.1.0
info:
  title: Interactly API
  description: API for building interactly.ai services
  version: 1.1.0
  contact:
    name: Interactly
    url: https://interactly.ai
    email: developers@interactly.ai
servers:
  - url: https://api-prod.interactly.ai
    description: API Server
security: []
paths:
  /workflows/v1/edges/{edge_id}:
    patch:
      tags:
        - Edges
      summary: Update Edge
      description: >-
        Endpoint to update a edge by its ID.

        Optionally verify the edge belongs to a specific version number before
        updating.
      operationId: workflow_service_update_edge_v1_edges__edge_id__patch
      parameters:
        - name: edge_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/PydanticObjectId'
        - name: version_number
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            description: >-
              Verify edge belongs to this version number before updating (0
              includes legacy edges)
            title: Version Number
          description: >-
            Verify edge belongs to this version number before updating (0
            includes legacy edges)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
              title: Body
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EdgesResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - bearer: []
components:
  schemas:
    PydanticObjectId:
      type: string
      maxLength: 24
      minLength: 24
      pattern: ^[0-9a-f]{24}$
      example: 5eb7cf5a86d9755df3a6c593
    EdgesResponse:
      properties:
        edge:
          $ref: '#/components/schemas/EdgesModel'
          description: Single edge object
      type: object
      required:
        - edge
      title: EdgesResponse
      description: |-
        Response model for a single edge.
        Contains an EdgesModel object.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    EdgesModel:
      properties:
        team_id:
          anyOf:
            - type: string
            - type: 'null'
          description: ID of the team that owns this edge
        created_by:
          anyOf:
            - type: string
            - type: 'null'
          description: ID of the user who created this edge
        updated_by:
          anyOf:
            - type: string
            - type: 'null'
          description: ID of the user who last updated this edge
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        _id:
          anyOf:
            - $ref: '#/components/schemas/PydanticObjectId'
            - type: 'null'
          description: MongoDB document ObjectID
        edge_config:
          anyOf:
            - oneOf:
                - $ref: '#/components/schemas/DirectEdgeConfig-Output'
                - $ref: '#/components/schemas/ConditionalEdgeConfig-Output'
                - $ref: '#/components/schemas/CompanionEdgeConfig-Output'
              discriminator:
                propertyName: type
                mapping:
                  companion:
                    $ref: '#/components/schemas/CompanionEdgeConfig-Output'
                  conditional:
                    $ref: '#/components/schemas/ConditionalEdgeConfig-Output'
                  direct:
                    $ref: '#/components/schemas/DirectEdgeConfig-Output'
            - type: 'null'
          title: Edge Config
          description: Edge Configuration
      type: object
      title: EdgesModel
      description: Stores an edge configuration present in the workflow system.
    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
    DirectEdgeConfig-Output:
      properties:
        logical_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Edge Logical ID
          description: Unique identifier for the edge
          input_field_disallowed: true
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Edge Name
          description: Name of the edge
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Edge Description
          description: Description of the edge
        workflow_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Workflow DB Object ID
          description: The DB Object ID of the workflow this entity belongs to
          input_field_not_visible: true
        version_number:
          anyOf:
            - type: integer
            - type: 'null'
          title: Workflow Version Number
          description: >-
            Version number of the workflow this entity belongs to. 0 is the
            initial version (default).
          default: 0
          input_field_not_visible: true
        disabled:
          type: boolean
          title: Disabled
          description: >-
            If true, this entity will be disabled and will not execute its
            function. Useful for testing workflows without actually executing
            this specific entity
          default: false
        miscellaneous:
          additionalProperties: true
          type: object
          title: Miscellaneous Config
          description: Miscellaneous config data that can be used by the entity
          field_visibility_level: super_admin
        source_node_logical_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Node Logical ID
          description: Logical ID of the source node for this edge
          input_field_not_visible: true
        destination_node_logical_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Destination Node Logical ID
          description: Logical ID of the target node for this edge
          input_field_not_visible: true
        type:
          type: string
          const: direct
          title: Edge Type
          description: >-
            Type of the edge. Expected to be always 'direct' for this base
            config
          default: direct
      type: object
      title: Direct Edge
    ConditionalEdgeConfig-Output:
      properties:
        logical_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Edge Logical ID
          description: Unique identifier for the edge
          input_field_disallowed: true
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Edge Name
          description: Name of the edge
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Edge Description
          description: Description of the edge
        workflow_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Workflow DB Object ID
          description: The DB Object ID of the workflow this entity belongs to
          input_field_not_visible: true
        version_number:
          anyOf:
            - type: integer
            - type: 'null'
          title: Workflow Version Number
          description: >-
            Version number of the workflow this entity belongs to. 0 is the
            initial version (default).
          default: 0
          input_field_not_visible: true
        disabled:
          type: boolean
          title: Disabled
          description: >-
            If true, this entity will be disabled and will not execute its
            function. Useful for testing workflows without actually executing
            this specific entity
          default: false
        miscellaneous:
          additionalProperties: true
          type: object
          title: Miscellaneous Config
          description: Miscellaneous config data that can be used by the entity
          field_visibility_level: super_admin
        source_node_logical_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Node Logical ID
          description: Logical ID of the source node for this edge
          input_field_not_visible: true
        destination_node_logical_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Destination Node Logical ID
          description: Logical ID of the target node for this edge
          input_field_not_visible: true
        type:
          type: string
          const: conditional
          title: Edge Type
          description: >-
            Type of the edge. Expected to be always 'conditional' for this
            config
          default: conditional
        condition:
          anyOf:
            - $ref: '#/components/schemas/ConditionConfig'
            - type: 'null'
          title: Edge Condition
          description: Condition that determines whether this edge is taken
      type: object
      title: Conditional Edge
    CompanionEdgeConfig-Output:
      properties:
        logical_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Edge Logical ID
          description: Unique identifier for the edge
          input_field_disallowed: true
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Edge Name
          description: Name of the edge
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Edge Description
          description: Description of the edge
        workflow_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Workflow DB Object ID
          description: The DB Object ID of the workflow this entity belongs to
          input_field_not_visible: true
        version_number:
          anyOf:
            - type: integer
            - type: 'null'
          title: Workflow Version Number
          description: >-
            Version number of the workflow this entity belongs to. 0 is the
            initial version (default).
          default: 0
          input_field_not_visible: true
        disabled:
          type: boolean
          title: Disabled
          description: >-
            If true, this entity will be disabled and will not execute its
            function. Useful for testing workflows without actually executing
            this specific entity
          default: false
        miscellaneous:
          additionalProperties: true
          type: object
          title: Miscellaneous Config
          description: Miscellaneous config data that can be used by the entity
          field_visibility_level: super_admin
        source_node_logical_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Node Logical ID
          description: Logical ID of the source node for this edge
          input_field_not_visible: true
        destination_node_logical_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Destination Node Logical ID
          description: Logical ID of the target node for this edge
          input_field_not_visible: true
        type:
          type: string
          const: companion
          title: Edge Type
          description: Type of the edge. Expected to be always 'companion' for this config
          default: companion
      type: object
      title: Companion Edge
    ConditionConfig:
      properties:
        condition_freeform:
          anyOf:
            - type: string
            - type: 'null'
          title: Freeform condition string
          description: >-
            Condition (expressed in natural language) that determines whether
            this path is taken
          input_field_type: textarea
        condition_expression:
          anyOf:
            - type: string
            - type: 'null'
          title: Expression condition string
          description: >-
            Condition (expressed in a structured equation with variables) that
            determines whether this path is taken
        args_schema:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Arguments JSON Schema
          description: >-
            JSON Schema describing the arguments that will be passed when
            condition_freeform is evaluated
          input_field_type: textarea
        static_messages_config:
          anyOf:
            - $ref: '#/components/schemas/StaticMessagesConfig'
            - type: 'null'
          title: Static Messages Configuration
          description: >-
            Static messages that an LLM node should emit while this tool is
            being invoked
        dynamic_messages_config:
          anyOf:
            - $ref: '#/components/schemas/DynamicMessagesConfig'
            - type: 'null'
          title: Dynamic Messages Configuration
          description: >-
            Dynamic message configuration. When set, the LLM will generate a
            message to say when this edge is taken, guided by the provided
            prompt.
      type: object
      title: ConditionConfig
    StaticMessagesConfig:
      properties:
        static_messages:
          items:
            type: string
          type: array
          title: Static Messages
          description: List of pre-configured messages from which one will be emitted
        static_messages_selection_mode:
          anyOf:
            - $ref: '#/components/schemas/SelectionMode'
            - type: 'null'
          title: Static Messages Selection Mode
          description: Selection mode for static messages
          default: random
      type: object
      title: StaticMessagesConfig
    DynamicMessagesConfig:
      properties:
        dynamic_message_prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: Dynamic Message Prompt
          description: >-
            A prompt describing what the LLM should say when this conditional
            edge is taken. The LLM will be asked to fill in a value based on
            this prompt, and the result will be emitted as an assistant
            response.
          input_field_type: textarea
      type: object
      title: DynamicMessagesConfig
    SelectionMode:
      type: string
      enum:
        - random
        - sequence
      title: SelectionMode
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: Bearer
      type: http
      description: >-
        Retrieve your API Key from [Dashboard API Keys
        Section](https://dashboard.interactly.ai/api-keys).

````