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

# Listar versiones

> Consulta el historial de versiones publicadas de una automatización.

Lista las versiones publicadas de una automatización.

## Endpoint

```text theme={null}
GET /workflows/{workflowId}/versions
```

## Ejemplo de solicitud

```bash theme={null}
curl "https://api.insuranceboosters.com/api/v1/workflows/<workflow-id>/versions" \
  -H "x-ib-api-key: TU_API_KEY"
```

## Respuesta exitosa (`200`)

```json theme={null}
[
  {
    "id": "<version-id>",
    "workflowId": "<workflow-id>",
    "versionNumber": 1,
    "snapshot": {
      "name": "Notificar pago recibido",
      "trigger": {
        "type": "webhook",
        "secret": "<webhook-secret>"
      },
      "steps": []
    },
    "createdAt": 1720000000000
  }
]
```

## Errores frecuentes

| HTTP  | Qué significa                | Qué hacer                |
| ----- | ---------------------------- | ------------------------ |
| `401` | API key inválida o faltante. | Verifica `x-ib-api-key`. |
| `404` | La automatización no existe. | Confirma `workflowId`.   |


## OpenAPI

````yaml openapi/automatizaciones-v1.yaml GET /workflows/{workflowId}/versions
openapi: 3.1.0
info:
  title: Insurance Boosters API — Automatizaciones
  version: 1.0.0
  description: >
    API pública para crear, publicar y ejecutar automatizaciones por webhook,
    cron o eventos de registros, y consultar sus versiones y ejecuciones.
  license:
    name: Propietaria
    url: https://insuranceboosters.com
servers:
  - url: https://api.insuranceboosters.com/api/v1
    description: Producción
security:
  - IbApiKey: []
tags:
  - name: Automatizaciones
    description: Definición, publicación y control de automatizaciones.
  - name: Versiones
    description: Instantáneas publicadas de una automatización.
  - name: Ejecuciones
    description: Historial y detalle de corridas.
  - name: Webhooks
    description: Disparo público de automatizaciones con trigger webhook.
