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

# Update a flow

> Updates the configuration of an existing flow, including name, description, execution logic, conditions, and target settings. Returns the updated resource (200) after a successful update.



## OpenAPI

````yaml /en/api-reference/openapi.en-v2.json put /v2/organizations/{organization_id}/flows/{flow_id}
openapi: 3.0.3
info:
  title: API Publica Portal
  version: 2.0.0
  description: Public REST API for portal
servers:
  - url: https://api.flexxible.net
    description: Portal API (production)
security:
  - bearerAuth: []
tags:
  - name: Digital activity
    description: Creation of core process groups by organization
  - name: Roles
    description: Endpoint de creacion de roles de organizacion
  - name: Usuarios
    description: Endpoint de creacion de usuarios de organizacion
  - name: Grupos de workspaces
    description: Endpoints de gestión de grupos de workspaces
  - name: Workspaces
    description: Endpoint de eliminacion de workspaces de la organizacion
  - name: Aplicaciones instaladas
    description: Endpoint de detalle de aplicación instalada de la organización
  - name: Autenticación
    description: Endpoints de autenticación y contexto de sesión
  - name: Microservicios
    description: Detalle de microservicios por organizacion
  - name: Operaciones
    description: Consulta de detalle de operaciones por organización
  - name: Organización
    description: Operaciones de organización
  - name: Objetivos de política de parches
    description: Endpoints de gestión de objetivos de política de parches
  - name: Configuraciones de producto
    description: Endpoints de gestión de configuraciones de producto
  - name: Grupos de reporte
    description: Operaciones sobre grupos de reporte
  - name: Sesiones
    description: Endpoint de detalle de sesion de la organizacion
  - name: Tenants
    description: Endpoints de gestión de tenants
