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

# Descontinuar flow

> Deja de aceptar nuevas aperturas del flow

## Conceptos

Marca el flow como `DEPRECATED`. Deja de aceptar nuevas aperturas, pero las sesiones ya en curso siguen hasta el final.

Úsalo cuando publiques una versión nueva del flow y quieras retirar la anterior sin cortar a quien está rellenándola.

<Warning>
  Descontinuar no se puede deshacer.
</Warning>


## OpenAPI

````yaml es/flows/openapi.json POST /whatsapp/businesses/{wabaId}/flows/{flowId}/deprecate
openapi: 3.1.0
info:
  title: Omni Z-API - Flows de WhatsApp
  description: >-
    API para crear y gestionar WhatsApp Flows (formularios nativos dentro de la
    conversación)
  version: 1.0.0
servers:
  - url: https://api.omni.z-api.io
security:
  - bearerAuth: []
paths:
  /whatsapp/businesses/{wabaId}/flows/{flowId}/deprecate:
    post:
      tags:
        - Flows
      summary: Descontinuar flow
      description: >-
        Marca el flow como `DEPRECATED`. Deja de aceptar nuevas aperturas, pero
        las sesiones en curso continúan.
      operationId: deprecateFlow
      parameters:
        - name: wabaId
          in: path
          required: true
          description: ID de la WABA (obtenido con Listar WABAs)
          schema:
            type: string
            example: '428083093730937'
        - name: flowId
          in: path
          required: true
          description: ID del flow (obtenido con Listar flows)
          schema:
            type: string
            example: '1122334455667788'
      responses:
        '200':
          description: Operación realizada correctamente
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Flow'
              example:
                id: '1122334455667788'
                name: agendamento_consulta
                categories:
                  - APPOINTMENT_BOOKING
                status: DEPRECATED
                endpoint_uri: null
                validation_errors: []
        '401':
          description: Token no válido o ausente.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Flow no encontrado
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: >-
            Regla de negocio incumplida: un flow publicado no admite cambios en
            el `flow_json`, o eliminación de un flow fuera de `DRAFT`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Flow:
      type: object
      properties:
        id:
          type: string
          description: ID del flow
        name:
          type: string
          description: Nombre del flow
        categories:
          type: array
          description: Categorías del flow (Meta las usa en la revisión)
          items:
            type: string
            enum:
              - SIGN_UP
              - SIGN_IN
              - APPOINTMENT_BOOKING
              - LEAD_GENERATION
              - CONTACT_US
              - CUSTOMER_SUPPORT
              - SURVEY
              - OTHER
        status:
          type: string
          enum:
            - DRAFT
            - PUBLISHED
            - DEPRECATED
            - BLOCKED
            - THROTTLED
          description: Estado de publicación
        endpoint_uri:
          type: string
          nullable: true
          description: >-
            URL de tu endpoint, obligatoria solo para los flows con
            `data_exchange`
        flow_json:
          type: string
          description: Definición de las pantallas en JSON, enviada como **string**
        validation_errors:
          type: array
          description: Incidencias de validación devueltas por Meta
          items:
            type: object
            properties:
              key:
                type: string
                description: Clave de la incidencia
              value:
                type: string
                description: Detalle de la incidencia
    Error:
      type: object
      properties:
        error:
          type: integer
        message:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````