paths:
  /workflows/{workflowId}/versions:
    get:
      tags:
        - Versiones
      summary: Listar versiones
      operationId: listWorkflowVersions
      parameters:
        - $ref: '#/components/parameters/WorkflowId'
      responses:
        '200':
          description: Versiones publicadas.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/WorkflowVersion'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  parameters:
    WorkflowId:
      name: workflowId
      in: path
      required: true
      description: Identificador de la automatización.
      schema:
        type: string
  schemas:
    WorkflowVersion:
      type: object
      required:
        - id
        - workflowId
        - versionNumber
        - snapshot
        - createdAt
      properties:
        id:
          type: string
        workflowId:
          type: string
        versionNumber:
          type: integer
        snapshot:
          type: object
          required:
            - name
            - trigger
            - steps
          properties:
            name:
              type: string
            trigger:
              $ref: '#/components/schemas/WorkflowTrigger'
            steps:
              type: array
              items:
                $ref: '#/components/schemas/WorkflowStep'
        createdAt:
          type: integer
    WorkflowTrigger:
      oneOf:
        - $ref: '#/components/schemas/WebhookTrigger'
        - $ref: '#/components/schemas/CronTrigger'
        - $ref: '#/components/schemas/DatabaseRecordCreatedTrigger'
        - $ref: '#/components/schemas/DatabaseRecordUpdatedTrigger'
    WorkflowStep:
      oneOf:
        - $ref: '#/components/schemas/BrowserUseStep'
        - $ref: '#/components/schemas/BrowserScriptStep'
        - $ref: '#/components/schemas/DelayStep'
        - $ref: '#/components/schemas/HttpStep'
        - $ref: '#/components/schemas/CodeStep'
    AuthError:
      type: object
      properties:
        message:
          type: string
      required:
        - message
    Error:
      type: object
      properties:
        error:
          type: string
      required:
        - error
    WebhookTrigger:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          const: webhook
        secret:
          type: string
          description: Generado por la API. Úsalo solo en la URL del webhook.
    CronTrigger:
      type: object
      required:
        - type
        - cron
        - timezone
      properties:
        type:
          type: string
          const: cron
        cron:
          type: string
          description: Expresión cron de 5 campos.
          example: 0 9 * * *
        timezone:
          type: string
          example: America/Mexico_City
    DatabaseRecordCreatedTrigger:
      type: object
      required:
        - type
        - databaseId
      properties:
        type:
          type: string
          const: database_record_created
        databaseId:
          type: string
          description: >-
            Identificador del tablero cuyos registros activarán la
            automatización.
          example: <database-id>
    DatabaseRecordUpdatedTrigger:
      type: object
      required:
        - type
        - databaseId
      properties:
        type:
          type: string
          const: database_record_updated
        databaseId:
          type: string
          description: >-
            Identificador del tablero cuyos registros activarán la
            automatización.
          example: <database-id>
    BrowserUseStep:
      type: object
      additionalProperties: false
      required:
        - actionKey
        - task
        - resultSchema
        - wait
      properties:
        id:
          type: string
        name:
          type: string
        actionKey:
          type: string
          const: browser.use
        task:
          type: string
          minLength: 1
          maxLength: 20000
          description: Tarea para el navegador. Acepta plantillas {{...}}.
        resultSchema:
          type: object
          required:
            - type
          properties:
            type:
              type: string
              const: object
          additionalProperties: true
          description: JSON Schema del output esperado. No debe declarar _files.
        wait:
          type: object
          additionalProperties: false
          properties:
            initialDelaySeconds:
              type: integer
              minimum: 0
              maximum: 604800
              default: 30
            pollIntervalSeconds:
              type: integer
              minimum: 1
              maximum: 3600
              default: 15
            timeoutSeconds:
              type: integer
              minimum: 2
              maximum: 604800
              default: 3600
    BrowserScriptStep:
      type: object
      required:
        - actionKey
        - code
      properties:
        id:
          type: string
        name:
          type: string
        actionKey:
          type: string
          const: browser.script
        code:
          type: string
          minLength: 1
          maxLength: 100000
          description: JavaScript que dirige al agente de IA con el objeto `browser`.
        input:
          type: object
          additionalProperties: true
          description: Variables disponibles como `input.*`. Acepta plantillas {{...}}.
        timeoutMs:
          type: number
    DelayStep:
      type: object
      required:
        - actionKey
        - input
      properties:
        id:
          type: string
        name:
          type: string
        actionKey:
          type: string
          const: system.delay
        input:
          type: object
          required:
            - mode
            - amount
            - unit
          properties:
            mode:
              type: string
              enum:
                - duration
            amount:
              type: integer
              minimum: 1
            unit:
              type: string
              enum:
                - seconds
                - minutes
                - hours
                - days
    HttpStep:
      type: object
      required:
        - actionKey
        - input
      properties:
        id:
          type: string
        name:
          type: string
        actionKey:
          type: string
          const: http.request
        input:
          type: object
          required:
            - method
            - url
          properties:
            method:
              type: string
              enum:
                - GET
                - POST
                - PUT
                - PATCH
                - DELETE
            url:
              type: string
            headers:
              type: object
              additionalProperties:
                type: string
            query:
              type: object
              additionalProperties: true
            body: {}
    CodeStep:
      type: object
      required:
        - actionKey
        - code
      properties:
        id:
          type: string
        name:
          type: string
        actionKey:
          type: string
          const: code.javascript
        code:
          type: string
        input:
          type: object
          additionalProperties: true
        timeoutMs:
          type: number
  responses:
    Unauthorized:
      description: API key inválida o faltante.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthError'
          example:
            message: Invalid API key.
    NotFound:
      description: Recurso no encontrado.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Workflow not found.
    InternalError:
      description: Error inesperado.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    IbApiKey:
      type: apiKey
      in: header
      name: x-ib-api-key
      description: API key emitida por Insurance Boosters.

````