{
  "openapi": "3.1.0",
  "info": {
    "title": "AtomicPlayer API",
    "version": "1.0.0",
    "description": "Alojamiento de vídeo, configuración del reproductor, analítica y webhooks de AtomicPlayer. Cada respuesta usa success, data y error."
  },
  "servers": [
    {
      "url": "https://api.atomicplayer.ai"
    }
  ],
  "tags": [
    {
      "name": "Videos",
      "description": "Crea vídeos, pide una URL de carga y consulta el estado del procesamiento."
    },
    {
      "name": "Folders",
      "description": "Organiza los vídeos en carpetas."
    },
    {
      "name": "Tags",
      "description": "Etiqueta vídeos y reemplaza las etiquetas de un vídeo."
    },
    {
      "name": "Player",
      "description": "Lee, guarda borradores y publica la configuración del reproductor."
    },
    {
      "name": "Analytics",
      "description": "Informes de reproducción, retención, audiencia e ingresos del espacio."
    },
    {
      "name": "Webhooks",
      "description": "Suscribe una URL HTTPS pública a eventos firmados de la cuenta."
    },
    {
      "name": "API keys",
      "description": "Crea y revoca claves. Estas rutas usan una sesión del panel, no una clave de API."
    }
  ],
  "paths": {
    "/v1/videos": {
      "get": {
        "tags": [
          "Videos"
        ],
        "summary": "Listar vídeos",
        "description": "Devuelve los vídeos de un espacio. Pasa tagId para quedarte con una etiqueta. Alcance requerido: `read`.",
        "operationId": "get_v1_videos",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "query",
            "required": true,
            "description": "Id del espacio de trabajo.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "tagId",
            "in": "query",
            "required": false,
            "description": "Solo vídeos con esta etiqueta.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Listar vídeos",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "videos": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "workspaceId": {
                                "type": "string"
                              },
                              "folderId": {
                                "type": "string"
                              },
                              "title": {
                                "type": "string"
                              },
                              "status": {
                                "type": "string"
                              },
                              "durationSec": {
                                "type": "number"
                              },
                              "width": {
                                "type": "number"
                              },
                              "height": {
                                "type": "number"
                              },
                              "tagIds": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "posterUrl": {
                                "type": "string"
                              },
                              "hlsUrl": {
                                "type": "string"
                              },
                              "createdAt": {
                                "type": "string"
                              },
                              "updatedAt": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "videos": [
                      {
                        "id": "00000000-0000-4000-8000-000000000001",
                        "workspaceId": "ddaf7e61-1a65-4d59-9f94-d706fc53131a",
                        "folderId": "00000000-0000-4000-8000-000000000010",
                        "title": "Product launch VSL",
                        "status": "ready",
                        "durationSec": 186,
                        "width": 1920,
                        "height": 1080,
                        "tagIds": [
                          "00000000-0000-4000-8000-000000000020"
                        ],
                        "posterUrl": "https://cdn.example.com/abc/thumbnail.jpg",
                        "hlsUrl": "https://cdn.example.com/abc/playlist.m3u8",
                        "createdAt": "2026-07-15T10:22:00.000Z",
                        "updatedAt": "2026-07-15T10:28:00.000Z"
                      }
                    ]
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      },
      "post": {
        "tags": [
          "Videos"
        ],
        "summary": "Crear un vídeo",
        "description": "Crea el registro del vídeo. El archivo se sube aparte con la URL de carga. Alcance requerido: `write`.",
        "operationId": "post_v1_videos",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Crear un vídeo",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "workspaceId": {
                          "type": "string"
                        },
                        "folderId": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        },
                        "durationSec": {
                          "type": "number"
                        },
                        "width": {
                          "type": "number"
                        },
                        "height": {
                          "type": "number"
                        },
                        "tagIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "posterUrl": {
                          "type": "string"
                        },
                        "hlsUrl": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "00000000-0000-4000-8000-000000000001",
                    "workspaceId": "ddaf7e61-1a65-4d59-9f94-d706fc53131a",
                    "folderId": "00000000-0000-4000-8000-000000000010",
                    "title": "Product launch VSL",
                    "status": "created",
                    "durationSec": 186,
                    "width": 1920,
                    "height": 1080,
                    "tagIds": [
                      "00000000-0000-4000-8000-000000000020"
                    ],
                    "posterUrl": "https://cdn.example.com/abc/thumbnail.jpg",
                    "hlsUrl": "https://cdn.example.com/abc/playlist.m3u8",
                    "createdAt": "2026-07-15T10:22:00.000Z",
                    "updatedAt": "2026-07-15T10:28:00.000Z"
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspaceId": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "workspaceId": "ddaf7e61-1a65-4d59-9f94-d706fc53131a",
                "title": "Product launch VSL"
              }
            }
          }
        }
      }
    },
    "/v1/videos/{videoId}": {
      "get": {
        "tags": [
          "Videos"
        ],
        "summary": "Obtener un vídeo",
        "description": "Devuelve un vídeo, con las URLs de reproducción cuando ya está listo. Alcance requerido: `read`.",
        "operationId": "get_v1_videos__videoId_",
        "parameters": [
          {
            "name": "videoId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "videoId"
          }
        ],
        "responses": {
          "200": {
            "description": "Obtener un vídeo",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "workspaceId": {
                          "type": "string"
                        },
                        "folderId": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        },
                        "durationSec": {
                          "type": "number"
                        },
                        "width": {
                          "type": "number"
                        },
                        "height": {
                          "type": "number"
                        },
                        "tagIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "posterUrl": {
                          "type": "string"
                        },
                        "hlsUrl": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "00000000-0000-4000-8000-000000000001",
                    "workspaceId": "ddaf7e61-1a65-4d59-9f94-d706fc53131a",
                    "folderId": "00000000-0000-4000-8000-000000000010",
                    "title": "Product launch VSL",
                    "status": "ready",
                    "durationSec": 186,
                    "width": 1920,
                    "height": 1080,
                    "tagIds": [
                      "00000000-0000-4000-8000-000000000020"
                    ],
                    "posterUrl": "https://cdn.example.com/abc/thumbnail.jpg",
                    "hlsUrl": "https://cdn.example.com/abc/playlist.m3u8",
                    "createdAt": "2026-07-15T10:22:00.000Z",
                    "updatedAt": "2026-07-15T10:28:00.000Z"
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      },
      "patch": {
        "tags": [
          "Videos"
        ],
        "summary": "Actualizar un vídeo",
        "description": "Cambia campos como el título o la carpeta. Alcance requerido: `write`.",
        "operationId": "patch_v1_videos__videoId_",
        "parameters": [
          {
            "name": "videoId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "videoId"
          }
        ],
        "responses": {
          "200": {
            "description": "Actualizar un vídeo",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "workspaceId": {
                          "type": "string"
                        },
                        "folderId": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        },
                        "durationSec": {
                          "type": "number"
                        },
                        "width": {
                          "type": "number"
                        },
                        "height": {
                          "type": "number"
                        },
                        "tagIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "posterUrl": {
                          "type": "string"
                        },
                        "hlsUrl": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "00000000-0000-4000-8000-000000000001",
                    "workspaceId": "ddaf7e61-1a65-4d59-9f94-d706fc53131a",
                    "folderId": "00000000-0000-4000-8000-000000000010",
                    "title": "Product launch VSL",
                    "status": "ready",
                    "durationSec": 186,
                    "width": 1920,
                    "height": 1080,
                    "tagIds": [
                      "00000000-0000-4000-8000-000000000020"
                    ],
                    "posterUrl": "https://cdn.example.com/abc/thumbnail.jpg",
                    "hlsUrl": "https://cdn.example.com/abc/playlist.m3u8",
                    "createdAt": "2026-07-15T10:22:00.000Z",
                    "updatedAt": "2026-07-15T10:28:00.000Z"
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string"
                  },
                  "folderId": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "title": "Product launch VSL",
                "folderId": "00000000-0000-4000-8000-000000000010"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Videos"
        ],
        "summary": "Eliminar un vídeo",
        "description": "Elimina el vídeo del espacio de trabajo. Alcance requerido: `write`.",
        "operationId": "delete_v1_videos__videoId_",
        "parameters": [
          {
            "name": "videoId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "videoId"
          }
        ],
        "responses": {
          "200": {
            "description": "Eliminar un vídeo",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "deleted": {
                          "type": "boolean"
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "deleted": true
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/videos/{videoId}/upload-url": {
      "post": {
        "tags": [
          "Videos"
        ],
        "summary": "Crear una URL de carga",
        "description": "Devuelve un destino de carga de un solo uso. Envía el archivo allí y luego consulta el estado. Alcance requerido: `write`.",
        "operationId": "post_v1_videos__videoId__upload-url",
        "parameters": [
          {
            "name": "videoId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "videoId"
          }
        ],
        "responses": {
          "200": {
            "description": "Crear una URL de carga",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "url": {
                          "type": "string"
                        },
                        "headers": {
                          "type": "object",
                          "properties": {
                            "AuthorizationSignature": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "url": "https://video.bunnycdn.com/tusupload",
                    "headers": {
                      "AuthorizationSignature": "…"
                    }
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/videos/{videoId}/status": {
      "get": {
        "tags": [
          "Videos"
        ],
        "summary": "Obtener el estado de la carga",
        "description": "status pasa de uploading a processing y después a ready. Alcance requerido: `read`.",
        "operationId": "get_v1_videos__videoId__status",
        "parameters": [
          {
            "name": "videoId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "videoId"
          }
        ],
        "responses": {
          "200": {
            "description": "Obtener el estado de la carga",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "00000000-0000-4000-8000-000000000001",
                    "status": "processing"
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/video-folders": {
      "get": {
        "tags": [
          "Folders"
        ],
        "summary": "Listar carpetas",
        "description": "Devuelve las carpetas de un espacio. Alcance requerido: `read`.",
        "operationId": "get_v1_video-folders",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "query",
            "required": true,
            "description": "Id del espacio de trabajo.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Listar carpetas",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "folders": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "workspaceId": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "parentId": {
                                "nullable": true
                              }
                            }
                          }
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "folders": [
                      {
                        "id": "00000000-0000-4000-8000-000000000010",
                        "workspaceId": "ddaf7e61-1a65-4d59-9f94-d706fc53131a",
                        "name": "Campaigns",
                        "parentId": null
                      }
                    ]
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      },
      "post": {
        "tags": [
          "Folders"
        ],
        "summary": "Crear una carpeta",
        "description": "parentId anida la carpeta. Omítelo para una carpeta raíz. Alcance requerido: `write`.",
        "operationId": "post_v1_video-folders",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Crear una carpeta",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "workspaceId": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "parentId": {
                          "nullable": true
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "00000000-0000-4000-8000-000000000010",
                    "workspaceId": "ddaf7e61-1a65-4d59-9f94-d706fc53131a",
                    "name": "Campaigns",
                    "parentId": null
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspaceId": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "parentId": {
                    "nullable": true
                  }
                }
              },
              "example": {
                "workspaceId": "ddaf7e61-1a65-4d59-9f94-d706fc53131a",
                "name": "Campaigns",
                "parentId": null
              }
            }
          }
        }
      }
    },
    "/v1/video-tags": {
      "get": {
        "tags": [
          "Tags"
        ],
        "summary": "Listar etiquetas",
        "description": "Devuelve las etiquetas de un espacio. Alcance requerido: `read`.",
        "operationId": "get_v1_video-tags",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "query",
            "required": true,
            "description": "Id del espacio de trabajo.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Listar etiquetas",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "tags": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "workspaceId": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "tags": [
                      {
                        "id": "00000000-0000-4000-8000-000000000020",
                        "workspaceId": "ddaf7e61-1a65-4d59-9f94-d706fc53131a",
                        "name": "Launch"
                      }
                    ]
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      },
      "post": {
        "tags": [
          "Tags"
        ],
        "summary": "Crear una etiqueta",
        "description": "Crea una etiqueta que se puede adjuntar a vídeos. Alcance requerido: `write`.",
        "operationId": "post_v1_video-tags",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Crear una etiqueta",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "workspaceId": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "00000000-0000-4000-8000-000000000020",
                    "workspaceId": "ddaf7e61-1a65-4d59-9f94-d706fc53131a",
                    "name": "Launch"
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspaceId": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "workspaceId": "ddaf7e61-1a65-4d59-9f94-d706fc53131a",
                "name": "Launch"
              }
            }
          }
        }
      }
    },
    "/v1/videos/{videoId}/tags": {
      "put": {
        "tags": [
          "Tags"
        ],
        "summary": "Reemplazar etiquetas del vídeo",
        "description": "Reemplaza la lista completa. Envía un arreglo vacío para quitar las etiquetas. Alcance requerido: `write`.",
        "operationId": "put_v1_videos__videoId__tags",
        "parameters": [
          {
            "name": "videoId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "videoId"
          }
        ],
        "responses": {
          "200": {
            "description": "Reemplazar etiquetas del vídeo",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "tagIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "00000000-0000-4000-8000-000000000001",
                    "tagIds": [
                      "00000000-0000-4000-8000-000000000020"
                    ]
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "tagIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              },
              "example": {
                "tagIds": [
                  "00000000-0000-4000-8000-000000000020"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/player-config/manage/workspace/{workspaceId}": {
      "get": {
        "tags": [
          "Player"
        ],
        "summary": "Listar reproductores",
        "description": "Devuelve las configuraciones de reproductor de un espacio. Alcance requerido: `read`.",
        "operationId": "get_v1_player-config_manage_workspace__workspaceId_",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "workspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Listar reproductores",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "players": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "workspaceId": {
                                "type": "string"
                              },
                              "videoId": {
                                "type": "string"
                              },
                              "publishedVersion": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "players": [
                      {
                        "id": "00000000-0000-4000-8000-000000000030",
                        "workspaceId": "ddaf7e61-1a65-4d59-9f94-d706fc53131a",
                        "videoId": "00000000-0000-4000-8000-000000000001",
                        "publishedVersion": 3
                      }
                    ]
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/player-config/manage/{playerId}": {
      "get": {
        "tags": [
          "Player"
        ],
        "summary": "Obtener un reproductor",
        "description": "Devuelve el borrador y la configuración publicada. Alcance requerido: `read`.",
        "operationId": "get_v1_player-config_manage__playerId_",
        "parameters": [
          {
            "name": "playerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "playerId"
          }
        ],
        "responses": {
          "200": {
            "description": "Obtener un reproductor",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "workspaceId": {
                          "type": "string"
                        },
                        "videoId": {
                          "type": "string"
                        },
                        "publishedVersion": {
                          "type": "number"
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "00000000-0000-4000-8000-000000000030",
                    "workspaceId": "ddaf7e61-1a65-4d59-9f94-d706fc53131a",
                    "videoId": "00000000-0000-4000-8000-000000000001",
                    "publishedVersion": 3
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/player-config": {
      "post": {
        "tags": [
          "Player"
        ],
        "summary": "Crear un reproductor",
        "description": "Crea un borrador para un vídeo. Publícalo antes de que el embed lo use. Alcance requerido: `write`.",
        "operationId": "post_v1_player-config",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Crear un reproductor",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "workspaceId": {
                          "type": "string"
                        },
                        "videoId": {
                          "type": "string"
                        },
                        "publishedVersion": {
                          "type": "number"
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "00000000-0000-4000-8000-000000000030",
                    "workspaceId": "ddaf7e61-1a65-4d59-9f94-d706fc53131a",
                    "videoId": "00000000-0000-4000-8000-000000000001",
                    "publishedVersion": 0
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspaceId": {
                    "type": "string"
                  },
                  "videoId": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "workspaceId": "ddaf7e61-1a65-4d59-9f94-d706fc53131a",
                "videoId": "00000000-0000-4000-8000-000000000001"
              }
            }
          }
        }
      }
    },
    "/v1/player-config/{playerId}/draft": {
      "patch": {
        "tags": [
          "Player"
        ],
        "summary": "Actualizar el borrador",
        "description": "Guarda cambios en el borrador. El embed en vivo sigue con la versión publicada. Alcance requerido: `write`.",
        "operationId": "patch_v1_player-config__playerId__draft",
        "parameters": [
          {
            "name": "playerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "playerId"
          }
        ],
        "responses": {
          "200": {
            "description": "Actualizar el borrador",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "publishedVersion": {
                          "type": "number"
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "00000000-0000-4000-8000-000000000030",
                    "publishedVersion": 3
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "appearance": {
                    "type": "object",
                    "properties": {
                      "primaryColor": {
                        "type": "string"
                      }
                    }
                  }
                }
              },
              "example": {
                "appearance": {
                  "primaryColor": "#ff7a1a"
                }
              }
            }
          }
        }
      }
    },
    "/v1/player-config/{playerId}/publish": {
      "post": {
        "tags": [
          "Player"
        ],
        "summary": "Publicar un reproductor",
        "description": "Copia el borrador al embed en vivo e incrementa publishedVersion. Alcance requerido: `write`.",
        "operationId": "post_v1_player-config__playerId__publish",
        "parameters": [
          {
            "name": "playerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "playerId"
          }
        ],
        "responses": {
          "200": {
            "description": "Publicar un reproductor",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "publishedVersion": {
                          "type": "number"
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "00000000-0000-4000-8000-000000000030",
                    "publishedVersion": 4
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/analytics/overview": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Resumen de analítica",
        "description": "Totales de vistas, reproducciones, retención, clics e ingresos. Alcance requerido: `analytics`.",
        "operationId": "get_v1_analytics_overview",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "query",
            "required": true,
            "description": "Id del espacio de trabajo.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "range",
            "in": "query",
            "required": false,
            "description": "Ventana del informe. Usa 7d, 30d, 90d o today.",
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "90d",
                "today"
              ],
              "default": "30d"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Resumen de analítica",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "views": {
                          "type": "number"
                        },
                        "plays": {
                          "type": "number"
                        },
                        "playRate": {
                          "type": "number"
                        },
                        "conversions": {
                          "type": "number"
                        },
                        "revenue": {
                          "type": "number"
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "views": 8420,
                    "plays": 5200,
                    "playRate": 0.617,
                    "conversions": 210,
                    "revenue": 3150
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/analytics/video-detail": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Analítica de un vídeo",
        "description": "Los mismos totales para un vídeo. Alcance requerido: `analytics`.",
        "operationId": "get_v1_analytics_video-detail",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "query",
            "required": true,
            "description": "Id del espacio de trabajo.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "range",
            "in": "query",
            "required": false,
            "description": "Ventana del informe. Usa 7d, 30d, 90d o today.",
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "90d",
                "today"
              ],
              "default": "30d"
            }
          },
          {
            "name": "videoId",
            "in": "query",
            "required": true,
            "description": "Id del vídeo.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Analítica de un vídeo",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "videoId": {
                          "type": "string"
                        },
                        "views": {
                          "type": "number"
                        },
                        "plays": {
                          "type": "number"
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "videoId": "00000000-0000-4000-8000-000000000001",
                    "views": 8420,
                    "plays": 5200
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/analytics/retention": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Curva de retención",
        "description": "Porcentaje de espectadores que siguen viendo en cada punto del vídeo. Alcance requerido: `analytics`.",
        "operationId": "get_v1_analytics_retention",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "query",
            "required": true,
            "description": "Id del espacio de trabajo.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "range",
            "in": "query",
            "required": false,
            "description": "Ventana del informe. Usa 7d, 30d, 90d o today.",
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "90d",
                "today"
              ],
              "default": "30d"
            }
          },
          {
            "name": "videoId",
            "in": "query",
            "required": true,
            "description": "Id del vídeo.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Curva de retención",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "points": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "second": {
                                "type": "number"
                              },
                              "retention": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "points": [
                      {
                        "second": 0,
                        "retention": 1
                      },
                      {
                        "second": 30,
                        "retention": 0.72
                      }
                    ]
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/analytics/funnel": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Embudo de reproducción",
        "description": "Impresiones, reproducciones, pitch y conversiones. Alcance requerido: `analytics`.",
        "operationId": "get_v1_analytics_funnel",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "query",
            "required": true,
            "description": "Id del espacio de trabajo.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "range",
            "in": "query",
            "required": false,
            "description": "Ventana del informe. Usa 7d, 30d, 90d o today.",
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "90d",
                "today"
              ],
              "default": "30d"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Embudo de reproducción",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "impressions": {
                          "type": "number"
                        },
                        "plays": {
                          "type": "number"
                        },
                        "conversions": {
                          "type": "number"
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "impressions": 9000,
                    "plays": 5200,
                    "conversions": 210
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/analytics/revenue": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Ingresos",
        "description": "Ingresos atribuidos a conversiones del reproductor en la ventana. Alcance requerido: `analytics`.",
        "operationId": "get_v1_analytics_revenue",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "query",
            "required": true,
            "description": "Id del espacio de trabajo.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "range",
            "in": "query",
            "required": false,
            "description": "Ventana del informe. Usa 7d, 30d, 90d o today.",
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "90d",
                "today"
              ],
              "default": "30d"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ingresos",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "revenue": {
                          "type": "number"
                        },
                        "conversions": {
                          "type": "number"
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "revenue": 3150,
                    "conversions": 210
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/analytics/cohorts": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Cohortes",
        "description": "Espectadores que vuelven, agrupados por la semana de su primera vista. Alcance requerido: `analytics`.",
        "operationId": "get_v1_analytics_cohorts",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "query",
            "required": true,
            "description": "Id del espacio de trabajo.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "range",
            "in": "query",
            "required": false,
            "description": "Ventana del informe. Usa 7d, 30d, 90d o today.",
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "90d",
                "today"
              ],
              "default": "30d"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cohortes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "cohorts": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "week": {
                                "type": "string"
                              },
                              "viewers": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "cohorts": [
                      {
                        "week": "2026-07-06",
                        "viewers": 1200
                      }
                    ]
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/analytics/audience": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Audiencia",
        "description": "Vistas por dispositivo, país y referente. Alcance requerido: `analytics`.",
        "operationId": "get_v1_analytics_audience",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "query",
            "required": true,
            "description": "Id del espacio de trabajo.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "range",
            "in": "query",
            "required": false,
            "description": "Ventana del informe. Usa 7d, 30d, 90d o today.",
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "90d",
                "today"
              ],
              "default": "30d"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Audiencia",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "devices": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "label": {
                                "type": "string"
                              },
                              "views": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "devices": [
                      {
                        "label": "mobile",
                        "views": 5100
                      }
                    ]
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/analytics/live": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Espectadores en vivo",
        "description": "Espectadores que están viendo ahora. Alcance requerido: `analytics`.",
        "operationId": "get_v1_analytics_live",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "query",
            "required": true,
            "description": "Id del espacio de trabajo.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Espectadores en vivo",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "viewers": {
                          "type": "number"
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "viewers": 18
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/analytics/replays": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Sesiones de repetición",
        "description": "Sesiones de reproducción recientes que se pueden repetir. Alcance requerido: `analytics`.",
        "operationId": "get_v1_analytics_replays",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "query",
            "required": true,
            "description": "Id del espacio de trabajo.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "range",
            "in": "query",
            "required": false,
            "description": "Ventana del informe. Usa 7d, 30d, 90d o today.",
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "90d",
                "today"
              ],
              "default": "30d"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sesiones de repetición",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "sessions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "videoId": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "sessions": [
                      {
                        "id": "sess_123",
                        "videoId": "00000000-0000-4000-8000-000000000001"
                      }
                    ]
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/analytics/video-summaries": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Resúmenes por vídeo",
        "description": "Una fila de resumen por vídeo en la ventana. Alcance requerido: `analytics`.",
        "operationId": "get_v1_analytics_video-summaries",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "query",
            "required": true,
            "description": "Id del espacio de trabajo.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "range",
            "in": "query",
            "required": false,
            "description": "Ventana del informe. Usa 7d, 30d, 90d o today.",
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "90d",
                "today"
              ],
              "default": "30d"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Resúmenes por vídeo",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "videos": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "videoId": {
                                "type": "string"
                              },
                              "title": {
                                "type": "string"
                              },
                              "views": {
                                "type": "number"
                              },
                              "plays": {
                                "type": "number"
                              }
                            }
                          }
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "videos": [
                      {
                        "videoId": "00000000-0000-4000-8000-000000000001",
                        "title": "Product launch VSL",
                        "views": 8420,
                        "plays": 5200
                      }
                    ]
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/webhooks/events": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Listar eventos de webhook",
        "description": "Los nombres de evento que una suscripción puede incluir. Alcance requerido: `webhooks`.",
        "operationId": "get_v1_webhooks_events",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Listar eventos de webhook",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "events": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "events": [
                      "video.viewed",
                      "video.completed",
                      "video.uploaded"
                    ]
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/webhooks": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Listar webhooks",
        "description": "Devuelve los endpoints de un espacio. Los secretos no se incluyen. Alcance requerido: `webhooks`.",
        "operationId": "get_v1_webhooks",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "query",
            "required": true,
            "description": "Id del espacio de trabajo.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Listar webhooks",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "webhooks": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "url": {
                                "type": "string"
                              },
                              "events": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "status": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "webhooks": [
                      {
                        "id": "00000000-0000-4000-8000-000000000040",
                        "name": "CRM",
                        "url": "https://example.com/atomicplayer",
                        "events": [
                          "video.viewed"
                        ],
                        "status": "active"
                      }
                    ]
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      },
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Crear un webhook",
        "description": "events es una lista de nombres del catálogo, o [\"*\"] para todos. El secreto de firma se devuelve una vez. Alcance requerido: `webhooks`.",
        "operationId": "post_v1_webhooks",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Crear un webhook",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "secret": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "00000000-0000-4000-8000-000000000040",
                    "secret": "whsec_…",
                    "status": "active"
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspaceId": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "url": {
                    "type": "string"
                  },
                  "events": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              },
              "example": {
                "workspaceId": "ddaf7e61-1a65-4d59-9f94-d706fc53131a",
                "name": "CRM",
                "url": "https://example.com/atomicplayer",
                "events": [
                  "video.viewed",
                  "video.completed"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/webhooks/{id}": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Obtener un webhook",
        "description": "Devuelve un endpoint sin su secreto. Alcance requerido: `webhooks`.",
        "operationId": "get_v1_webhooks__id_",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "id"
          }
        ],
        "responses": {
          "200": {
            "description": "Obtener un webhook",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        },
                        "events": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "00000000-0000-4000-8000-000000000040",
                    "name": "CRM",
                    "status": "active",
                    "events": [
                      "video.viewed"
                    ]
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      },
      "patch": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Actualizar un webhook",
        "description": "Cambia el nombre, la URL, los eventos o el estado. status es active o paused. Alcance requerido: `webhooks`.",
        "operationId": "patch_v1_webhooks__id_",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "id"
          }
        ],
        "responses": {
          "200": {
            "description": "Actualizar un webhook",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "00000000-0000-4000-8000-000000000040",
                    "status": "paused"
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "status": "paused"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Eliminar un webhook",
        "description": "Detiene las entregas a este endpoint. Alcance requerido: `webhooks`.",
        "operationId": "delete_v1_webhooks__id_",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "id"
          }
        ],
        "responses": {
          "200": {
            "description": "Eliminar un webhook",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "deleted": {
                          "type": "boolean"
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "deleted": true
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/webhooks/{id}/deliveries": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Listar entregas",
        "description": "Intentos de entrega recientes de un endpoint. Alcance requerido: `webhooks`.",
        "operationId": "get_v1_webhooks__id__deliveries",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "id"
          }
        ],
        "responses": {
          "200": {
            "description": "Listar entregas",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "deliveries": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "eventType": {
                                "type": "string"
                              },
                              "status": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "deliveries": [
                      {
                        "id": "del_123",
                        "eventType": "video.viewed",
                        "status": "succeeded"
                      }
                    ]
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/webhooks/{id}/test": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Enviar un evento de prueba",
        "description": "Entrega un evento de ejemplo al endpoint. Alcance requerido: `webhooks`.",
        "operationId": "post_v1_webhooks__id__test",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "id"
          }
        ],
        "responses": {
          "200": {
            "description": "Enviar un evento de prueba",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "delivered": {
                          "type": "boolean"
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "delivered": true
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/webhooks/{id}/rotate-secret": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Rotar el secreto de firma",
        "description": "Devuelve un secreto nuevo una vez. El secreto anterior deja de verificar. Alcance requerido: `webhooks`.",
        "operationId": "post_v1_webhooks__id__rotate-secret",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "id"
          }
        ],
        "responses": {
          "200": {
            "description": "Rotar el secreto de firma",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "secret": {
                          "type": "string"
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "secret": "whsec_…"
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/webhooks/stats": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Estadísticas de webhooks",
        "description": "Salud de las entregas del espacio. Alcance requerido: `webhooks`.",
        "operationId": "get_v1_webhooks_stats",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "query",
            "required": true,
            "description": "Id del espacio de trabajo.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Estadísticas de webhooks",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "active": {
                          "type": "number"
                        },
                        "failing": {
                          "type": "number"
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "active": 2,
                    "failing": 0
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspaceId}/api-keys": {
      "get": {
        "tags": [
          "API keys"
        ],
        "summary": "Listar claves de API",
        "description": "Usa una sesión del panel. Las claves en texto plano no se vuelven a devolver.",
        "operationId": "get_v1_workspaces__workspaceId__api-keys",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "workspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "Listar claves de API",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "keys": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "prefix": {
                                "type": "string"
                              },
                              "scopes": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "last4": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "keys": [
                      {
                        "id": "00000000-0000-4000-8000-000000000060",
                        "name": "Production",
                        "prefix": "apk_a1b2",
                        "scopes": [
                          "read",
                          "write"
                        ],
                        "last4": "9f3c"
                      }
                    ]
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ]
      },
      "post": {
        "tags": [
          "API keys"
        ],
        "summary": "Crear una clave de API",
        "description": "Devuelve la clave en texto plano una vez. Empieza por apk_.",
        "operationId": "post_v1_workspaces__workspaceId__api-keys",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "workspaceId"
          }
        ],
        "responses": {
          "201": {
            "description": "Crear una clave de API",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "key": {
                          "type": "string"
                        },
                        "scopes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "00000000-0000-4000-8000-000000000060",
                    "key": "apk_…",
                    "scopes": [
                      "read",
                      "write"
                    ]
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "scopes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              },
              "example": {
                "name": "Production",
                "scopes": [
                  "read",
                  "write"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/api-keys/{keyId}": {
      "patch": {
        "tags": [
          "API keys"
        ],
        "summary": "Actualizar una clave de API",
        "description": "Cambia el nombre o los alcances. El secreto sigue igual.",
        "operationId": "patch_v1_workspaces__workspaceId__api-keys__keyId_",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "workspaceId"
          },
          {
            "name": "keyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "keyId"
          }
        ],
        "responses": {
          "200": {
            "description": "Actualizar una clave de API",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "scopes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "00000000-0000-4000-8000-000000000060",
                    "name": "Production",
                    "scopes": [
                      "read"
                    ]
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "scopes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              },
              "example": {
                "name": "Production",
                "scopes": [
                  "read"
                ]
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "API keys"
        ],
        "summary": "Revocar una clave de API",
        "description": "La clave deja de funcionar de inmediato.",
        "operationId": "delete_v1_workspaces__workspaceId__api-keys__keyId_",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "workspaceId"
          },
          {
            "name": "keyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "keyId"
          }
        ],
        "responses": {
          "200": {
            "description": "Revocar una clave de API",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "deleted": {
                          "type": "boolean"
                        }
                      }
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "deleted": true
                  },
                  "error": null
                }
              }
            }
          },
          "400": {
            "description": "Falta un campo obligatorio o hay un valor inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "El token Bearer falta, es inválido o fue revocado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "El token es válido, pero no incluye el alcance requerido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "El registro no existe en este espacio de trabajo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "El espacio de trabajo agotó su cupo mensual de la API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Clave de API creada en el panel. Envía Authorization: Bearer apk_…"
      },
      "session": {
        "type": "http",
        "scheme": "bearer",
        "description": "Sesión del panel. Solo se usa para crear y administrar claves de API."
      }
    },
    "schemas": {
      "ErrorEnvelope": {
        "type": "object",
        "required": [
          "success",
          "data",
          "error"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              false
            ]
          },
          "data": {
            "nullable": true
          },
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "details": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  }
}
