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

# Consultar métricas del flow

> Devuelve envíos, conversiones, tasa de conversión e ingresos recuperados del flow en el período, con el desglose por nodo de mensaje.



## OpenAPI

````yaml /openapi.es.json get /v1/flows/{flow_id}/metrics
openapi: 3.1.0
info:
  title: API de Bevits
  version: 1.0.0
  description: >-
    API pública de solo lectura para consultar datos de CRM, compras y
    automatización de una organización de Bevits.
  license:
    name: Proprietary
    identifier: LicenseRef-Proprietary
servers:
  - url: https://api.bevits.com
    description: Producción
security:
  - bearerAuth: []
tags:
  - name: Sistema
    description: Disponibilidad de la API.
  - name: Identidad
    description: Identidad de la organización y de la clave API.
  - name: Clientes
    description: Clientes y sus relaciones.
  - name: Segmentos
    description: Segmentos de clientes.
  - name: Compras
    description: Compras importadas desde las integraciones.
  - name: Datos del CRM
    description: Etiquetas y definiciones de atributos.
  - name: Automatizaciones
    description: Flows de automatización.
  - name: Campañas
    description: Campañas de email.
paths:
  /v1/flows/{flow_id}/metrics:
    get:
      tags:
        - Automatizaciones
      summary: Consultar métricas del flow
      description: >-
        Devuelve envíos, conversiones, tasa de conversión e ingresos recuperados
        del flow en el período, con el desglose por nodo de mensaje.
      operationId: getFlowMetrics
      parameters:
        - $ref: '#/components/parameters/FlowId'
        - $ref: '#/components/parameters/MetricsSince'
        - $ref: '#/components/parameters/MetricsUntil'
      responses:
        '200':
          $ref: '#/components/responses/FlowMetrics'
        '400':
          $ref: '#/components/responses/InvalidRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/ValidationError'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  parameters:
    FlowId:
      name: flow_id
      in: path
      required: true
      description: ID público del flow.
      schema:
        type: string
        pattern: ^flw_[A-Za-z0-9_-]+$
    MetricsSince:
      name: since
      in: query
      description: >-
        Inicio de la ventana analizada. El valor predeterminado son 30 días
        atrás.
      schema:
        type: string
        format: date-time
    MetricsUntil:
      name: until
      in: query
      description: >-
        Fin de la ventana analizada. El valor predeterminado es el momento de la
        consulta.
      schema:
        type: string
        format: date-time
  responses:
    FlowMetrics:
      description: Métricas del flow en el período.
      headers:
        ETag:
          $ref: '#/components/headers/ETag'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/FlowMetrics'
    InvalidRequest:
      description: Parámetro de ruta inválido.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Clave API ausente, inválida, expirada o revocada.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              type: authentication_error
              message: Invalid API key.
              request_id: req_07f6cdc3c20249d6afcd90b4
    NotFound:
      description: El recurso no existe o pertenece a otra organización.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ValidationError:
      description: Un parámetro no superó la validación.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              type: validation_error
              message: Invalid query parameters.
              param: limit
              request_id: req_07f6cdc3c20249d6afcd90b4
    RateLimited:
      description: Límite de solicitudes superado.
      headers:
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
        X-RateLimit-Limit:
          $ref: '#/components/headers/RateLimitLimit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/RateLimitRemaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/RateLimitReset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateLimitErrorResponse'
    InternalError:
      description: Error inesperado en el servidor.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  headers:
    ETag:
      description: Identificador de la versión del contenido para caché condicional.
      schema:
        type: string
        example: '"v1-4ad31f5efb6b8f35"'
    RetryAfter:
      description: Segundos antes de volver a intentarlo.
      schema:
        type: integer
        minimum: 1
    RateLimitLimit:
      description: Límite total de la ventana actual.
      schema:
        type: integer
        example: 600
    RateLimitRemaining:
      description: Solicitudes restantes en la ventana actual.
      schema:
        type: integer
        example: 599
    RateLimitReset:
      description: Instante UTC en que termina la ventana actual.
      schema:
        type: string
        format: date-time
  schemas:
    FlowMetrics:
      type: object
      required:
        - object
        - flow_id
        - eligibility
        - since
        - until
        - attribution
        - entries
        - sent
        - delivered
        - failed
        - conversions
        - conversion_rate
        - revenue_in_cents
        - average_ticket_in_cents
        - nodes
      properties:
        object:
          type: string
          const: flow_metrics
        flow_id:
          type: string
          pattern: ^flw_[A-Za-z0-9_-]+$
        eligibility:
          type: string
          enum:
            - recovery
            - engagement_only
        since:
          type: string
          format: date-time
        until:
          type: string
          format: date-time
        attribution:
          type: object
          required:
            - model
            - window_days
            - scope
          properties:
            model:
              type: string
              const: last_touch
            window_days:
              type: integer
              minimum: 1
            scope:
              type: string
              const: abandoned_checkout
        entries:
          type: integer
          minimum: 0
        sent:
          type: integer
          minimum: 0
        delivered:
          type: integer
          minimum: 0
        failed:
          type: integer
          minimum: 0
        conversions:
          type: integer
          minimum: 0
        conversion_rate:
          type:
            - number
            - 'null'
        revenue_in_cents:
          type: integer
        average_ticket_in_cents:
          type: integer
        nodes:
          type: array
          items:
            type: object
            required:
              - node_id
              - channel
              - sent
              - delivered
              - opened
              - clicked
              - failed
              - conversions
              - revenue_in_cents
            properties:
              node_id:
                type: string
              channel:
                type: string
                enum:
                  - email
                  - sms
                  - whatsapp
              sent:
                type: integer
                minimum: 0
              delivered:
                type: integer
                minimum: 0
              opened:
                type:
                  - integer
                  - 'null'
                minimum: 0
              clicked:
                type: integer
                minimum: 0
              failed:
                type: integer
                minimum: 0
              conversions:
                type: integer
                minimum: 0
              revenue_in_cents:
                type: integer
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/Error'
    RateLimitErrorResponse:
      allOf:
        - $ref: '#/components/schemas/ErrorResponse'
        - type: object
          required:
            - retry_after
          properties:
            retry_after:
              type: integer
              minimum: 1
              description: Segundos antes de volver a intentarlo.
    Error:
      type: object
      required:
        - type
        - message
        - request_id
      properties:
        type:
          type: string
          enum:
            - authentication_error
            - conflict
            - internal_error
            - invalid_request
            - not_found
            - permission_denied
            - rate_limited
            - validation_error
        message:
          type: string
        param:
          type: string
        request_id:
          type: string
          pattern: ^req_[a-f0-9]{24}$
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: bvt_live_...
      description: Clave API creada en la configuración de la organización.

````