paths:
  /v2/organizations/{organization_id}/flows/{flow_id}:
    put:
      tags:
        - Flows
      summary: Update a flow
      description: >-
        Updates the configuration of an existing flow, including name,
        description, execution logic, conditions, and target settings. Returns
        the updated resource (200) after a successful update.
      operationId: updateFlow
      parameters:
        - name: organization_id
          in: path
          required: true
          schema:
            type: string
            maxLength: 24
            pattern: ^[0-9a-f]{24}$
          description: The unique identifier of the organization
          example: 507f1f77bcf86cd799439011
        - name: flow_id
          in: path
          required: true
          schema:
            type: string
            maxLength: 24
            pattern: ^[0-9a-f]{24}$
          description: Unique identifier for the flow to update
          example: 507f1f77bcf86cd799439012
        - name: Accept-Language
          in: header
          required: false
          schema:
            type: string
            enum:
              - en-EN
              - es-ES
              - pt-BR
              - ca-ES
              - eu-ES
            default: es-ES
          description: >-
            Language code for text fields supporting multiple languages. When
            creating or updating resources, this specifies the language for the
            provided text values. When retrieving resources, this determines
            which language variant the multilingual text fields return. Accepted
            values: 'en-EN' (English), 'es-ES' (Spanish), 'pt-BR' (Portuguese),
            'ca-ES' (Catalan), 'eu-ES' (Basque). The default is 'es-ES' if not
            provided.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateFlowV2Request'
            examples:
              update-flow-configuration:
                summary: Update flow with new configuration
                value:
                  name:
                    en-EN: Flujo diario de copia actualizado
                    es-ES: Proceso de copia diaria actualizado
                  description:
                    en-EN: Proceso automatizado de copia diaria actualizado
                    es-ES: Proceso automatizado de copia actualizado
                  detection_only: false
                  cooldown_minutes: 120
                  enabled: true
                  init_text:
                    en-EN: Iniciando proceso de copia actualizado...
                    es-ES: Iniciando proceso de copia actualizado...
                  ok_text:
                    en-EN: Copia completada correctamente
                  ko_text:
                    en-EN: La copia fallo. Por favor, revisa los registros.
                  target:
                    type: workspaces
                    ids:
                      - 507f1f77bcf86cd799439012
                      - 507f1f77bcf86cd799439013
                  microservice_id: 507f1f77bcf86cd799439014
                  conditions:
                    - condition_type_id: 507f1f77bcf86cd799439015
                      operator: gte
                      compare_to: '90'
                      period: null
                      check_every: 600
      responses:
        '200':
          description: >-
            Flow updated successfully. The response contains the updated
            resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FlowV2'
        '400':
          $ref: '#/components/responses/BadRequest'
          description: >-
            Invalid request. Common causes: - Mandatory fields are missing -
            Invalid field values - Invalid condition configuration - Invalid
            microservice identifier
        '401':
          $ref: '#/components/responses/Unauthorized'
          description: Unauthorized - authentication required
        '404':
          $ref: '#/components/responses/NotFound'
          description: Flow or organization not found
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
          description: >-
            Unprocessable entity. Common causes: - Referenced microservice not
            found - Target referenced entities (Workspaces, Workspace groups,
            report groups) not found or do not belong - Invalid condition type -
            Flow cannot be enabled
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    UpdateFlowV2Request:
      type: object
      properties:
        name:
          $ref: '#/components/schemas/MultilangField'
          description: >-
            Flow name. At least one language key is required; each value between
            1 and 512 characters.
        description:
          $ref: '#/components/schemas/MultilangField'
          description: >-
            Flow description. At least one language key is required; each value
            between 1 and 512 characters.
        detection_only:
          type: boolean
        cooldown_minutes:
          type: number
          minimum: 10
          maximum: 1440
          description: Waiting time in minutes. Must be between 10 and 1440.
        enabled:
          type: boolean
          description: >-
            Indicates if the flow is enabled. PUT expects a complete definition;
            this field is required.
        init_text:
          $ref: '#/components/schemas/MultilangField'
          nullable: true
          description: >-
            Initial text message. Mandatory in PUT. Send null to clear;
            otherwise, an object with at least one language key; each value
            between 1 and 512 characters.
        ok_text:
          $ref: '#/components/schemas/MultilangField'
          nullable: true
          description: >-
            Success text message. Mandatory in PUT. Send null to clear;
            otherwise, object with at least one language key; each value between
            1 and 512 characters.
        ko_text:
          $ref: '#/components/schemas/MultilangField'
          nullable: true
          description: >-
            Error text message. Mandatory in PUT. Send null to clear; otherwise,
            an object with at least one language key; each value between 1 and
            512 characters.
        target:
          type: object
          properties:
            type:
              type: string
              enum:
                - all_workspaces
                - workspaces
                - workspace_groups
                - reporting_groups
            ids:
              type: array
              items:
                type: string
                maxLength: 512
          required:
            - type
        microservice_id:
          type: string
          maxLength: 24
          pattern: ^[0-9a-f]{24}$
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/FlowConditionInputV2'
      required:
        - name
        - description
        - detection_only
        - cooldown_minutes
        - enabled
        - init_text
        - ok_text
        - ko_text
        - target
        - microservice_id
        - conditions
    FlowV2:
      type: object
      description: >-
        Flow details as returned by GET flow by id. The organization is implied
        by the path `/v2/organizations/{organization_id}/flows/{flow_id}`.
        Target workspaces/groups are normalized in target.ids (MongoDB ObjectId
        hexadecimal strings).
      properties:
        id:
          type: string
          maxLength: 24
          pattern: ^[0-9a-f]{24}$
        created_at:
          type: string
          format: date-time
        name:
          type: string
          description: Resolved to Accept-Language when multilingual
        description:
          type: string
          description: Resolved to Accept-Language when multilingual
        type:
          type: string
          enum:
            - session
            - workspace
        version:
          type: number
        detection_only:
          type: boolean
        cooldown_minutes:
          type: number
          description: Waiting time in minutes
        enabled:
          type: boolean
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/FlowConditionV2'
          description: Omitted or empty when the flow has no conditions
        trigger:
          type: string
          nullable: true
        target:
          $ref: '#/components/schemas/FlowTargetSelectorV2'
          description: >-
            Execution destination: type selects the scope; ids list Workspace
            _id values, Workspace group _id values, or Reporting Group _id
            (empty when type is ALL_WORKSPACES)
        microservice_id:
          type: string
          nullable: true
          description: Linked microservice ID when present
        init_text:
          type: string
          nullable: true
          description: Resolved to Accept-Language when multilingual
        ok_text:
          type: string
          nullable: true
          description: Resolved to Accept-Language when multilingual
        ko_text:
          type: string
          nullable: true
          description: Resolved to Accept-Language when multilingual
        execution_metrics:
          $ref: '#/components/schemas/FlowExecutionMetricsV2'
          nullable: true
          description: Present when metrics are calculated for this flow
      required:
        - id
        - created_at
        - name
        - description
        - type
        - version
        - detection_only
        - cooldown_minutes
        - enabled
        - target
    MultilangField:
      type: object
      description: >-
        Multilanguage field. Keys are language codes (en-EN, es-ES, pt-BR,
        eu-ES, ca-ES). At least one key must be present. Each value must be
        between 1 and 512 characters.
      properties:
        en-EN:
          type: string
          minLength: 1
          maxLength: 512
        es-ES:
          type: string
          minLength: 1
          maxLength: 512
        pt-BR:
          type: string
          minLength: 1
          maxLength: 512
        eu-ES:
          type: string
          minLength: 1
          maxLength: 512
        ca-ES:
          type: string
          minLength: 1
          maxLength: 512
      additionalProperties: false
    FlowConditionInputV2:
      type: object
      properties:
        condition_type_id:
          type: string
          maxLength: 24
          pattern: ^[0-9a-f]{24}$
        operator:
          type: string
          enum:
            - eq
            - gt
            - lt
            - gte
            - lte
            - startsWith
            - endsWith
            - contains
            - at
        compare_to:
          type: string
          maxLength: 512
        period:
          type: number
          nullable: true
        check_every:
          type: number
      required:
        - condition_type_id
        - operator
        - compare_to
        - check_every
    FlowConditionV2:
      type: object
      properties:
        condition_type_id:
          type: string
        metric:
          type: string
        operator:
          type: string
        compare_to:
          type: string
        period:
          type: number
          nullable: true
        check_every:
          type: number
      required:
        - condition_type_id
        - metric
        - operator
        - compare_to
        - check_every
    FlowTargetSelectorV2:
      type: object
      properties:
        type:
          type: string
          enum:
            - all_workspaces
            - workspaces
            - workspace_groups
            - reporting_groups
          description: >-
            ALL_WORKSPACES: ids are always []. WORKSPACES: ids are Workspace
            document _id (24 hex). WORKSPACE_GROUPS / REPORTING_GROUPS: ids are
            group _id values.
        ids:
          type: array
          items:
            type: string
            maxLength: 24
            pattern: ^[0-9a-f]{24}$
      required:
        - type
        - ids
    FlowExecutionMetricsV2:
      type: object
      properties:
        targeted_workspaces:
          type: number
        evaluations_per_day:
          type: number
        possible_executions_per_day:
          type: number
        total_possible_executions_per_day:
          type: number
      required:
        - targeted_workspaces
        - evaluations_per_day
        - possible_executions_per_day
        - total_possible_executions_per_day
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            code:
              type: string
            details:
              type: string
          required:
            - message
            - code
      required:
        - error
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    UnprocessableEntity:
      description: Unprocessable Entity
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    TooManyRequests:
      description: Too Many Requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````