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

# Move a branch

> Move a branch to a different position in a Router step in the flow's draft version. Changes don't affect the running flow until published.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/workflow/{flow_id}/branch/move
openapi: 3.1.0
info:
  title: Diga API
  version: 0.1.0
servers:
  - url: https://api.diga.io
    description: Production
security: []
paths:
  /v1/workflow/{flow_id}/branch/move:
    post:
      tags:
        - Workflows - Branches
      summary: Move a branch
      description: >-
        Move a branch to a different position in a Router step in the flow's
        draft version. Changes don't affect the running flow until published.
      operationId: move_branch_v1_workflow__flow_id__branch_move_post
      parameters:
        - name: flow_id
          in: path
          required: true
          schema:
            type: string
            title: Flow Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MoveBranchRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FlowAllResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - CustomHTTPBearer: []
components:
  schemas:
    MoveBranchRequest:
      properties:
        stepName:
          type: string
          title: Stepname
          description: Router step name
        branchIndex:
          type: integer
          title: Branchindex
          description: Current index of the branch
        newIndex:
          type: integer
          title: Newindex
          description: New position for the branch
      type: object
      required:
        - stepName
        - branchIndex
        - newIndex
      title: MoveBranchRequest
      description: Request to move a branch to a different position.
    FlowAllResponse:
      properties:
        id:
          type: string
          title: Id
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        created:
          type: string
          format: date-time
          title: Created
        updated:
          type: string
          format: date-time
          title: Updated
        status:
          anyOf:
            - $ref: '#/components/schemas/FlowStatus'
            - type: 'null'
        flow_category:
          anyOf:
            - $ref: '#/components/schemas/FlowCategory'
            - type: 'null'
        trigger:
          anyOf:
            - $ref: '#/components/schemas/TriggerResponse'
            - type: 'null'
        produced_variables:
          items:
            type: string
          type: array
          title: Produced Variables
        consumed_variables:
          items:
            type: string
          type: array
          title: Consumed Variables
      type: object
      required:
        - id
        - created
        - updated
      title: FlowAllResponse
      description: Flow response.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    FlowStatus:
      type: string
      enum:
        - ENABLED
        - DISABLED
      title: FlowStatus
    FlowCategory:
      type: string
      enum:
        - post_call
        - during_call
        - pre_call
        - call_launcher
        - empty
      title: FlowCategory
    TriggerResponse:
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        type:
          anyOf:
            - type: string
            - type: 'null'
          title: Type
        valid:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Valid
        displayName:
          anyOf:
            - type: string
            - type: 'null'
          title: Displayname
        settings:
          anyOf:
            - $ref: '#/components/schemas/TriggerSettingsResponse'
            - type: 'null'
        nextAction:
          anyOf:
            - $ref: '#/components/schemas/StepResponse'
            - type: 'null'
      type: object
      title: TriggerResponse
      description: Trigger definition.
    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
    TriggerSettingsResponse:
      properties:
        pieceName:
          anyOf:
            - type: string
            - type: 'null'
          title: Piecename
        pieceVersion:
          anyOf:
            - type: string
            - type: 'null'
          title: Pieceversion
        triggerName:
          anyOf:
            - type: string
            - type: 'null'
          title: Triggername
        input:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Input
        propertySettings:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Propertysettings
        sampleData:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Sampledata
      type: object
      title: TriggerSettingsResponse
      description: Trigger settings.
    StepResponse:
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        type:
          anyOf:
            - type: string
            - type: 'null'
          title: Type
        valid:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Valid
        displayName:
          anyOf:
            - type: string
            - type: 'null'
          title: Displayname
        skip:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Skip
        settings:
          anyOf:
            - $ref: '#/components/schemas/StepSettingsResponse'
            - type: 'null'
        children:
          anyOf:
            - items:
                $ref: '#/components/schemas/StepResponse'
              type: array
            - type: 'null'
          title: Children
        nextAction:
          anyOf:
            - $ref: '#/components/schemas/StepResponse'
            - type: 'null'
      type: object
      title: StepResponse
      description: Step/action (recursive).
    StepSettingsResponse:
      properties:
        pieceName:
          anyOf:
            - type: string
            - type: 'null'
          title: Piecename
        pieceVersion:
          anyOf:
            - type: string
            - type: 'null'
          title: Pieceversion
        actionName:
          anyOf:
            - type: string
            - type: 'null'
          title: Actionname
        triggerName:
          anyOf:
            - type: string
            - type: 'null'
          title: Triggername
        input:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Input
        propertySettings:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Propertysettings
        sampleData:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Sampledata
        branches:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Branches
        executionType:
          anyOf:
            - type: string
            - type: 'null'
          title: Executiontype
      type: object
      title: StepSettingsResponse
      description: Step/action settings.
  securitySchemes:
    CustomHTTPBearer:
      type: http
      scheme: bearer

````