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

# Change flow status

> Enable or disable a flow. **The flow must have a published version** for this to take effect. If the flow has never been published, this returns 200 with the flow unchanged — the status will NOT change. Use `POST .../publish` first.



## OpenAPI

````yaml /api-reference/openapi.json patch /v1/workflow/{flow_id}/status
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}/status:
    patch:
      tags:
        - Workflows
      summary: Change flow status
      description: >-
        Enable or disable a flow. **The flow must have a published version** for
        this to take effect. If the flow has never been published, this returns
        200 with the flow unchanged — the status will NOT change. Use `POST
        .../publish` first.
      operationId: set_flow_status_v1_workflow__flow_id__status_patch
      parameters:
        - name: flow_id
          in: path
          required: true
          schema:
            type: string
            title: Flow Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetFlowStatusRequest'
      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:
    SetFlowStatusRequest:
      properties:
        status:
          $ref: '#/components/schemas/FlowStatus'
          description: 'New status: ENABLED or DISABLED'
      type: object
      required:
        - status
      title: SetFlowStatusRequest
      description: Request to enable or disable a flow.
    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

````